[yum-commits] Branch 'yum-3_2_X' - 2 commits - rpmUtils/arch.py yum/config.py
skvidal at osuosl.org
skvidal at osuosl.org
Wed Sep 16 03:07:26 UTC 2009
rpmUtils/arch.py | 4 ++++
yum/config.py | 8 +++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
New commits:
commit 0abb6e2e7daf038e07342ccf8602bd592a6a15c1
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Tue Sep 15 16:59:31 2009 -0400
Fix getCanonSPARCArch() "crash" when called on non-SPARC.
diff --git a/rpmUtils/arch.py b/rpmUtils/arch.py
index d22782b..edfc707 100644
--- a/rpmUtils/arch.py
+++ b/rpmUtils/arch.py
@@ -255,6 +255,7 @@ def getCanonPPCArch(arch):
def getCanonSPARCArch(arch):
# Deal with sun4v, sun4u, sun4m cases
+ SPARCtype = None
f = open("/proc/cpuinfo", "r")
lines = f.readlines()
f.close()
@@ -262,6 +263,9 @@ def getCanonSPARCArch(arch):
if line.startswith("type"):
SPARCtype = line.split(':')[1]
break
+ if SPARCtype is None:
+ return arch
+
if SPARCtype.find("sun4v") != -1:
if arch.startswith("sparc64"):
return "sparc64v"
commit 705ae2132f469037b9a77459aeab18a23fc08dd1
Author: Seth Vidal <skvidal at fedoraproject.org>
Date: Tue Sep 15 16:27:07 2009 -0400
get rid of DeprecationWarning which is cluttering up rpmdb open bugs.
this is more or less the same as is in sqliteSack - I've checked everywhere
else to make sure it is anywhere else. Once we stop targetting python
2.4 or 2.5 we can just drop this code entirely.
diff --git a/yum/config.py b/yum/config.py
index 2f057c3..6b3d3ae 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -893,7 +893,13 @@ def _getsysver(installroot, distroverpkg):
idx = ts.dbMatch('provides', distroverpkg)
except TypeError, e:
# This is code for "cannot open rpmdb"
- raise Errors.YumBaseError("Error: " + e.message)
+ # this is for pep 352 compliance on python 2.6 and above :(
+ if sys.hexversion < 0x02050000:
+ if hasattr(e,'message'):
+ raise Errors.YumBaseError("Error: " + str(e.message))
+ else:
+ raise Errors.YumBaseError("Error: " + str(e))
+ raise Errors.YumBaseError("Error: " + str(e))
# we're going to take the first one - if there is more than one of these
# then the user needs a beating
if idx.count() == 0:
More information about the Yum-commits
mailing list