summaryrefslogtreecommitdiffstats
path: root/comps.py
diff options
context:
space:
mode:
Diffstat (limited to 'comps.py')
-rw-r--r--comps.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/comps.py b/comps.py
index 54828cf75..2f9fc889d 100644
--- a/comps.py
+++ b/comps.py
@@ -40,13 +40,14 @@ class HeaderList:
self.packages = {}
for h in hdlist:
name = h[rpm.RPMTAG_NAME]
- if self.packages.has_key(name):
- score1 = rpm.archscore(h['arch'])
- score2 = rpm.archscore(self.packages[name].h['arch'])
- if (score1 < score2):
+ score1 = rpm.archscore(h['arch'])
+ if (score1):
+ if self.packages.has_key(name):
+ score2 = rpm.archscore(self.packages[name].h['arch'])
+ if (score1 < score2):
+ self.packages[name] = Package(h)
+ else:
self.packages[name] = Package(h)
- else:
- self.packages[name] = Package(h)
class HeaderListFromFile (HeaderList):