summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools/RPMng.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2010-06-17 14:51:29 +0000
committerSol Jerome <sol.jerome@gmail.com>2010-06-21 14:11:34 -0500
commite1479f1d62577df523393f399d5698671c8bc3a5 (patch)
treeac2f86f1e0965067d8f206a69dde1242e13162f0 /src/lib/Client/Tools/RPMng.py
parent840258d4cdbd593b5bfdf7b5c0db7aed195ec0c3 (diff)
downloadbcfg2-e1479f1d62577df523393f399d5698671c8bc3a5.tar.gz
bcfg2-e1479f1d62577df523393f399d5698671c8bc3a5.tar.bz2
bcfg2-e1479f1d62577df523393f399d5698671c8bc3a5.zip
RPMng, YUMng improvements (patch from slack)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5944 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Tools/RPMng.py')
-rw-r--r--src/lib/Client/Tools/RPMng.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/Client/Tools/RPMng.py b/src/lib/Client/Tools/RPMng.py
index 7caa9c2e4..a1e14b3a6 100644
--- a/src/lib/Client/Tools/RPMng.py
+++ b/src/lib/Client/Tools/RPMng.py
@@ -223,7 +223,16 @@ class RPMng(Bcfg2.Client.Tools.PkgTool):
if entry.get('name') in self.installed:
# There is at least one instance installed.
if self.pkg_checks == 'true' and entry.get('pkg_checks', 'true') == 'true':
- if entry.get('name') in self.installOnlyPkgs:
+ rpmTs = rpm.TransactionSet()
+ rpmHeader = None
+ for h in rpmTs.dbMatch(rpm.RPMTAG_NAME, entry.get('name')):
+ if rpmHeader is None or rpm.versionCompare(h, rpmHeader) > 0:
+ rpmHeader = h
+ rpmProvides = [ h['provides'] for h in \
+ rpmTs.dbMatch(rpm.RPMTAG_NAME, entry.get('name')) ]
+ rpmIntersection = set(rpmHeader['provides']) & \
+ set(self.installOnlyPkgs)
+ if len(rpmIntersection) > 0:
# Packages that should only be installed or removed.
# e.g. kernels.
self.logger.debug(" Install only package.")