diff options
author | Matt Wilson <msw@redhat.com> | 1999-08-19 19:14:46 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 1999-08-19 19:14:46 +0000 |
commit | 67a87dda23571cf97ee5b0066a7571ab6b094a5b (patch) | |
tree | 0be35fa3ef58d5340ac1f8fe20d647aceef377f7 /comps.py | |
parent | 79f119645201ba5036eecaf03f5db0be2136067b (diff) | |
download | anaconda-67a87dda23571cf97ee5b0066a7571ab6b094a5b.tar.gz anaconda-67a87dda23571cf97ee5b0066a7571ab6b094a5b.tar.xz anaconda-67a87dda23571cf97ee5b0066a7571ab6b094a5b.zip |
rpmmodule changes, other cleanups
Diffstat (limited to 'comps.py')
-rw-r--r-- | comps.py | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -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: |