summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-07-03 01:18:16 +0100
committerCarl Hetherington <cth@carlh.net>2017-07-03 01:18:16 +0100
commit1535cc3cc368d9ecfe97243c4874ae8e8b845045 (patch)
tree7c5c2854c53577059de062585df5e65392683624
parent670cf62029b9e32c4bc0432ec05647051e849775 (diff)
Depedency fix-up attempt.
-rwxr-xr-xcdist23
1 files changed, 7 insertions, 16 deletions
diff --git a/cdist b/cdist
index 45a1573..0e32514 100755
--- a/cdist
+++ b/cdist
@@ -701,34 +701,25 @@ class Tree(object):
with TreeDirectory(self):
return self.cscript[function](self.target, *args)
- def build_dependencies(self, dry_run, options=None):
+ def build_dependencies(self, dry_run):
if 'dependencies' in self.cscript:
- if len(inspect.getargspec(self.cscript['dependencies']).args) == 2:
- deps = self.call('dependencies', options)
- else:
- deps = self.call('dependencies')
-
- to = options
- if to is None:
- to = dict()
-
- for d in deps:
+ for d in self.call('dependencies'):
log('Building dependency %s %s of %s' % (d[0], d[1], self.name))
dep = globals.trees.get(d[0], d[1], self.target)
+ options = dict()
# Make the options to pass in from the option_defaults of the thing
# we are building and any options specified by the parent.
-
if 'option_defaults' in dep.cscript:
for k, v in dep.cscript['option_defaults']().items():
- to[k] = v
+ options[k] = v
if len(d) > 2:
for k, v in d[2].items():
- to[k] = v
+ options[k] = v
- dep.build_dependencies(dry_run, to)
- dep.build(dry_run, to)
+ dep.build_dependencies(dry_run, options)
+ dep.build(dry_run, options)
def build(self, dry_run, options=None):
if self.built: