diff options
| author | Saul Wold <sgw@linux.intel.com> | 2014-09-30 10:16:53 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-09-30 21:36:13 +0100 |
| commit | 6be3386e78ec8aac1fd1631047ddf967f4843f3d (patch) | |
| tree | b2a1286d6b07865e04caa4f81da0bb90f4a72ded /meta/recipes-devtools/python/python-smartpm | |
| parent | 5ad57f4562110ed389c81ce958788014a49f592a (diff) | |
| download | poky-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')
| -rw-r--r-- | meta/recipes-devtools/python/python-smartpm/smart-dflags.patch | 53 | ||||
| -rw-r--r-- | meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch | 49 |
2 files changed, 78 insertions, 24 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 | ||
| 8 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | 8 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> |
| 9 | 9 | ||
| 10 | diff --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] |
| 11 | index 707a146..aec82e7 100644 | 11 | |
| 12 | --- a/smart/backends/rpm/pm.py | 12 | Signed-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 | |
| 15 | Index: 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 | -- | ||
| 39 | 1.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 | |||
| 2 | This patch checks for rpm5 related functions in order to allow rpm4 | ||
| 3 | to work correctly. Currently the rpm4 archscore and filter work | ||
| 4 | differently enough that they need to be changed. | ||
| 5 | |||
| 6 | Upstream-Status: Inappropriate [OE-Core Specific] | ||
| 7 | |||
| 8 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
| 9 | |||
| 10 | Index: 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} | ||
| 33 | Index: 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 | ||
