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

Jeremy Katz katzj at linux.duke.edu
Mon Mar 19 02:37:22 UTC 2007


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

Modified Files:
	arch.py 
Log Message:
canonArch of rpmUtils.arch isn't used everywhere it could be, making it less
useful.  use it more.  patch from Bill Nottingham


Index: arch.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/rpmUtils/arch.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- arch.py	21 Jan 2007 19:52:00 -0000	1.15
+++ arch.py	19 Mar 2007 02:37:20 -0000	1.16
@@ -71,7 +71,7 @@
 def isMultiLibArch(arch=None):
     """returns true if arch is a multilib arch, false if not"""
     if arch is None:
-        arch = getCanonArch()
+        arch = canonArch
 
     if not arches.has_key(arch): # or we could check if it is noarch
         return 0
@@ -91,7 +91,7 @@
     """
     
     if myarch is None:
-        myarch = getCanonArch()
+        myarch = canonArch
 
     if len(archlist) == 0:
         return None
@@ -123,7 +123,7 @@
 def getArchList(thisarch=None):
     # this returns a list of archs that are compatible with arch given
     if not thisarch:
-        thisarch = getCanonArch()
+        thisarch = canonArch
     
     archlist = [thisarch]
     while arches.has_key(thisarch):
@@ -248,8 +248,10 @@
 
     return arch
 
+canonArch = getCanonArch()
+
 # this gets you the "compat" arch of a biarch pair
-def getMultiArchInfo(arch = getCanonArch()):
+def getMultiArchInfo(arch = canonArch):
     if multilibArches.has_key(arch):
         return multilibArches[arch]
     if arches.has_key(arch) and arches[arch] != "noarch":
@@ -276,7 +278,7 @@
        a key in the multilibArches."""
 
     if not myarch:
-        myarch = getCanonArch()
+        myarch = canonArch
 
     if not arches.has_key(myarch): # this is dumb, but <shrug>
         return myarch
@@ -301,4 +303,3 @@
     
         return basearch
         
-canonArch = getCanonArch()




More information about the Yum-cvs-commits mailing list