integ/python/python-smartpm/centos/patches/smart-flag-exclude-packages.patch
Scott Little bab9bb6b69 Internal restructuring of stx-integ
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>
2018-08-01 10:06:31 -04:00

71 lines
3.0 KiB
Diff

Add exclude-packages flag support
Allow configuring specific packages to be excluded. This will allow
users to specify things NOT to install, and if they are attempted an
error will be generated.
Upstream-Status: Pending
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Index: smart-1.4.1/smart/const.py
===================================================================
--- smart-1.4.1.orig/smart/const.py
+++ smart-1.4.1/smart/const.py
@@ -70,6 +70,7 @@ DATADIR = "/var/lib/smart/"
USERDATADIR = "~/.smart/"
CONFFILE = "config"
+LOCKED_EXCLUDE = Enum('LOCKED_EXCLUDE')
LOCKED_INSTALL = Enum('LOCKED_INSTALL')
LOCKED_REMOVE = Enum('LOCKED_REMOVE')
LOCKED_CONFLICT = Enum('LOCKED_CONFLICT')
Index: smart-1.4.1/smart/transaction.py
===================================================================
--- smart-1.4.1.orig/smart/transaction.py
+++ smart-1.4.1/smart/transaction.py
@@ -19,7 +19,7 @@
# along with Smart Package Manager; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-from smart.const import INSTALL, REMOVE, UPGRADE, FIX, REINSTALL, KEEP, LOCKED_INSTALL, LOCKED_CONFLICT, LOCKED_CONFLICT_BY, LOCKED_NO_COEXIST, LOCKED_SYSCONF, LOCKED_REMOVE
+from smart.const import INSTALL, REMOVE, UPGRADE, FIX, REINSTALL, KEEP, LOCKED_EXCLUDE, LOCKED_INSTALL, LOCKED_CONFLICT, LOCKED_CONFLICT_BY, LOCKED_NO_COEXIST, LOCKED_SYSCONF, LOCKED_REMOVE
from smart.cache import PreRequires, Package
from smart import *
@@ -29,7 +29,9 @@ def lock_reason(pkg, lockvalue):
except TypeError:
reason = None
lockvalue = None
- if reason == LOCKED_INSTALL:
+ if reason == LOCKED_EXCLUDE:
+ return _("%s is to be excluded") % pkg
+ elif reason == LOCKED_INSTALL:
return _("%s is to be installed") % pkg
elif reason == LOCKED_CONFLICT:
return _("%s conflicts with %s") % (pkg, otherpkg)
@@ -210,6 +212,10 @@ class Policy(object):
self._sysconflocked.append(pkg)
self._locked[pkg] = (LOCKED_SYSCONF, None)
+ for pkg in pkgconf.filterByFlag("exclude-packages", cache.getPackages()):
+ if pkg not in self._locked:
+ self._locked[pkg] = (LOCKED_EXCLUDE, None)
+
def runFinished(self):
self._priorities.clear()
for pkg in self._sysconflocked:
Index: smart-1.4.1/smart/commands/flag.py
===================================================================
--- smart-1.4.1.orig/smart/commands/flag.py
+++ smart-1.4.1/smart/commands/flag.py
@@ -47,6 +47,8 @@ Currently known flags are:
multi-version - Flagged packages may have more than one version
installed in the system at the same time
(backend dependent).
+ exclude-packages - Flagged packages will be excluded, if they are
+ required, an error will be generated.
ignore-recommends - Flagged packages will not be installed, if
they are only recommended by a package to be
installed rather than required.