diff options
author | Jeremy Katz <katzj@redhat.com> | 2003-02-21 04:09:05 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2003-02-21 04:09:05 +0000 |
commit | 7e3a202f5594a775116cb0f70a7733f227ac93ae (patch) | |
tree | e77c0fc09466bee07206835ed95056aef0c7e53b /upgrade.py | |
parent | d53b1a6a4191bad0d2defb1ca961cdf00f62416e (diff) | |
download | anaconda-7e3a202f5594a775116cb0f70a7733f227ac93ae.tar.gz anaconda-7e3a202f5594a775116cb0f70a7733f227ac93ae.tar.xz anaconda-7e3a202f5594a775116cb0f70a7733f227ac93ae.zip |
pychecker fixesanaconda-9-0-base
only reset if we have an olddb path paranoia
Diffstat (limited to 'upgrade.py')
-rw-r--r-- | upgrade.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/upgrade.py b/upgrade.py index 02167db29..aa434147b 100644 --- a/upgrade.py +++ b/upgrade.py @@ -314,9 +314,10 @@ def upgradeMountFilesystems(intf, rootInfo, oldfsset, instPath): oldfsset.turnOnSwap(instPath) # move the old pre-convert db back in case of problems -def resetRpmdb(olddb): - iutil.rmrf(instPath + "/var/lib/rpm") - os.rename (olddb, instPath + "/var/lib/rpm") +def resetRpmdb(olddb, instPath): + if olddb is not None: + iutil.rmrf(instPath + "/var/lib/rpm") + os.rename (olddb, instPath + "/var/lib/rpm") rebuildTime = None @@ -379,7 +380,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): packages = findpackageset.findpackageset(id.hdList.hdlist, instPath) except rpm.error: if id.dbpath is not None: - resetRpmdb(id.dbpath) + resetRpmdb(id.dbpath, instPath) win.pop() intf.messageWindow(_("Error"), _("An error occurred when finding the packages to " @@ -448,7 +449,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): type="yesno") if rc == 0: try: - resetRpmdb(id.dbpath) + resetRpmdb(id.dbpath, instPath) except Exception, e: log("error returning rpmdb to old state: %s" %(e,)) pass @@ -465,7 +466,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): type="yesno") if rc == 0: try: - resetRpmdb(id.dbpath) + resetRpmdb(id.dbpath, instPath) except Exception, e: log("error returning rpmdb to old state: %s" %(e,)) pass @@ -496,7 +497,6 @@ def upgradeFindPackages(intf, method, id, instPath, dir): supportedUpgradeVersion = 1 if supportedUpgradeVersion == 0: - unsupportedUpgrade = 0 rc = intf.messageWindow(_("Warning"), _("Upgrades for this version of %s " "are only supported from Red Hat Linux " @@ -506,7 +506,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): type="yesno") if rc == 0: try: - resetRpmdb(id.dbpath) + resetRpmdb(id.dbpath, instPath) except Exception, e: log("error returning rpmdb to old state: %s" %(e,)) pass |