summaryrefslogtreecommitdiffstats
path: root/findpackageset.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-11-06 17:44:06 +0000
committerJeremy Katz <katzj@redhat.com>2002-11-06 17:44:06 +0000
commit896faa49d6cd69e9508b1f4d8593b02abd8ba0cf (patch)
tree80e4f7e58a421c5b9a4da176df3fc30f63c64894 /findpackageset.py
parent545a3c39f624e98b14332c594bf849d0fa78bf74 (diff)
downloadanaconda-896faa49d6cd69e9508b1f4d8593b02abd8ba0cf.tar.gz
anaconda-896faa49d6cd69e9508b1f4d8593b02abd8ba0cf.tar.xz
anaconda-896faa49d6cd69e9508b1f4d8593b02abd8ba0cf.zip
do archscoring of packages in the hdlist passed in since we need to only look
at packages of our architecture (#75106)
Diffstat (limited to 'findpackageset.py')
-rw-r--r--findpackageset.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/findpackageset.py b/findpackageset.py
index 0ed1c80f6..d2181da86 100644
--- a/findpackageset.py
+++ b/findpackageset.py
@@ -27,14 +27,30 @@ def addNewPackageToUpgSet(pkgDict, pkg):
-def findpackageset(hdlist, dbPath='/'):
+def findpackageset(hdrlist, dbPath='/'):
ts = rpm.TransactionSet(dbPath)
ts.setVSFlags(rpm.RPMVSF_NORSA|rpm.RPMVSF_NODSA)
ts.setFlags(rpm.RPMTRANS_FLAG_NOMD5)
pkgDict = {}
+
+ # go through and figure out which packages in the header list are
+ # actually applicable for our architecture
+ pkgDict = {}
+ for h in hdrlist:
+ score1 = rpm.archscore(h[rpm.RPMTAG_ARCH])
+ if (score1):
+ name = h[rpm.RPMTAG_NAME]
+ if pkgDict.has_key(name):
+ score2 = rpm.archscore(pkgDict[name][rpm.RPMTAG_ARCH])
+ if (score1 < score2):
+ pkgDict[name] = h
+ else:
+ pkgDict[name] = h
+ hdlist = pkgDict.values()
- # first loop through packages and find ones which are a newer
+ pkgDict = {}
+ # loop through packages and find ones which are a newer
# version than what we have
for pkg in hdlist:
mi = ts.dbMatch('name', pkg[rpm.RPMTAG_NAME])