diff options
author | Paul Nasrat <pnasrat@redhat.com> | 2004-09-30 12:18:23 +0000 |
---|---|---|
committer | Paul Nasrat <pnasrat@redhat.com> | 2004-09-30 12:18:23 +0000 |
commit | 5df1a25f1ae1c31795da14baec540b4bff5785a1 (patch) | |
tree | 760b8dfa89e15cadea444206cbd6a4db37ccf238 /findpackageset.py | |
parent | e3c4c7ed4305207ccc083aae2886196f92f9b053 (diff) | |
download | anaconda-5df1a25f1ae1c31795da14baec540b4bff5785a1.tar.gz anaconda-5df1a25f1ae1c31795da14baec540b4bff5785a1.tar.xz anaconda-5df1a25f1ae1c31795da14baec540b4bff5785a1.zip |
More robust archscore calculations
Diffstat (limited to 'findpackageset.py')
-rw-r--r-- | findpackageset.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/findpackageset.py b/findpackageset.py index b67a89f52..b87dc6b85 100644 --- a/findpackageset.py +++ b/findpackageset.py @@ -43,8 +43,19 @@ def findBestArch(arch, archlist): for availarch in archlist: newscore = rpm.archscore(availarch) oldscore = rpm.archscore(bestarch) - if newscore and newscore < oldscore: - bestarch = availarch + # Both unsupported + if newscore == 0 and oldscore == 0: + continue + # If old arch is better or now unsupported and we have a better one + if oldscore < newscore: + if oldscore == 0: + bestarch = availarch + # If new arch is better but not unsupported + if newscore < oldscore: + if newscore != 0: + bestarch = availarch + if oldscore = newscore: + pass return bestarch def getAvailPackages(hdrlist): |