From 7764805dd1d4df1cf1bdfe2ad1f2e130d91f515a Mon Sep 17 00:00:00 2001 From: Luca Falavigna Date: Sat, 23 Jan 2010 15:06:55 +0100 Subject: Imported Upstream version 1.2.0.d20100117 --- engine/SCons/Action.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'engine/SCons/Action.py') diff --git a/engine/SCons/Action.py b/engine/SCons/Action.py index ec12a66..367bf46 100644 --- a/engine/SCons/Action.py +++ b/engine/SCons/Action.py @@ -76,7 +76,7 @@ way for wrapping up the functions. """ -# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation +# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -97,7 +97,7 @@ way for wrapping up the functions. # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "src/engine/SCons/Action.py 4577 2009/12/27 19:43:56 scons" +__revision__ = "src/engine/SCons/Action.py 4629 2010/01/17 22:23:21 scons" import cPickle import dis @@ -430,7 +430,7 @@ class ActionBase: # This should never happen, as the Action() factory should wrap # the varlist, but just in case an action is created directly, # we duplicate this check here. - vl = self.varlist + vl = self.get_varlist(target, source, env) if is_String(vl): vl = (vl,) for v in vl: result.append(env.subst('${'+v+'}')) @@ -454,6 +454,9 @@ class ActionBase: self.presub_env = None # don't need this any more return lines + def get_varlist(self, target, source, env, executor=None): + return self.varlist + def get_targets(self, env, executor): """ Returns the type of targets ($TARGETS, $CHANGED_TARGETS) used @@ -897,6 +900,9 @@ class CommandGeneratorAction(ActionBase): def get_implicit_deps(self, target, source, env, executor=None): return self._generate(target, source, env, 1, executor).get_implicit_deps(target, source, env) + def get_varlist(self, target, source, env, executor=None): + return self._generate(target, source, env, 1, executor).get_varlist(target, source, env, executor) + def get_targets(self, env, executor): return self._generate(None, None, env, 1, executor).get_targets(env, executor) @@ -958,6 +964,9 @@ class LazyAction(CommandGeneratorAction, CommandAction): c = self.get_parent_class(env) return c.get_presig(self, target, source, env) + def get_varlist(self, target, source, env, executor=None): + c = self.get_parent_class(env) + return c.get_varlist(self, target, source, env, executor) class FunctionAction(_ActionAction): @@ -1139,6 +1148,13 @@ class ListAction(ActionBase): result.extend(act.get_implicit_deps(target, source, env)) return result + def get_varlist(self, target, source, env, executor=None): + result = SCons.Util.OrderedDict() + for act in self.list: + for var in act.get_varlist(target, source, env, executor): + result[var] = True + return result.keys() + class ActionCaller: """A class for delaying calling an Action function with specific (positional and keyword) arguments until the Action is actually -- cgit v1.2.3