Support older cscripts.
authorCarl Hetherington <cth@carlh.net>
Thu, 17 Apr 2014 20:06:37 +0000 (21:06 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 17 Apr 2014 20:06:37 +0000 (21:06 +0100)
cdist

diff --git a/cdist b/cdist
index c679e3a40ee4c3e1ae72c96b8fd4d1bd6f11f1e1..a5e99636f3a6f9af3344b52b7f2b69c887cb3af3 100755 (executable)
--- a/cdist
+++ b/cdist
@@ -26,6 +26,7 @@ import datetime
 import subprocess
 import re
 import copy
+import inspect
 
 class Error(Exception):
     def __init__(self, value):
@@ -217,7 +218,10 @@ class Target(object):
     def build(self, project, options=None):
         variables = copy.copy(self.variables)
         print 'Target %s builds %s with %s' % (self.platform, project.name, self.variables)
-        project.cscript['build'](self, options)
+        if len(inspect.getargspec(project.cscript['build']).args) == 2:
+            project.cscript['build'](self, options)
+        else:
+            project.cscript['build'](self)
         self.variables = variables
 
     def package(self, project):