summaryrefslogtreecommitdiffstats
path: root/findpackageset.py
diff options
context:
space:
mode:
authorPaul Nasrat <pnasrat@redhat.com>2004-09-30 12:18:23 +0000
committerPaul Nasrat <pnasrat@redhat.com>2004-09-30 12:18:23 +0000
commit5df1a25f1ae1c31795da14baec540b4bff5785a1 (patch)
tree760b8dfa89e15cadea444206cbd6a4db37ccf238 /findpackageset.py
parente3c4c7ed4305207ccc083aae2886196f92f9b053 (diff)
downloadanaconda-5df1a25f1ae1c31795da14baec540b4bff5785a1.tar.gz
anaconda-5df1a25f1ae1c31795da14baec540b4bff5785a1.tar.xz
anaconda-5df1a25f1ae1c31795da14baec540b4bff5785a1.zip
More robust archscore calculations
Diffstat (limited to 'findpackageset.py')
-rw-r--r--findpackageset.py15
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):