From 711e5cdfe154688814d7f493cc2c832c79fd1014 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Mon, 5 Aug 2002 03:41:27 +0000 Subject: Make -U be case insensitive on Win32 (Bug 589292) (Anthony Roach) --- src/CHANGES.txt | 14 ++++++++++++++ src/engine/SCons/Script/__init__.py | 6 ++++-- test/option--U.py | 14 ++++++++++---- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index d2fe1a0..30f8eb9 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -8,6 +8,20 @@ +RELEASE 0.09 - + + From Anthony Roach: + + - Fixed use of command lines with spaces in their arguments, + and use of Nodes with spaces in their string representation. + + - Make access and modification times of files in a BuildDir match + the source file, even when hard linking isn't available. + + - Make -U be case insensitive on Win32 systems. + + + RELEASE 0.08 - Mon, 15 Jul 2002 12:08:51 -0500 From Charles Crain: diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index 17a1256..a00c734 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -969,8 +969,10 @@ def _main(): elif climb_up == 3 and not targets: # -U with default targets default_targets = SCons.Script.SConscript.default_targets - default_targets = filter(lambda x: x.cwd.srcpath == str(target_top), - default_targets) + def check_dir(x): + cwd = SCons.Node.FS.default_fs.Dir(x.cwd.srcpath) + return cwd == target_top + default_targets = filter(check_dir, default_targets) SCons.Script.SConscript.default_targets = default_targets target_top = None diff --git a/test/option--U.py b/test/option--U.py index 013b81f..003bce1 100644 --- a/test/option--U.py +++ b/test/option--U.py @@ -24,6 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +import os import os.path import sys @@ -43,10 +44,10 @@ file.write(contents) file.close() """) -test.write('SConstruct', """ +test.write('SConstruct', r""" import SCons.Defaults env = Environment() -env['BUILDERS']['B'] = Builder(action='%s build.py $TARGET $SOURCES', multi=1) +env['BUILDERS']['B'] = Builder(action=r'%s build.py $TARGET $SOURCES', multi=1) Default(env.B(target = 'sub1/foo.out', source = 'sub1/foo.in')) Export('env') SConscript('sub2/SConscript') @@ -92,8 +93,13 @@ test.fail_test(os.path.exists(test.workpath('sub3', 'baz.out'))) test.fail_test(os.path.exists(test.workpath('bar.out'))) test.fail_test(os.path.exists(test.workpath('sub2/xxx.out'))) -test.write('SConscript', """assert GetLaunchDir() == r'%s'"""%test.workpath('sub2')) -test.run(chdir = 'sub2', arguments = '-U') + +if sys.platform == 'win32': + test.write('SConscript', """assert GetLaunchDir() == r'%s'"""%test.workpath('SUB2')) + test.run(chdir = 'SUB2', arguments = '-U') +else: + test.write('SConscript', """assert GetLaunchDir() == r'%s'"""%test.workpath('sub2')) + test.run(chdir = 'sub2', arguments = '-U') test.fail_test(os.path.exists(test.workpath('sub1', 'foo.out'))) test.fail_test(not os.path.exists(test.workpath('sub2', 'bar.out'))) test.fail_test(not os.path.exists(test.workpath('sub2b', 'bar.out'))) -- cgit v0.12