summaryrefslogtreecommitdiffstats
path: root/comps.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>1999-08-19 19:14:46 +0000
committerMatt Wilson <msw@redhat.com>1999-08-19 19:14:46 +0000
commit67a87dda23571cf97ee5b0066a7571ab6b094a5b (patch)
tree0be35fa3ef58d5340ac1f8fe20d647aceef377f7 /comps.py
parent79f119645201ba5036eecaf03f5db0be2136067b (diff)
downloadanaconda-67a87dda23571cf97ee5b0066a7571ab6b094a5b.tar.gz
anaconda-67a87dda23571cf97ee5b0066a7571ab6b094a5b.tar.xz
anaconda-67a87dda23571cf97ee5b0066a7571ab6b094a5b.zip
rpmmodule changes, other cleanups
Diffstat (limited to 'comps.py')
-rw-r--r--comps.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/comps.py b/comps.py
index c439cdbc8..87bd73ac5 100644
--- a/comps.py
+++ b/comps.py
@@ -35,7 +35,22 @@ class HeaderList:
return self.packages[item]
def __init__(self, path):
- hdlist = rpm.readHeaderList(path)
+ hdlist = rpm.readHeaderListFromFile(path)
+ self.hdlist = hdlist
+ self.packages = {}
+ for h in hdlist:
+ name = h[rpm.RPMTAG_NAME]
+ if self.packages.has_key(name):
+ score1 = rpm.archscore(h[rpm.RPMTAG_ARCH])
+ score2 = rpm.archscore(self.packages[name].h[rpm.RPMTAG_ARCH])
+ if (score2 < score1):
+ self.packages[h[rpm.RPMTAG_NAME]] = Package(h)
+ else:
+ self.packages[h[rpm.RPMTAG_NAME]] = Package(h)
+
+class HeaderListFD (HeaderList):
+ def __init__(self, fd):
+ hdlist = rpm.readHeaderListFromFD (fd)
self.hdlist = hdlist
self.packages = {}
for h in hdlist: