summaryrefslogtreecommitdiffstats
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 21:36:13 +0100
commit6be3386e78ec8aac1fd1631047ddf967f4843f3d (patch)
treeb2a1286d6b07865e04caa4f81da0bb90f4a72ded /meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch
parent5ad57f4562110ed389c81ce958788014a49f592a (diff)
downloadpoky-6be3386e78ec8aac1fd1631047ddf967f4843f3d.tar.gz
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 (From OE-Core rev: 756e499a95cc928688684cc52bde8e31306e6bbc) 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 @@
1
2This patch checks for rpm5 related functions in order to allow rpm4
3to work correctly. Currently the rpm4 archscore and filter work
4differently enough that they need to be changed.
5
6Upstream-Status: Inappropriate [OE-Core Specific]
7
8Signed-off-by: Saul Wold <sgw@linux.intel.com>
9
10Index: smart-1.4.1/smart/backends/rpm/base.py
11===================================================================
12--- smart-1.4.1.orig/smart/backends/rpm/base.py
13+++ smart-1.4.1/smart/backends/rpm/base.py
14@@ -338,10 +338,14 @@ class RPMObsoletes(Depends):
15
16 _SCOREMAP = {}
17 def getArchScore(arch, _sm=_SCOREMAP):
18- if arch not in _sm:
19- score = rpm.archscore(arch)
20- _sm[arch] = score
21- return _sm.get(arch, 0)
22+ try:
23+ rpm.platformscore(arch)
24+ if arch not in _sm:
25+ score = rpm.archscore(arch)
26+ _sm[arch] = score
27+ return _sm.get(arch, 0)
28+ except AttributeError:
29+ return 1
30
31 # TODO: Embed color into nameprovides and obsoletes relations.
32 _COLORMAP = {"noarch": 0, "x86_64": 2, "ppc64": 2, "s390x": 2, "sparc64": 2}
33Index: smart-1.4.1/smart/backends/rpm/pm.py
34===================================================================
35--- smart-1.4.1.orig/smart/backends/rpm/pm.py
36+++ smart-1.4.1/smart/backends/rpm/pm.py
37@@ -235,6 +235,12 @@ class RPMPackageManager(PackageManager):
38 if sysconf.get("rpm-order"):
39 ts.order()
40 probfilter = rpm.RPMPROB_FILTER_OLDPACKAGE
41+ try:
42+ # Test for RPM5 function
43+ rpm.platformscore("")
44+ except AttributeError:
45+ probfilter |= rpm.RPMPROB_FILTER_IGNOREARCH
46+
47 if force or reinstall:
48 probfilter |= rpm.RPMPROB_FILTER_REPLACEPKG
49 probfilter |= rpm.RPMPROB_FILTER_REPLACEOLDFILES