summaryrefslogtreecommitdiffstats
path: root/upgrade.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-06-28 05:39:27 +0000
committerJeremy Katz <katzj@redhat.com>2002-06-28 05:39:27 +0000
commit2c5467f04601b3107777fe90d85af089cce1c6ac (patch)
treeb941fd9fb79944f956abfc7485839d44d1837efc /upgrade.py
parente6adfe57020e0c9be8e0f29f9f1a7b0ff625d7eb (diff)
downloadanaconda-2c5467f04601b3107777fe90d85af089cce1c6ac.tar.gz
anaconda-2c5467f04601b3107777fe90d85af089cce1c6ac.tar.xz
anaconda-2c5467f04601b3107777fe90d85af089cce1c6ac.zip
only do a rebuilddb on upgrades of systems which still have db 1.85 format databases
Diffstat (limited to 'upgrade.py')
-rw-r--r--upgrade.py47
1 files changed, 25 insertions, 22 deletions
diff --git a/upgrade.py b/upgrade.py
index 8c1ba14b2..94e7a2037 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -282,40 +282,43 @@ def upgradeFindPackages(intf, method, id, instPath, dir):
win = intf.waitWindow(_("Finding"),
_("Finding packages to upgrade..."))
- id.dbpath = "/var/lib/anaconda-rebuilddb" + rebuildTime
- rpm.addMacro("_dbpath", "/var/lib/rpm")
- rpm.addMacro("_dbpath_rebuild", id.dbpath)
- rpm.addMacro("_dbapi", "-1")
-
# now, set the system clock so the timestamps will be right:
if flags.setupFilesystems:
iutil.setClock(instPath)
-
- # and rebuild the database so we can run the dependency problem
- # sets against the on disk db
- rebuildpath = instPath + id.dbpath
+ # 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")
- try:
- iutil.rmrf(rebuildpath)
- except:
- pass
+ rebuildpath = instPath + id.dbpath
- rc = rpm.rebuilddb(instPath)
- if rc:
try:
iutil.rmrf(rebuildpath)
except:
pass
+
+ 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)
+ 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")
+ rpm.addMacro("_dbpath", id.dbpath)
+ rpm.addMacro("_dbapi", "3")
+ else:
+ id.dbpath = None
+
try:
import findpackageset
packages = findpackageset.findpackageset(id.hdList.hdlist, instPath)