summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fstab.py1
-rw-r--r--iutil.py12
-rw-r--r--iw/lilo.py3
-rw-r--r--textw/lilo.py3
-rw-r--r--todo.py24
5 files changed, 32 insertions, 11 deletions
diff --git a/fstab.py b/fstab.py
index 508c75e71..e205c214b 100644
--- a/fstab.py
+++ b/fstab.py
@@ -96,6 +96,7 @@ class Fstab:
return (partition, fsystem)
def rootOnLoop(self):
+ if not self.setupFilesystems: return 0
for (mntpoint, partition, fsystem, doFormat, size) in self.mountList():
if mntpoint == '/':
if fsystem == "vfat":
diff --git a/iutil.py b/iutil.py
index a151eee28..f1f5728d2 100644
--- a/iutil.py
+++ b/iutil.py
@@ -207,3 +207,15 @@ def findtz(basepath, relpath):
tzdata.sort()
return tzdata
+
+def rmrf (path):
+ # this is only the very simple case.
+ files = os.listdir (path)
+ for file in files:
+ if os.path.isdir(path + '/' + file):
+ rmrf (path + '/' + file)
+ else:
+ os.unlink (path + '/' + file)
+ os.rmdir (path)
+
+
diff --git a/iw/lilo.py b/iw/lilo.py
index d4e6c5032..c93bb843b 100644
--- a/iw/lilo.py
+++ b/iw/lilo.py
@@ -141,6 +141,9 @@ class LiloWindow (InstallWindow):
self.todo.bootdisk = 1
return None
+ if not self.todo.fstab.setupFilesystems:
+ return None
+
(imageList, defaultLabel) = \
self.todo.lilo.getLiloImages(self.todo.fstab)
self.ignoreSignals = 0
diff --git a/textw/lilo.py b/textw/lilo.py
index 54ba57b49..d4315a85d 100644
--- a/textw/lilo.py
+++ b/textw/lilo.py
@@ -10,7 +10,7 @@ import string
class LiloAppendWindow:
def __call__(self, screen, todo):
- if todo.fstab.rootOnLoop():
+ if not todo.fstab.setupFilesystems or todo.fstab.rootOnLoop():
todo.skipLilo = 1
return INSTALL_NOOP
@@ -58,6 +58,7 @@ class LiloAppendWindow:
class LiloWindow:
def __call__(self, screen, todo):
+ if not todo.setupFilesystems: return INSTALL_NOOP
(mount, dev, fstype, format, size) = todo.fstab.mountList()[0]
if mount != '/': return INSTALL_NOOP
if todo.skipLilo: return INSTALL_NOOP
diff --git a/todo.py b/todo.py
index d1805abc0..b13ded1b5 100644
--- a/todo.py
+++ b/todo.py
@@ -20,6 +20,7 @@ from xf86config import XF86Config
import errno
import raid
import fstab
+import time
def _(x):
return x
@@ -716,6 +717,7 @@ class ToDo:
raid.stopAllRaid(mdList)
self.fstab.mountFilesystems (self.instPath)
self.fstab.turnOnSwap(formatSwap = 0)
+
packages = rpm.findUpgradeSet (self.hdList.hdlist, self.instPath)
# unselect all packages
@@ -735,7 +737,12 @@ class ToDo:
if package[rpm.RPMTAG_NAME] == "gmc":
hasgmc = 1
+ self.dbpath = "/var/lib/anaconda-rebuilddb" + str(int(time.time()))
+ rpm.addMacro("_rebuilddbpath", self.dbpath);
+ rc = rpm.rebuilddb (self.instPath)
+
# open up the database to check dependencies
+ rpm.addMacro("_dbpath", self.dbpath);
db = rpm.opendb (0, self.instPath)
# if we have X but not gmc, we need to turn on GNOME. We only
@@ -1056,16 +1063,13 @@ class ToDo:
self.fstab.mountFilesystems (self.instPath)
if self.upgrade:
- w = self.intf.waitWindow(_("Rebuilding"),
- _("Rebuilding RPM database..."))
- rc = rpm.rebuilddb (self.instPath)
- w.pop ()
- if rc:
- self.intf.messageWindow (_("Error"),
- _("Rebuild of RPM "
- "database failed. You may be out of disk space?"));
- # XXX do something sane here.
- raise RuntimeError, "panic"
+ # move the rebuilt db into place.
+ os.rename (self.instPath + "/var/lib/rpm",
+ self.instPath + "/var/lib/rpm-old")
+ os.rename (self.instPath + self.dbpath,
+ self.instPath + "/var/lib/rpm")
+ rpm.addMacro ("_dbpath", "%{_var}/lib/rpm")
+ iutil.rmrf (self.instPath + "/var/lib/rpm-old")
self.method.targetFstab (self.fstab)