diff options
Diffstat (limited to 'src/lib/Server/Plugins/Packages')
-rw-r--r-- | src/lib/Server/Plugins/Packages/Collection.py | 3 | ||||
-rw-r--r-- | src/lib/Server/Plugins/Packages/__init__.py | 13 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/Server/Plugins/Packages/Collection.py b/src/lib/Server/Plugins/Packages/Collection.py index aed85fe77..ab87257e1 100644 --- a/src/lib/Server/Plugins/Packages/Collection.py +++ b/src/lib/Server/Plugins/Packages/Collection.py @@ -124,8 +124,7 @@ class Collection(object): def setup_data(self, force_update=False): """ do any collection-level data setup tasks """ - for source in self.sources: - source.setup_data(force_update) + pass def complete(self, packagelist): '''Build the transitive closure of all package dependencies diff --git a/src/lib/Server/Plugins/Packages/__init__.py b/src/lib/Server/Plugins/Packages/__init__.py index 1132543f1..4fe785f40 100644 --- a/src/lib/Server/Plugins/Packages/__init__.py +++ b/src/lib/Server/Plugins/Packages/__init__.py @@ -126,22 +126,27 @@ class Packages(Bcfg2.Server.Plugin.Plugin, if collection is None: collection = Collection.factory(metadata, self.sources, self.data) + # initial is the set of packages that are explicitly specified + # in the configuration initial = set() + # base is the set of initial packages with groups expanded + base = set() to_remove = [] for struct in structures: for pkg in struct.xpath('//Package | //BoundPackage'): if pkg.get("name"): initial.add(pkg.get("name")) elif pkg.get("group"): - initial.update(collection.get_group(pkg.get("group"))) + base.update(collection.get_group(pkg.get("group"))) to_remove.append(pkg) else: self.logger.error("Malformed Package: %s" % lxml.etree.tostring(pkg)) + base.update(initial) for el in to_remove: el.getparent().remove(el) - packages, unknown = collection.complete(initial) + packages, unknown = collection.complete(base) if unknown: self.logger.info("Got %d unknown entries" % len(unknown)) self.logger.info(list(unknown)) @@ -189,6 +194,10 @@ class Packages(Bcfg2.Server.Plugin.Plugin, Collection.clear_cache() + for source in self.sources: + if not self.disableMetaData: + source.setup_data(force_update) + for cfile in glob.glob(os.path.join(self.cachepath, "cache-*")): if cfile not in cachefiles: try: |