diff options
author | Jeremy Katz <katzj@redhat.com> | 2003-01-31 02:59:52 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2003-01-31 02:59:52 +0000 |
commit | 175dd8a33311aa171b8e2487cc5e7c2ac349e92d (patch) | |
tree | e988476e6c8aeb90d3ed08403eda5675bcad56f7 /upgrade.py | |
parent | f8687007393cedf1eaa518a8525727b6be7b115f (diff) | |
download | anaconda-175dd8a33311aa171b8e2487cc5e7c2ac349e92d.tar.gz anaconda-175dd8a33311aa171b8e2487cc5e7c2ac349e92d.tar.xz anaconda-175dd8a33311aa171b8e2487cc5e7c2ac349e92d.zip |
use convertdb1 to convert to new db format
Diffstat (limited to 'upgrade.py')
-rw-r--r-- | upgrade.py | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/upgrade.py b/upgrade.py index 3806c7860..b643202b4 100644 --- a/upgrade.py +++ b/upgrade.py @@ -339,36 +339,21 @@ def upgradeFindPackages(intf, method, id, instPath, dir): # we should only have to rebuild for upgrades of pre rpm 4.0.x systems # according to jbj if os.access(instPath + "/var/lib/rpm/packages.rpm", os.R_OK): - id.dbpath = "/var/lib/anaconda-rebuilddb" + rebuildTime - rpm.addMacro("_dbpath", "/var/lib/rpm") - rpm.addMacro("_dbpath_rebuild", id.dbpath) - rpm.addMacro("_dbapi", "-1") - # have to make sure this isn't set, otherwise rpm won't even - # *try* to use old-format dbs - #rpm.addMacro("__dbi_cdb", "") - - rebuildpath = instPath + id.dbpath - - try: - iutil.rmrf(rebuildpath) - except: - pass + id.dbpath = None + rebuildpath = None + + args = [ "/usr/libexec/convertdb1", + instPath + "/var/lib/rpm/packages.rpm" ] + rc = iutil.execWithRedirect(args[0], args, + stdout = "/dev/tty5", + stderr = "/dev/tty5") - rc = rpm.rebuilddb(instPath) if rc: - try: - iutil.rmrf(rebuildpath) - except: - pass - win.pop() intf.messageWindow(_("Error"), _("Rebuild of RPM database failed. " "You may be out of disk space?")) sys.exit(0) - - rpm.addMacro("_dbpath", id.dbpath) - rpm.addMacro("_dbapi", "3") else: id.dbpath = None rebuildpath = None |