summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-05-02 18:32:06 (GMT)
committerSteven Knight <knight@baldmt.com>2002-05-02 18:32:06 (GMT)
commitdeb10649b8ca07fe7fab0b7e1f32075f22140da4 (patch)
tree2d50c1d738110a476e4fe2d518eff6fafda47ea9
parent971823ece48d9eae019eeca0ec7c8712764bc839 (diff)
downloadSCons-deb10649b8ca07fe7fab0b7e1f32075f22140da4.zip
SCons-deb10649b8ca07fe7fab0b7e1f32075f22140da4.tar.gz
SCons-deb10649b8ca07fe7fab0b7e1f32075f22140da4.tar.bz2
Fix a bug that caused BuildDir(duplicate=1) along with passing a Node to SConscript() to act as if BuildDir() wasn't used.
-rw-r--r--src/CHANGES.txt2
-rw-r--r--src/engine/SCons/Script/SConscript.py5
-rw-r--r--test/BuildDir.py14
3 files changed, 20 insertions, 1 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index caaaf3e..3dc11da 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -150,6 +150,8 @@ RELEASE 0.07 - Thu, 25 Apr 2002 06:24:50 -0500
- Fix for using Aliases with the -u, -U and -D options.
+ - Fix so that Nodes can be passed to SConscript files.
+
From Moshe Zadka:
- Changes for official Debian packaging.
diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py
index 79e2a60..606be08 100644
--- a/src/engine/SCons/Script/SConscript.py
+++ b/src/engine/SCons/Script/SConscript.py
@@ -158,7 +158,10 @@ def SConscript(*ls, **kw):
if fn == "-":
exec sys.stdin in stack[-1].globals
else:
- f = SCons.Node.FS.default_fs.File(str(fn))
+ if isinstance(fn, SCons.Node.Node):
+ f = fn
+ else:
+ f = SCons.Node.FS.default_fs.File(str(fn))
if f.exists():
file = open(str(f), "r")
SCons.Node.FS.default_fs.chdir(f.dir)
diff --git a/test/BuildDir.py b/test/BuildDir.py
index 893731c..4b835a6 100644
--- a/test/BuildDir.py
+++ b/test/BuildDir.py
@@ -42,15 +42,20 @@ foo21 = test.workpath('build', 'var2', 'foo1' + _exe)
foo22 = test.workpath('build', 'var2', 'foo2' + _exe)
foo31 = test.workpath('build', 'var3', 'foo1' + _exe)
foo32 = test.workpath('build', 'var3', 'foo2' + _exe)
+foo41 = test.workpath('build', 'var4', 'foo1' + _exe)
+foo42 = test.workpath('build', 'var4', 'foo2' + _exe)
test.write('SConstruct', """
src = Dir('src')
var2 = Dir('build/var2')
var3 = Dir('build/var3')
+var4 = Dir('build/var4')
+
BuildDir('build/var1', src)
BuildDir(var2, src)
BuildDir(var3, src, duplicate=0)
+BuildDir(var4, src, duplicate=0)
env = Environment(CPPPATH='#src')
SConscript('build/var1/SConscript', "env")
@@ -58,6 +63,8 @@ SConscript('build/var2/SConscript', "env")
env = Environment(CPPPATH=src)
SConscript('build/var3/SConscript', "env")
+SConscript(File('SConscript', var4), "env")
+
""")
test.subdir('src')
@@ -120,9 +127,16 @@ test.run(program = foo21, stdout = "f1.c\n")
test.run(program = foo22, stdout = "f2.c\n")
test.run(program = foo31, stdout = "f1.c\n")
test.run(program = foo32, stdout = "f2.c\n")
+test.run(program = foo41, stdout = "f1.c\n")
+test.run(program = foo42, stdout = "f2.c\n")
# Make sure we didn't duplicate the source files in build/var3.
test.fail_test(os.path.exists(test.workpath('build', 'var3', 'f1.c')))
test.fail_test(os.path.exists(test.workpath('build', 'var3', 'f2.in')))
+# Make sure we didn't duplicate the source files in build/var3.
+test.fail_test(os.path.exists(test.workpath('build', 'var4', 'f1.c')))
+test.fail_test(os.path.exists(test.workpath('build', 'var4', 'f2.in')))
+
+
test.pass_test()