summaryrefslogtreecommitdiff
path: root/meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch
diff options
context:
space:
mode:
authorSaul Wold <sgw@linux.intel.com>2014-09-30 10:16:53 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-30 20:55:13 +0100
commit756e499a95cc928688684cc52bde8e31306e6bbc (patch)
tree33a1dd2e790fe183e4921cf22635897d54c93e5b /meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch
parenta3598f87bd22354cce2f2be06f09c2b24f2adb63 (diff)
downloadopenembedded-core-756e499a95cc928688684cc52bde8e31306e6bbc.tar.gz
openembedded-core-756e499a95cc928688684cc52bde8e31306e6bbc.tar.bz2
openembedded-core-756e499a95cc928688684cc52bde8e31306e6bbc.zip
python-smartpm: Add patches for rpm4
Add DEPENDS for python-rpm package from either rpm4 or rpm5 Extend the smart-dflags patch to catch an exception if the api does exist Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch')
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch b/meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch
new file mode 100644
index 0000000000..708ffe67d3
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch
@@ -0,0 +1,49 @@
+
+This patch checks for rpm5 related functions in order to allow rpm4
+to work correctly. Currently the rpm4 archscore and filter work
+differently enough that they need to be changed.
+
+Upstream-Status: Inappropriate [OE-Core Specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: smart-1.4.1/smart/backends/rpm/base.py
+===================================================================
+--- smart-1.4.1.orig/smart/backends/rpm/base.py
++++ smart-1.4.1/smart/backends/rpm/base.py
+@@ -338,10 +338,14 @@ class RPMObsoletes(Depends):
+
+ _SCOREMAP = {}
+ def getArchScore(arch, _sm=_SCOREMAP):
+- if arch not in _sm:
+- score = rpm.archscore(arch)
+- _sm[arch] = score
+- return _sm.get(arch, 0)
++ try:
++ rpm.platformscore(arch)
++ if arch not in _sm:
++ score = rpm.archscore(arch)
++ _sm[arch] = score
++ return _sm.get(arch, 0)
++ except AttributeError:
++ return 1
+
+ # TODO: Embed color into nameprovides and obsoletes relations.
+ _COLORMAP = {"noarch": 0, "x86_64": 2, "ppc64": 2, "s390x": 2, "sparc64": 2}
+Index: smart-1.4.1/smart/backends/rpm/pm.py
+===================================================================
+--- smart-1.4.1.orig/smart/backends/rpm/pm.py
++++ smart-1.4.1/smart/backends/rpm/pm.py
+@@ -235,6 +235,12 @@ class RPMPackageManager(PackageManager):
+ if sysconf.get("rpm-order"):
+ ts.order()
+ probfilter = rpm.RPMPROB_FILTER_OLDPACKAGE
++ try:
++ # Test for RPM5 function
++ rpm.platformscore("")
++ except AttributeError:
++ probfilter |= rpm.RPMPROB_FILTER_IGNOREARCH
++
+ if force or reinstall:
+ probfilter |= rpm.RPMPROB_FILTER_REPLACEPKG
+ probfilter |= rpm.RPMPROB_FILTER_REPLACEOLDFILES