Index: smart/backends/rpm/header.py =================================================================== --- smart/backends/rpm/header.py (revision 899) +++ smart/backends/rpm/header.py (arbetskopia) @@ -36,6 +36,11 @@ except ImportError: rpmhelper = None +try: + archscore = rpm.archscore +except AttributeError: + archscore = None + CRPMTAG_FILENAME = 1000000 CRPMTAG_FILESIZE = 1000001 CRPMTAG_MD5 = 1000005 @@ -196,7 +201,7 @@ if h[1106]: # RPMTAG_SOURCEPACKAGE continue arch = h[1022] # RPMTAG_ARCH - if rpm.archscore(arch) == 0: + if archscore and archscore(arch) == 0: continue name = h[1000] # RPMTAG_NAME Index: smart/backends/rpm/base.py =================================================================== --- smart/backends/rpm/base.py (revision 899) +++ smart/backends/rpm/base.py (arbetskopia) @@ -41,7 +41,10 @@ traceback.print_exc() raise Error, _("'rpm' python module is not available") -archscore = rpm.archscore +try: + archscore = rpm.archscore +except AttributeError: + archscore = None __all__ = ["RPMPackage", "RPMProvides", "RPMNameProvides", "RPMPreRequires", "RPMRequires", "RPMUpgrades", "RPMConflicts", "RPMObsoletes", @@ -193,7 +196,7 @@ if rc == 0: if selfver != otherver: rc = vercmp(self.version, other.version) - if rc == 0: + if archscore and rc == 0: rc = -cmp(archscore(selfarch), archscore(otherarch)) return rc == -1 Index: smart/backends/rpm/metadata.py =================================================================== --- smart/backends/rpm/metadata.py (revision 899) +++ smart/backends/rpm/metadata.py (arbetskopia) @@ -36,6 +36,11 @@ import locale import os +try: + archscore = rpm.archscore +except AttributeError: + archscore = None + NS_COMMON = "http://linux.duke.edu/metadata/common" NS_RPM = "http://linux.duke.edu/metadata/rpm" NS_FILELISTS = "http://linux.duke.edu/metadata/filelists" @@ -168,7 +173,7 @@ skip = None elif tag == ARCH: - if rpm.archscore(elem.text) == 0: + if archscore and archscore(elem.text) == 0: skip = PACKAGE else: arch = elem.text Index: smart/backends/rpm/redcarpet.py =================================================================== --- smart/backends/rpm/redcarpet.py (revision 899) +++ smart/backends/rpm/redcarpet.py (arbetskopia) @@ -30,6 +30,11 @@ BYTESPERPKG = 3000 +try: + archscore = rpm.archscore +except AttributeError: + archscore = None + class RPMRedCarpetPackageInfo(PackageInfo): def __init__(self, package, loader, info): Index: smart/backends/rpm/synthesis.py =================================================================== --- smart/backends/rpm/synthesis.py (revision 899) +++ smart/backends/rpm/synthesis.py (arbetskopia) @@ -34,6 +34,10 @@ OPERATIONRE = re.compile("\[([<>=]*) *(.+)?\]") EPOCHRE = re.compile("[0-9]+:") +try: + archscore = rpm.archscore +except AttributeError: + archscore = None class URPMISynthesisPackageInfo(PackageInfo): def __init__(self, package, loader, info): @@ -165,7 +169,7 @@ version, arch = version[:dot], version[dot+1:] versionarch = "@".join((version, arch)) - if rpm.archscore(arch) == 0: + if archscore and archscore(arch) == 0: continue name = "-".join(rpmnameparts[0:-2]) Index: smart/backends/rpm/yast2.py =================================================================== --- smart/backends/rpm/yast2.py (revision 899) +++ smart/backends/rpm/yast2.py (arbetskopia) @@ -29,6 +29,10 @@ from re import sub from textwrap import wrap +try: + archscore = rpm.archscore +except AttributeError: + archscore = None class YaST2PackageInfo(PackageInfo): def __init__(self, package, loader, info): @@ -188,7 +192,7 @@ raise Error("Error loading YaST2 channel info. Possibly " \ "corrupted file.\n%s" % self._pkginfofile) - if rpm.archscore(arch) <= 0: + if archscore and archscore(arch) <= 0: return name = nameparts[0] self.curpkgname = name