generic-poky/meta/recipes-devtools/python/python-smartpm/smart-dflags.patch
Saul Wold 6be3386e78 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>
2014-09-30 21:36:13 +01:00

46 lines
1.7 KiB
Diff

backends/rpm: add support for setting dependency flags
This is useful for OpenEmbedded so that we can do the equivalent of
the --nolinktos and --noparentdirs rpm command line options.
Upstream-Status: Pending
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
[sgw - Added try/catch for rpm4 since it does not have setDFlags() API]
Signed-off-by: Saul Wold <sgw@linux.intel.com>
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
@@ -106,6 +106,26 @@ class RPMPackageManager(PackageManager):
flags |= rpm.RPMTRANS_FLAG_TEST
ts.setFlags(flags)
+ try:
+ dflags = ts.setDFlags(0)
+ if sysconf.get("rpm-noupgrade", False):
+ dflags |= rpm.RPMDEPS_FLAG_NOUPGRADE
+ if sysconf.get("rpm-norequires", False):
+ dflags |= rpm.RPMDEPS_FLAG_NOREQUIRES
+ if sysconf.get("rpm-noconflicts", False):
+ dflags |= rpm.RPMDEPS_FLAG_NOCONFLICTS
+ if sysconf.get("rpm-noobsoletes", False):
+ dflags |= rpm.RPMDEPS_FLAG_NOOBSOLETES
+ if sysconf.get("rpm-noparentdirs", False):
+ dflags |= rpm.RPMDEPS_FLAG_NOPARENTDIRS
+ if sysconf.get("rpm-nolinktos", False):
+ dflags |= rpm.RPMDEPS_FLAG_NOLINKTOS
+ if sysconf.get("rpm-nosuggest", False):
+ dflags |= rpm.RPMDEPS_FLAG_NOSUGGEST
+ ts.setDFlags(dflags)
+ except AttributeError, ae:
+ pass
+
# Set rpm verbosity level.
levelname = sysconf.get('rpm-log-level')
level = {