summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-07-08 03:32:04 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-07-08 03:32:04 +0000
commit105b32dd22956e22b3800c43814a2a57bc5cbd8c (patch)
treecf52a246b1f2f65b3b2b3ea5c483bf0d7a79a16e
parentd1a6306989d0b8cf33844ef63122fb6e8adec5d7 (diff)
downloadbcfg2-105b32dd22956e22b3800c43814a2a57bc5cbd8c.tar.gz
bcfg2-105b32dd22956e22b3800c43814a2a57bc5cbd8c.tar.bz2
bcfg2-105b32dd22956e22b3800c43814a2a57bc5cbd8c.zip
Packages: Smarten up Yum dep resolver
Track all providers of required files; this allows us to use the common framework for multiple providers and gets rid of pathological behavior relating to packaging oddities (in particular, package kdebindings offering /usr/lib64/python2.4 on centos 5.2) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5315 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r--src/lib/Server/Plugins/Packages.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/lib/Server/Plugins/Packages.py b/src/lib/Server/Plugins/Packages.py
index d34f2ef08..19b4a4b41 100644
--- a/src/lib/Server/Plugins/Packages.py
+++ b/src/lib/Server/Plugins/Packages.py
@@ -226,9 +226,12 @@ class YUMSource(Source):
def parse_filelist(self, data, arch):
for pkg in data.findall(self.fl + 'package'):
- for fentry in pkg.findall(self.fl + 'file'):
- if fentry.text in self.needed_paths:
- self.filemap[arch][fentry.text] = pkg.get('name')
+ for fentry in [fe for fe in pkg.findall(self.fl + 'file') \
+ if fe.text in self.needed_paths]:
+ if fentry.text in self.filemap[arch]:
+ self.filemap[arch][fentry.text].add(pkg.get('name'))
+ else:
+ self.filemap[arch][fentry.text] = set([pkg.get('name')])
def parse_primary(self, data, arch):
if arch not in self.packages:
@@ -269,18 +272,18 @@ class YUMSource(Source):
arches = [a for a in self.arches if a in metadata.groups]
if not arches:
raise NoData
- arch = arches[0]
if required in self.provides['global']:
ret.update(Source.get_provides(self, metadata, required))
- elif required in self.provides[arch]:
+ elif required in self.provides[arches[0]]:
ret.update(Source.get_provides(self, metadata, required))
- elif required in self.filemap['global']:
- ret.update([self.filemap['global'][required]])
- elif required in self.filemap[arch]:
- ret.update([self.filemap[arch][required]])
+ else:
+ for arch in ['global'] + arches:
+ if required in self.filemap[arch]:
+ ret.update(self.filemap[arch][required])
+ if ret:
+ return ret
else:
raise NoData
- return ret
def complete(self, metadata, packages, unknown, debug):
p1, u1 = Source.complete(self, metadata, packages, unknown, debug)