summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Packages.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-04-06 20:40:52 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-04-06 20:40:52 +0000
commitad9b5de849066b6926138094f98b9b22509ca7e0 (patch)
tree47e9442cef977ca75a7eb1a3e9388539032fd912 /src/lib/Server/Plugins/Packages.py
parent0b088cc9ad16c4b7f5e63117fa380318a37ee697 (diff)
downloadbcfg2-ad9b5de849066b6926138094f98b9b22509ca7e0.tar.gz
bcfg2-ad9b5de849066b6926138094f98b9b22509ca7e0.tar.bz2
bcfg2-ad9b5de849066b6926138094f98b9b22509ca7e0.zip
Packages: Implement proper support for provides targets with multiple providers
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5153 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugins/Packages.py')
-rw-r--r--src/lib/Server/Plugins/Packages.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/Server/Plugins/Packages.py b/src/lib/Server/Plugins/Packages.py
index 769379e89..3ef1753fa 100644
--- a/src/lib/Server/Plugins/Packages.py
+++ b/src/lib/Server/Plugins/Packages.py
@@ -91,7 +91,13 @@ class Source(object):
else:
# provides dep
try:
- work.update(self.get_provides(metadata, item))
+ pset = self.get_provides(metadata, item)
+ if len(pset) == 1:
+ work.update(pset)
+ else:
+ if True not in [p in newpkg for p in pset]:
+ # FIXME: still hacky; unchosen multiple provides still not handled
+ unknown.add(item)
except NoData:
unknown.add(item)
work = work.difference(seen)
@@ -277,8 +283,7 @@ class APTSource(Source):
arches = [ar for ar in self.provides if ar in metadata.groups]
for arch in ['global'] + arches:
if pkgname in self.provides[arch]:
- # FIXME next round of provides HACK alert
- return set([self.provides[arch][pkgname][0]])
+ return set(self.provides[arch][pkgname])
raise NoData
class Packages(Bcfg2.Server.Plugin.Plugin,