summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2015-03-04 19:03:58 (GMT)
committerJavier Jardón <jjardon@gnome.org>2015-03-04 19:14:43 (GMT)
commit8cf5c70943817c5c24b1f8b79a67cc8ac1d7dab0 (patch)
treed32463a103a01bb63ff606f94fde422324443644
parentecc2961699488cb409e45f1a3560c0181caf56d5 (diff)
downloadmorph-jjardon/no_build_depends.tar.gz
Do not fail if a chunk doesnt have a 'build-depends' parameter definedjjardon/no_build_depends
-rw-r--r--morphlib/artifactresolver.py17
-rw-r--r--morphlib/morphloader.py13
2 files changed, 10 insertions, 20 deletions
diff --git a/morphlib/artifactresolver.py b/morphlib/artifactresolver.py
index e53c751..5062f85 100644
--- a/morphlib/artifactresolver.py
+++ b/morphlib/artifactresolver.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014 Codethink Limited
+# Copyright (C) 2012-2015 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -195,13 +195,14 @@ class ArtifactResolver(object):
chunk_source.add_dependency(other_stratum)
# Add dependencies between chunks mentioned in this stratum
- for name in build_depends: # pragma: no cover
- if name not in name_to_processed_artifacts:
- raise DependencyOrderError(
- source, info['name'], name)
- other_artifacts = name_to_processed_artifacts[name]
- for other_artifact in other_artifacts:
- chunk_source.add_dependency(other_artifact)
+ if build_depends is not None:
+ for name in build_depends: # pragma: no cover
+ if name not in name_to_processed_artifacts:
+ raise DependencyOrderError(
+ source, info['name'], name)
+ other_artifacts = name_to_processed_artifacts[name]
+ for other_artifact in other_artifacts:
+ chunk_source.add_dependency(other_artifact)
# Add build dependencies between our stratum's artifacts
# and the chunk artifacts produced by this stratum.
diff --git a/morphlib/morphloader.py b/morphlib/morphloader.py
index e0f0952..7d51dc1 100644
--- a/morphlib/morphloader.py
+++ b/morphlib/morphloader.py
@@ -111,14 +111,6 @@ class UnknownArchitectureError(MorphologyValidationError):
% (arch, morph_filename))
-class NoBuildDependenciesError(MorphologyValidationError):
-
- def __init__(self, stratum_name, chunk_name, morph_filename):
- self.msg = (
- 'Stratum %s has no build dependencies for chunk %s in %s' %
- (stratum_name, chunk_name, morph_filename))
-
-
class NoStratumBuildDependenciesError(MorphologyValidationError):
def __init__(self, stratum_name, morph_filename):
@@ -556,7 +548,7 @@ class MorphologyLoader(object):
# Validate build-dependencies if specified
self._validate_stratum_specs_fields(morph, 'build-depends')
- # Require build-dependencies for each chunk.
+ # Check build-dependencies for each chunk.
for spec in morph['chunks']:
chunk_name = spec.get('alias', spec['name'])
if 'build-depends' in spec:
@@ -564,9 +556,6 @@ class MorphologyLoader(object):
raise InvalidTypeError(
'%s.build-depends' % chunk_name, list,
type(spec['build-depends']), morph['name'])
- else:
- raise NoBuildDependenciesError(
- morph['name'], chunk_name, morph.filename)
@classmethod
def _validate_chunk(cls, morphology):