summaryrefslogtreecommitdiffstats
path: root/todo.py
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2000-12-12 22:17:09 +0000
committerErik Troan <ewt@redhat.com>2000-12-12 22:17:09 +0000
commit095b3af40421c364a0207643acb16f6f8fae16d7 (patch)
treef084984ff658eab1b42837d179e244c18d98afe5 /todo.py
parentaf5a2951068a65c05aa973787a6085773e0a8ccf (diff)
downloadanaconda-095b3af40421c364a0207643acb16f6f8fae16d7.tar.gz
anaconda-095b3af40421c364a0207643acb16f6f8fae16d7.tar.xz
anaconda-095b3af40421c364a0207643acb16f6f8fae16d7.zip
check for absolute symlinks and give a nice error
Diffstat (limited to 'todo.py')
-rw-r--r--todo.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/todo.py b/todo.py
index f0c59ebe4..54657ff0f 100644
--- a/todo.py
+++ b/todo.py
@@ -1,4 +1,5 @@
-import rpm, os
+import rpm
+import os
rpm.addMacro("_i18ndomains", "redhat-dist");
import iutil, isys
@@ -28,6 +29,7 @@ import timer
import fstab
import time
import gettext_rh
+import os.path
from translate import _
from log import log
@@ -975,6 +977,25 @@ class ToDo:
if os.access("/mnt/loophost/rh-swap.img", os.R_OK):
self.fstab.setLoopbackSwapSize(-1)
+ checkLinks = [ '/etc', '/var', '/var/lib', '/var/lib/rpm',
+ '/boot' ]
+ badLinks = []
+ for n in checkLinks:
+ if not os.path.islink(self.instPath + n): continue
+ l = os.readlink(self.instPath + n)
+ if l[0] == '/':
+ badLinks.append(n)
+
+ if badLinks:
+ message = _("The following files are absolute symbolic "
+ "links, which we do not support during an "
+ "upgrade. Please change them to relative "
+ "symbolic links and restart the upgrade.\n\n")
+ for n in badLinks:
+ message = message + '\t' + n + '\n'
+ self.intf.messageWindow(("Absolute Symlinks"), message)
+ sys.exit(0)
+
self.fstab.turnOnSwap(formatSwap = 0)
self.getCompsList ()