diff options
author | Matt Wilson <msw@redhat.com> | 2000-07-24 19:30:02 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 2000-07-24 19:30:02 +0000 |
commit | 117c361002adea5401c8ca9a934da9edfb436ac6 (patch) | |
tree | 6d1c276213bee2fee57a9624331cdfeaa1d4cb96 /todo.py | |
parent | 2c3d0a21509a013776ce6bb5256dee730247c216 (diff) | |
download | anaconda-117c361002adea5401c8ca9a934da9edfb436ac6.tar.gz anaconda-117c361002adea5401c8ca9a934da9edfb436ac6.tar.xz anaconda-117c361002adea5401c8ca9a934da9edfb436ac6.zip |
fixed the rpm database rebuilding on upgrades, now that the rpmmodule's upgrade code works again
Diffstat (limited to 'todo.py')
-rw-r--r-- | todo.py | 51 |
1 files changed, 22 insertions, 29 deletions
@@ -931,31 +931,23 @@ class ToDo: self.fstab.umountFilesystems (self.instPath) sys.exit(0) -### XXXXXXXXXXXXXXXXXXXXXXXXXXX fix me - move the replace back down to -# doInstall -# rpm.addMacro("_dbpath", self.dbpath); - - # move the rebuilt db into place. - os.rename (self.instPath + "/var/lib/rpm", - self.instPath + "/var/lib/anaconda-oldrpm" + str(int(time.time()))) - 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") - - # flag this so we only do it once. - self.dbpath = None + rpm.addMacro("_dbpath", self.dbpath) + rpm.addMacro("_dbapi", "3") + try: + packages = rpm.findUpgradeSet (self.hdList.hdlist, self.instPath) + except rpm.error: + self.intf.messageWindow(_("Error"), + _("An error occured when finding the packages to " + "upgrade.")) + if self.setupFilesystems: + self.fstab.umountFilesystems (self.instPath) + sys.exit(0) + - packages = rpm.findUpgradeSet (self.hdList.hdlist, self.instPath) # unselect all packages for package in self.hdList.packages.values (): package.selected = 0 - # always upgrade all packages in Base package group - # XXX, well - people say this isn't a good idea, so we won't - # do it anymore. -# self.comps['Base'].select() - hasX = 0 hasgmc = 0 # turn on the packages in the upgrade set @@ -1429,16 +1421,17 @@ class ToDo: self.fstab.mountFilesystems (self.instPath) -# if self.upgrade and self.dbpath: + if self.upgrade and self.dbpath: # 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") -# # flag this so we only do it once. -# self.dbpath = None + iutil.rmrf (self.instPath + "/var/lib/rpm.rpmsave") + os.rename (self.instPath + "/var/lib/rpm", + self.instPath + "/var/lib/rpm.rpmsave") + os.rename (self.instPath + self.dbpath, + self.instPath + "/var/lib/rpm") + rpm.addMacro ("_dbpath", "%{_var}/lib/rpm") + rpm.addMacro ("_dbapi", "3") + # flag this so we only do it once. + self.dbpath = None self.method.systemMounted (self.fstab, self.instPath, self.hdList.selected()) |