Fix using a directory as Default().
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 11 Jan 2002 15:03:46 +0000 (15:03 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 11 Jan 2002 15:03:46 +0000 (15:03 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@204 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Script/SConscript.py
test/Default.py

index fc78e1db62b001979f526cc6764141cd64f83eb4..e36ceb609039e93e9abf86cbc43c5bbacef383ae 100644 (file)
@@ -8,6 +8,14 @@
 
 
 
+RELEASE 0.04 - 
+
+  From Steven Knight:
+
+  - Fix using a directory as a Default().
+
+
+
 RELEASE 0.03 - Fri, 11 Jan 2002 01:09:30 -0600
 
   From Charles Crain:
index cb93d6419b6798e0c43ff685505b7e48f918952b..43868b530ab549e658364859301bc2de31b477b0 100644 (file)
@@ -116,7 +116,7 @@ def Default(*targets):
             default_targets.append(t)
         else:
             for s in string.split(t):
-                default_targets.append(SCons.Node.FS.default_fs.File(s))
+                default_targets.append(SCons.Node.FS.default_fs.Entry(s))
 
 def Help(text):
     if print_help:
index 5685c3d1cc249f77fd0aaf286c6052a5c6c6140e..1d868292eb5228cdf58b359fc92bc6cce7d0abbc 100644 (file)
@@ -99,30 +99,57 @@ test.fail_test(test.read(test.workpath('four', 'bar.out')) != "four/bar.in\n")
 
 
 
-test.subdir('subdir')
+test.subdir('sub1')
 
 test.write('SConstruct', """
 B = Builder(name = 'B', action = r'%s build.py $TARGET $SOURCES')
 env = Environment(BUILDERS = [B])
 env.B(target = 'xxx.out', source = 'xxx.in')
-SConscript('subdir/SConscript')
+SConscript('sub1/SConscript')
 """ % python)
 
 test.write('xxx.in', "xxx.in\n")
 
-test.write(['subdir', 'SConscript'], """
+test.write(['sub1', 'SConscript'], """
 B = Builder(name = 'B', action = r'%s build.py $TARGET $SOURCES')
 env = Environment(BUILDERS = [B])
 env.B(target = 'xxx.out', source = 'xxx.in')
 Default('xxx.out')
 """ % python)
 
-test.write(['subdir', 'xxx.in'], "subdir/xxx.in\n")
+test.write(['sub1', 'xxx.in'], "sub1/xxx.in\n")
 
 test.run()     # no arguments, use the Default
 
 test.fail_test(os.path.exists(test.workpath('xxx.out')))
-test.fail_test(test.read(test.workpath('subdir', 'xxx.out')) != "subdir/xxx.in\n")
+test.fail_test(test.read(test.workpath('sub1', 'xxx.out')) != "sub1/xxx.in\n")
+
+
+
+test.subdir('sub2')
+
+test.write('SConstruct', """
+Default('sub2')
+B = Builder(name = 'B', action = r'%s build.py $TARGET $SOURCES')
+env = Environment(BUILDERS = [B])
+env.B(target = 'xxx.out', source = 'xxx.in')
+SConscript('sub2/SConscript')
+""" % python)
+
+test.write('xxx.in', "xxx.in\n")
+
+test.write(['sub2', 'SConscript'], """
+B = Builder(name = 'B', action = r'%s build.py $TARGET $SOURCES')
+env = Environment(BUILDERS = [B])
+env.B(target = 'xxx.out', source = 'xxx.in')
+""" % python)
+
+test.write(['sub2', 'xxx.in'], "sub2/xxx.in\n")
+
+test.run()     # no arguments, use the Default
+
+test.fail_test(os.path.exists(test.workpath('xxx.out')))
+test.fail_test(test.read(test.workpath('sub2', 'xxx.out')) != "sub2/xxx.in\n")