summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python
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
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')
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-dflags.patch53
-rw-r--r--meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch49
-rw-r--r--meta/recipes-devtools/python/python-smartpm_1.4.1.bb5
3 files changed, 81 insertions, 26 deletions
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-dflags.patch b/meta/recipes-devtools/python/python-smartpm/smart-dflags.patch
index 3f27262156..531ea51cad 100644
--- a/meta/recipes-devtools/python/python-smartpm/smart-dflags.patch
+++ b/meta/recipes-devtools/python/python-smartpm/smart-dflags.patch
@@ -7,34 +7,39 @@ Upstream-Status: Pending
7 7
8Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> 8Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
9 9
10diff --git a/smart/backends/rpm/pm.py b/smart/backends/rpm/pm.py 10[sgw - Added try/catch for rpm4 since it does not have setDFlags() API]
11index 707a146..aec82e7 100644 11
12--- a/smart/backends/rpm/pm.py 12Signed-off-by: Saul Wold <sgw@linux.intel.com>
13+++ b/smart/backends/rpm/pm.py 13
14@@ -106,6 +106,23 @@ class RPMPackageManager(PackageManager): 14
15Index: smart-1.4.1/smart/backends/rpm/pm.py
16===================================================================
17--- smart-1.4.1.orig/smart/backends/rpm/pm.py
18+++ smart-1.4.1/smart/backends/rpm/pm.py
19@@ -106,6 +106,26 @@ class RPMPackageManager(PackageManager):
15 flags |= rpm.RPMTRANS_FLAG_TEST 20 flags |= rpm.RPMTRANS_FLAG_TEST
16 ts.setFlags(flags) 21 ts.setFlags(flags)
17 22
18+ dflags = ts.setDFlags(0) 23+ try:
19+ if sysconf.get("rpm-noupgrade", False): 24+ dflags = ts.setDFlags(0)
20+ dflags |= rpm.RPMDEPS_FLAG_NOUPGRADE 25+ if sysconf.get("rpm-noupgrade", False):
21+ if sysconf.get("rpm-norequires", False): 26+ dflags |= rpm.RPMDEPS_FLAG_NOUPGRADE
22+ dflags |= rpm.RPMDEPS_FLAG_NOREQUIRES 27+ if sysconf.get("rpm-norequires", False):
23+ if sysconf.get("rpm-noconflicts", False): 28+ dflags |= rpm.RPMDEPS_FLAG_NOREQUIRES
24+ dflags |= rpm.RPMDEPS_FLAG_NOCONFLICTS 29+ if sysconf.get("rpm-noconflicts", False):
25+ if sysconf.get("rpm-noobsoletes", False): 30+ dflags |= rpm.RPMDEPS_FLAG_NOCONFLICTS
26+ dflags |= rpm.RPMDEPS_FLAG_NOOBSOLETES 31+ if sysconf.get("rpm-noobsoletes", False):
27+ if sysconf.get("rpm-noparentdirs", False): 32+ dflags |= rpm.RPMDEPS_FLAG_NOOBSOLETES
28+ dflags |= rpm.RPMDEPS_FLAG_NOPARENTDIRS 33+ if sysconf.get("rpm-noparentdirs", False):
29+ if sysconf.get("rpm-nolinktos", False): 34+ dflags |= rpm.RPMDEPS_FLAG_NOPARENTDIRS
30+ dflags |= rpm.RPMDEPS_FLAG_NOLINKTOS 35+ if sysconf.get("rpm-nolinktos", False):
31+ if sysconf.get("rpm-nosuggest", False): 36+ dflags |= rpm.RPMDEPS_FLAG_NOLINKTOS
32+ dflags |= rpm.RPMDEPS_FLAG_NOSUGGEST 37+ if sysconf.get("rpm-nosuggest", False):
33+ ts.setDFlags(dflags) 38+ dflags |= rpm.RPMDEPS_FLAG_NOSUGGEST
39+ ts.setDFlags(dflags)
40+ except AttributeError, ae:
41+ pass
34+ 42+
35 # Set rpm verbosity level. 43 # Set rpm verbosity level.
36 levelname = sysconf.get('rpm-log-level') 44 levelname = sysconf.get('rpm-log-level')
37 level = { 45 level = {
38--
391.7.9.5
40
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
diff --git a/meta/recipes-devtools/python/python-smartpm_1.4.1.bb b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
index 09715794b3..f2eb33d3a3 100644
--- a/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
+++ b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
@@ -8,7 +8,7 @@ SECTION = "devel/python"
8LICENSE = "GPLv2" 8LICENSE = "GPLv2"
9LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833" 9LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833"
10 10
11DEPENDS = "python rpm gettext-native" 11DEPENDS = "python rpm gettext-native python-rpm"
12PR = "r9" 12PR = "r9"
13SRCNAME = "smart" 13SRCNAME = "smart"
14 14
@@ -32,7 +32,8 @@ SRC_URI = "\
32 file://smart-config-ignore-all-recommends.patch \ 32 file://smart-config-ignore-all-recommends.patch \
33 file://smart-attempt.patch \ 33 file://smart-attempt.patch \
34 file://smart-filename-NAME_MAX.patch \ 34 file://smart-filename-NAME_MAX.patch \
35 " 35 file://smart-rpm4-fixes.patch \
36 "
36 37
37SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6" 38SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6"
38SRC_URI[sha256sum] = "b1d519ddb43d60f293b065c28870a5d9e8b591cd49e8c68caea48ace91085eba" 39SRC_URI[sha256sum] = "b1d519ddb43d60f293b065c28870a5d9e8b591cd49e8c68caea48ace91085eba"