summaryrefslogtreecommitdiffstats
path: root/packages.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2008-07-31 11:43:11 -0400
committerChris Lumens <clumens@redhat.com>2008-07-31 11:43:24 -0400
commitdea08c6442abbcd9349dc4c6c0ff408847c3926d (patch)
treeb63a4fbc6770ac32e7da6d134e2a352c3feb487c /packages.py
parent96eec2bb099fc1353c19c68905f4ba38c18cb805 (diff)
downloadanaconda-dea08c6442abbcd9349dc4c6c0ff408847c3926d.tar.gz
anaconda-dea08c6442abbcd9349dc4c6c0ff408847c3926d.tar.xz
anaconda-dea08c6442abbcd9349dc4c6c0ff408847c3926d.zip
Remove all the RPM lock files before creating a new transaction (#456949).
Diffstat (limited to 'packages.py')
-rw-r--r--packages.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/packages.py b/packages.py
index af71a2f06..50424623d 100644
--- a/packages.py
+++ b/packages.py
@@ -23,6 +23,7 @@
# Jeremy Katz <katzj@redhat.com>
#
+import glob
import iutil
import isys
import os
@@ -278,14 +279,14 @@ def rpmKernelVersionList(rootPath = "/"):
versions = []
- ts = rpm.TransactionSet(rootPath)
-
# FIXME: and make sure that the rpmdb doesn't have stale locks :/
- for rpmfile in ["__db.000", "__db.001", "__db.002", "__db.003"]:
+ for rpmfile in glob.glob("%s/var/lib/rpm/__db.*" % rootPath):
try:
- os.unlink("%s/var/lib/rpm/%s" %(rootPath, rpmfile))
+ os.unlink(rpmfile)
except:
- log.debug("failed to unlink /var/lib/rpm/%s" %(rpmfile,))
+ log.debug("failed to unlink %s" % rpmfile)
+
+ ts = rpm.TransactionSet(rootPath)
mi = ts.dbMatch('provides', 'kernel')
for h in mi: