diff options
author | Steven Knight <knight@baldmt.com> | 2001-10-12 02:17:49 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2001-10-12 02:17:49 (GMT) |
commit | 0b9500662af3d026632d59da69020947fe844f30 (patch) | |
tree | 4c35e645826d0d8bcfb92252aabb4278af48f671 /src/engine/SCons/Builder.py | |
parent | ad49428de7c094e72c622f7710bfdba51ec05491 (diff) | |
download | SCons-0b9500662af3d026632d59da69020947fe844f30.zip SCons-0b9500662af3d026632d59da69020947fe844f30.tar.gz SCons-0b9500662af3d026632d59da69020947fe844f30.tar.bz2 |
Refactor construction variable expansion.
Diffstat (limited to 'src/engine/SCons/Builder.py')
-rw-r--r-- | src/engine/SCons/Builder.py | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py index 9e84a7d..ac24e7f 100644 --- a/src/engine/SCons/Builder.py +++ b/src/engine/SCons/Builder.py @@ -33,7 +33,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os import SCons.Node.FS -from SCons.Util import PathList, scons_str2nodes, scons_varrepl +from SCons.Util import PathList, scons_str2nodes, scons_subst import string import types @@ -210,21 +210,25 @@ class CommandAction(ActionBase): self.command = string def execute(self, **kw): - try: - t = kw['target'] - if type(t) is types.StringType: - t = [t] - tgt = PathList(map(os.path.normpath, t)) - except: - tgt = PathList() - try: - s = kw['source'] - if type(s) is types.StringType: - s = [s] - src = PathList(map(os.path.normpath, s)) - except: - src = PathList() - cmd = scons_varrepl(self.command, tgt, src) + loc = {} + if kw.has_key('target'): + t = kw['target'] + if type(t) is type(""): + t = [t] + loc['targets'] = PathList(map(os.path.normpath, t)) + loc['target'] = loc['targets'][0] + if kw.has_key('source'): + s = kw['source'] + if type(s) is type(""): + s = [s] + loc['sources'] = PathList(map(os.path.normpath, s)) + + try: + glob = self.env.Dictionary() + except: + glob = {} + + cmd = scons_subst(self.command, loc, glob) if print_actions: self.show(cmd) ret = 0 |