The attached patch returns the correct arches on different sparc machines from my testing it seems to do the correct thing. it was created against cvs head. Comments, questions, feedback appreciated. -- ,-._|\ Dennis Gilmore, RHCE / \ Proud Australian \_.--._/ | Aurora | Fedora | v
? yum-sparc.patch Index: rpmUtils/arch.py =================================================================== RCS file: /cvsroot/yum/cvs/yum/rpmUtils/arch.py,v retrieving revision 1.13 diff -u -r1.13 arch.py --- rpmUtils/arch.py 23 Oct 2005 16:03:42 -0000 1.13 +++ rpmUtils/arch.py 27 Dec 2006 18:09:39 -0000 @@ -5,7 +5,10 @@ # dict mapping arch -> ( multicompat, best personality, biarch personality ) multilibArches = { "x86_64": ( "athlon", "x86_64", "athlon" ), - "sparc64": ( "sparc", "sparc", "sparc64" ), + "sparcv8": ( "sparc", "sparcv8", "sparc64" ), + "sparcv9": ( "sparc", "sparcv9", "sparc64" ), + "sparc64": ( "sparc", "sparcv9", "sparc64" ), + "sparc64v": ( "sparc", "sparcv9v", "sparc64v" ), "ppc64": ( "ppc", "ppc", "ppc64" ), "s390x": ( "s390", "s390x", "s390" ), "ia64": ( "i686", "ia64", "i686" ) @@ -38,7 +41,9 @@ "s390": "noarch", # sparc - "sparc64": "sparcv9", + "sparc64v": "sparc64", + "sparc64": "sparcv9v", + "sparcv9v": "sparcv9", "sparcv9": "sparcv8", "sparcv8": "sparc", "sparc": "noarch", @@ -120,12 +125,22 @@ # this returns a list of archs that are compatible with arch given if not thisarch: thisarch = getCanonArch() - + archlist = [thisarch] while arches.has_key(thisarch): thisarch = arches[thisarch] archlist.append(thisarch) - + + if archlist[0] == "sparc64": + archlist.remove("sparcv9v") + if archlist[0] == "sparcv8": + archlist.insert(0,"sparc64") + if archlist[0] == "sparcv9": + archlist.insert(0,"sparc64") + if archlist[0] == "sparcv9v": + archlist.insert(0,"sparc64") + archlist.insert(0,"sparc64v") + return archlist @@ -190,6 +205,32 @@ if vendor.find("GenuineIntel") != -1: return "ia32e" return arch + +def getCannonSPARCArch(arch): + if arch != "sparc64": + return arch + + type = None + f = open("/proc/cpuinfo", "r") + lines = f.readlines() + f.close() + + for line in lines: + if line.find("type") != -1: + type = line.split(':')[1] + break + if type is None: + return arch + + if type.find("sun4v") != -1: + return "sparc64v" + if type.find("sun4u") != -1: + return "sparcv9" + if type.find("sun4m") != -1: + return "sparcv8" + return arch + + def getCanonArch(skipRpmPlatform = 0): if not skipRpmPlatform and os.access("/etc/rpm/platform", os.R_OK): @@ -211,6 +252,8 @@ return getCanonPPCArch(arch) if arch == "x86_64": return getCanonX86_64Arch(arch) + if arch.startswith("sparc"): + return getCannonSPARCArch(arch) return arch @@ -228,7 +271,7 @@ def getBestArch(): arch = canonArch - if arch == "sparc64": + if arch.startswith("sparc64"): arch = "sparc" if arch.startswith("ppc64"): @@ -247,7 +290,7 @@ if not arches.has_key(myarch): # this is dumb, but <shrug> return myarch - if myarch == "sparc64": + if myarch.startswith("sparc64"): return "sparc" elif myarch.startswith("ppc64"): return "ppc"
_______________________________________________ Yum mailing list Yum@xxxxxxxxxxxxxxxxxxxx https://lists.dulug.duke.edu/mailman/listinfo/yum