[yum-cvs] yum/rpmUtils arch.py,1.16,1.17

Seth Vidal skvidal at linux.duke.edu
Fri Apr 27 13:00:00 UTC 2007


Update of /home/groups/yum/cvs/yum/rpmUtils
In directory login1.linux.duke.edu:/tmp/cvs-serv23130/rpmUtils

Modified Files:
	arch.py 
Log Message:

closes some obscure arch sorting issues with ppc and sparc
rh bug: 233427


Index: arch.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/rpmUtils/arch.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- arch.py	19 Mar 2007 02:37:20 -0000	1.16
+++ arch.py	27 Apr 2007 12:59:58 -0000	1.17
@@ -92,10 +92,17 @@
     
     if myarch is None:
         myarch = canonArch
-
+    
+    mybestarch = getBestArch(myarch)
+    
     if len(archlist) == 0:
         return None
-    
+    bestarch = getBestArch(myarch)
+    if bestarch != myarch:
+        bestarchchoice = getBestArchFromList(archlist, bestarch)
+        if bestarchchoice != None and bestarchchoice != "noarch":
+            return bestarchchoice
+            
     thisarch = archlist[0]
     for arch in archlist[1:]:
         val1 = archDifference(myarch, thisarch)
@@ -261,14 +268,17 @@
 # get the best usual userspace arch for the arch we're on.  this is
 # our arch unless we're on an arch that uses the secondary as its
 # userspace (eg ppc64, sparc64)
-def getBestArch():
-    arch = canonArch
+def getBestArch(myarch=None):
+    if myarch:
+        arch = myarch
+    else:
+        arch = canonArch
 
     if arch.startswith("sparc64"):
-        arch = "sparc"
+        arch = multilibArches[arch][1]
 
     if arch.startswith("ppc64"):
-        arch = "ppc"
+        arch = 'ppc'
 
     return arch
 




More information about the Yum-cvs-commits mailing list