summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@gmail.com>2014-11-05 15:01:32 +0000
committerRichard Maw <richard.maw@gmail.com>2014-11-05 18:40:37 +0000
commitebc8dd2e403a8a75a59976cce9d69ddea22125f8 (patch)
treeda0c11c8c7ee839b15f533eb489dac1a33095a3a
parenteae31f6a5a4cb263bd34ae85db327b52bc31ac91 (diff)
downloadmorph-ebc8dd2e403a8a75a59976cce9d69ddea22125f8.tar.gz
Allow strata to build-depend on a particular artifact
This is handy as, for example, you can have the initramfs scripts depend only on the build-essential-minimal artifact, so you don't need to build the whole of build-essential to build the initramfs.
-rw-r--r--morphlib/artifactresolver.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/morphlib/artifactresolver.py b/morphlib/artifactresolver.py
index e53c7511..960af9f4 100644
--- a/morphlib/artifactresolver.py
+++ b/morphlib/artifactresolver.py
@@ -151,19 +151,27 @@ class ArtifactResolver(object):
stratum_info.get('ref') or source.original_ref,
morphlib.util.sanitise_morphology_path(stratum_info['morph'])):
+ dependencies = []
+ if 'artifact' in stratum_info:
+ dependencies.append(stratum_info['artifact'])
+ elif 'artifacts' in stratum_info:
+ dependencies.extend(stratum_info['artifacts'])
+ else:
+ dependencies.extend(other_source.split_rules.artifacts)
+
# Make every stratum artifact this stratum source produces
# depend on every stratum artifact the other stratum source
# produces.
- for sta_name in other_source.split_rules.artifacts:
+ for sta_name in dependencies:
# Strata have split rules for artifacts they don't build,
# since they need to know to yield a match to its sibling
if sta_name not in other_source.artifacts:
continue
other_stratum = other_source.artifacts[sta_name]
-
- stratum_build_depends.append(other_stratum)
-
- artifacts.append(other_stratum)
+ if other_stratum not in stratum_build_depends:
+ stratum_build_depends.append(other_stratum)
+ if other_stratum not in artifacts:
+ artifacts.append(other_stratum)
for stratum in strata:
if other_source.depends_on(stratum):