summaryrefslogtreecommitdiffstats
path: root/comps.py
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2000-05-22 18:14:00 +0000
committerErik Troan <ewt@redhat.com>2000-05-22 18:14:00 +0000
commit789cf2add4f2fc8e45764826d9f8112f23e0f19d (patch)
tree246de688092b87977168658792b43413c5c837f8 /comps.py
parentaa105a95e264ccf4a2d0666534b78556bed54301 (diff)
downloadanaconda-789cf2add4f2fc8e45764826d9f8112f23e0f19d.tar.gz
anaconda-789cf2add4f2fc8e45764826d9f8112f23e0f19d.tar.xz
anaconda-789cf2add4f2fc8e45764826d9f8112f23e0f19d.zip
merged in compatPackagse change
Diffstat (limited to 'comps.py')
-rw-r--r--comps.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/comps.py b/comps.py
index 9219a7e94..1952f39b1 100644
--- a/comps.py
+++ b/comps.py
@@ -47,9 +47,10 @@ class HeaderList:
def list(self):
return self.packages.values()
- def __init__(self, hdlist):
+ def __init__(self, hdlist, compatPackages = None):
self.hdlist = hdlist
self.packages = {}
+ newCompat = []
for h in hdlist:
name = h[rpm.RPMTAG_NAME]
score1 = rpm.archscore(h['arch'])
@@ -57,15 +58,26 @@ class HeaderList:
if self.packages.has_key(name):
score2 = rpm.archscore(self.packages[name].h['arch'])
if (score1 < score2):
+ newCompat.append(self.packages[name])
self.packages[name] = Package(h)
+ else:
+ newCompat.append(Package(h))
else:
self.packages[name] = Package(h)
+ if compatPackages != None:
+ # don't use list + here, as it creates a new object
+ for p in newCompat:
+ compatPackages.append(p)
+ print "compatPackages", compatPackages
+
class HeaderListFromFile (HeaderList):
- def __init__(self, path):
+ def __init__(self, path, compatPackages = None):
hdlist = rpm.readHeaderListFromFile(path)
- HeaderList.__init__(self, hdlist)
+ HeaderList.__init__(self, hdlist, compatPackages = compatPackages)
+
+ print "compatPackages", compatPackages
class HeaderListFD (HeaderList):
def __init__(self, fd):