From e1479f1d62577df523393f399d5698671c8bc3a5 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Thu, 17 Jun 2010 14:51:29 +0000 Subject: RPMng, YUMng improvements (patch from slack) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5944 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Client/Tools/RPMng.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/lib/Client/Tools/RPMng.py') 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.") -- cgit v1.2.3-1-g7c22