summaryrefslogtreecommitdiffstats
path: root/SConstruct
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-03-16 04:38:43 (GMT)
committerSteven Knight <knight@baldmt.com>2002-03-16 04:38:43 (GMT)
commit0bfa6712f6b0ba40f7df806ec35a40fa056f026f (patch)
tree821e70780eb384562d222a2e8cbfe8f4e78a430d /SConstruct
parentd274d685b3fae62354a7c3deb0622e2edd81b0c7 (diff)
downloadSCons-0bfa6712f6b0ba40f7df806ec35a40fa056f026f.zip
SCons-0bfa6712f6b0ba40f7df806ec35a40fa056f026f.tar.gz
SCons-0bfa6712f6b0ba40f7df806ec35a40fa056f026f.tar.bz2
Make FunctionAction arguments be Nodes, not strings. (Charles Crain)
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct14
1 files changed, 8 insertions, 6 deletions
diff --git a/SConstruct b/SConstruct
index 3503874..5303c70 100644
--- a/SConstruct
+++ b/SConstruct
@@ -201,26 +201,28 @@ def SCons_revision(target, source, env):
This is used to copy files into a tree that gets packaged up
into the source file package.
"""
+ t = str(target[0])
+ s = str(source[0])
# Note: We don't use $VERSION from the environment so that
# this routine will change when the version number changes
# and things will get rebuilt properly.
global version
- print "SCons_revision() < %s > %s" % (source[0], target)
- inf = open(source[0], 'rb')
- outf = open(target, 'wb')
+ print "SCons_revision() < %s > %s" % (s, t)
+ inf = open(s, 'rb')
+ outf = open(t, 'wb')
for line in inf.readlines():
# Note: We construct the __*__ substitution strings here
# so that they don't get replaced when this file gets
# copied into the tree for packaging.
line = string.replace(line, '_' + '_DATE__', env['DATE'])
line = string.replace(line, '_' + '_DEVELOPER__', env['DEVELOPER'])
- line = string.replace(line, '_' + '_FILE__', source[0])
+ line = string.replace(line, '_' + '_FILE__', s)
line = string.replace(line, '_' + '_REVISION__', env['REVISION'])
line = string.replace(line, '_' + '_VERSION__', version)
outf.write(line)
inf.close()
outf.close()
- os.chmod(target, os.stat(source[0])[0])
+ os.chmod(t, os.stat(s)[0])
revbuilder = Builder(name = 'SCons_revision', action = SCons_revision)
@@ -488,7 +490,7 @@ for p in [ scons ]:
def copy(target, source, **kw):
global src_files
src_files.sort()
- f = open(target, 'wb')
+ f = open(str(target[0]), 'wb')
for file in src_files:
f.write(file + "\n")
f.close()