diff options
author | Jeremy Katz <katzj@redhat.com> | 2007-08-06 19:18:59 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2007-08-06 19:18:59 +0000 |
commit | eefa691b4c0560fb7d77c7d3a6473968628706f7 (patch) | |
tree | 6413378ce8f0065437d788d7d23467261934dc69 /livecd.py | |
parent | 59042ba16f15f118305c969b1804b6a13a7dffca (diff) | |
download | anaconda-eefa691b4c0560fb7d77c7d3a6473968628706f7.tar.gz anaconda-eefa691b4c0560fb7d77c7d3a6473968628706f7.tar.xz anaconda-eefa691b4c0560fb7d77c7d3a6473968628706f7.zip |
2007-08-06 Jeremy Katz <katzj@redhat.com>
* livecd.py (LiveCDCopyBackend.kernelVersionList): Check the rpmdb
of the installed root (based on feedback from Jerry Vonau)
* backend.py (AnacondaBackend.kernelVersionList): Take the
rootPath as an argument
* yuminstall.py (YumBackend.kernelVersionList): Likewise.
Diffstat (limited to 'livecd.py')
-rw-r--r-- | livecd.py | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -325,13 +325,21 @@ class LiveCDCopyBackend(backend.AnacondaBackend): def writeConfiguration(self): pass - def kernelVersionList(self): + def kernelVersionList(self, rootPath = "/"): versions = [] # FIXME: we should understand more types of kernel versions and not # be tied to rpm... import rpm - ts = rpm.TransactionSet() + 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"]: + try: + os.unlink("%s/var/lib/rpm/%s" %(rootPath, rpmfile)) + except: + log.debug("failed to unlink /var/lib/rpm/%s" %(rpmfile,)) + mi = ts.dbMatch('name', 'kernel') for h in mi: v = "%s-%s" %(h['version'], h['release']) |