summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Packages/Collection.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Server/Plugins/Packages/Collection.py')
-rw-r--r--src/lib/Server/Plugins/Packages/Collection.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/lib/Server/Plugins/Packages/Collection.py b/src/lib/Server/Plugins/Packages/Collection.py
index 32eeda1ec..e0c7e338f 100644
--- a/src/lib/Server/Plugins/Packages/Collection.py
+++ b/src/lib/Server/Plugins/Packages/Collection.py
@@ -91,10 +91,24 @@ class Collection(Bcfg2.Server.Plugin.Debuggable):
return True
return False
- def get_deps(self, package):
+ def get_deps(self, package, pinnings=None):
+ pin_found = False
+
+ pin_source = None
+ if pinnings and package in pinnings:
+ pin_source = pinnings[package]
+
for source in self.sources:
+ if pin_source and pin_source != source.name:
+ continue
+ pin_found = True
+
if source.is_package(self.metadata, package):
return source.get_deps(self.metadata, package)
+
+ if not pin_found:
+ self.logger.error("Packages: Source '%s' for package '%s' not found" %
+ (pin_source, package))
return []
def get_provides(self, package):
@@ -138,11 +152,12 @@ class Collection(Bcfg2.Server.Plugin.Debuggable):
""" do any collection-level data setup tasks """
pass
- def complete(self, packagelist):
+ def complete(self, packagelist, pinnings=None):
'''Build the transitive closure of all package dependencies
Arguments:
packageslist - set of package names
+ pinnings - mapping from package names to source names
returns => (set(packages), set(unsatisfied requirements))
'''
@@ -198,7 +213,7 @@ class Collection(Bcfg2.Server.Plugin.Debuggable):
self.debug_log("Packages: handling package requirement %s" %
current)
packages.add(current)
- deps = self.get_deps(current)
+ deps = self.get_deps(current, pinnings)
newdeps = set(deps).difference(examined)
if newdeps:
self.debug_log("Packages: Package %s added requirements %s"