bab9bb6b69
Create new directories: ceph config config-files filesystem kernel kernel/kernel-modules ldap logging strorage-drivers tools utilities virt Retire directories: connectivity core devtools support extended Delete two packages: tgt irqbalance Relocated packages: base/ dhcp initscripts libevent lighttpd linuxptp memcached net-snmp novnc ntp openssh pam procps sanlock shadow sudo systemd util-linux vim watchdog ceph/ python-cephclient config/ facter puppet-4.8.2 puppet-modules filesystem/ e2fsprogs nfs-utils nfscheck kernel/ kernel-std kernel-rt kernel/kernel-modules/ mlnx-ofa_kernel ldap/ nss-pam-ldapd openldap logging/ syslog-ng logrotate networking/ lldpd iproute mellanox python-ryu mlx4-config python/ python-2.7.5 python-django python-gunicorn python-setuptools python-smartpm python-voluptuous security/ shim-signed shim-unsigned tboot strorage-drivers/ python-3parclient python-lefthandclient virt/ cloud-init libvirt libvirt-python qemu tools/ storage-topology vm-topology utilities/ tis-extensions namespace-utils nova-utils update-motd Change-Id: I37ade764d873c701b35eac5881eb40412ba64a86 Story: 2002801 Task: 22687 Signed-off-by: Scott Little <scott.little@windriver.com>
97 lines
3.7 KiB
Diff
97 lines
3.7 KiB
Diff
From f6a853cf8138c7e01b6e093b783f97639b033420 Mon Sep 17 00:00:00 2001
|
|
From: Don Penney <don.penney@windriver.com>
|
|
Date: Thu, 2 Jun 2016 15:57:42 -0400
|
|
Subject: [PATCH 1/1] Support rpm4
|
|
|
|
Cloned from http://lists.openembedded.org/pipermail/openembedded-core/2014-September/097610.html
|
|
|
|
---
|
|
smart/backends/rpm/base.py | 12 ++++++++----
|
|
smart/backends/rpm/pm.py | 40 ++++++++++++++++++++++++----------------
|
|
2 files changed, 32 insertions(+), 20 deletions(-)
|
|
|
|
diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py
|
|
index 7140c1b..d720617 100644
|
|
--- a/smart/backends/rpm/base.py
|
|
+++ b/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}
|
|
diff --git a/smart/backends/rpm/pm.py b/smart/backends/rpm/pm.py
|
|
index 2e5b2c3..cc75dcc 100644
|
|
--- a/smart/backends/rpm/pm.py
|
|
+++ b/smart/backends/rpm/pm.py
|
|
@@ -106,22 +106,25 @@ class RPMPackageManager(PackageManager):
|
|
flags |= rpm.RPMTRANS_FLAG_TEST
|
|
ts.setFlags(flags)
|
|
|
|
- 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)
|
|
+ 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')
|
|
@@ -235,6 +238,11 @@ class RPMPackageManager(PackageManager):
|
|
if sysconf.get("rpm-ignoresize", False):
|
|
probfilter |= rpm.RPMPROB_FILTER_DISKNODES
|
|
probfilter |= rpm.RPMPROB_FILTER_DISKSPACE
|
|
+ try:
|
|
+ # Test for RPM5 function
|
|
+ rpm.platformscore("")
|
|
+ except AttributeError:
|
|
+ probfilter |= rpm.RPMPROB_FILTER_IGNOREARCH
|
|
|
|
if force or reinstall:
|
|
probfilter |= rpm.RPMPROB_FILTER_REPLACEPKG
|
|
--
|
|
1.8.3.1
|
|
|