From: stevenknight Date: Fri, 10 Jun 2005 11:29:54 +0000 (+0000) Subject: Fix DirScanner's handling of file names beginning with '#'. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f1bfb7a37cb73fd9f2a512969264ee559f368081;p=scons.git Fix DirScanner's handling of file names beginning with '#'. git-svn-id: http://scons.tigris.org/svn/scons/trunk@1310 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/engine/SCons/Scanner/Dir.py b/src/engine/SCons/Scanner/Dir.py index ae207495..e89f12b2 100644 --- a/src/engine/SCons/Scanner/Dir.py +++ b/src/engine/SCons/Scanner/Dir.py @@ -61,4 +61,6 @@ def scan(node, env, path=()): dont_scan = lambda k: not skip_entry.has_key(k) flist = filter(dont_scan, flist) flist.sort() - return map(node.Entry, flist) + # Add ./ to the beginning of the file name so that if it begins with a + # '#' we don't look it up relative to the top-level directory. + return map(lambda f, node=node: node.Entry('./'+f), flist) diff --git a/test/DirSource.py b/test/DirSource.py index 6d225c60..3b8566c5 100644 --- a/test/DirSource.py +++ b/test/DirSource.py @@ -75,13 +75,21 @@ env_csig.Command('cmd-csig.out', 'cmd-csig', writeTarget, """) test.write([ 'bsig', 'foo.txt' ], 'foo.txt 1\n') +test.write([ 'bsig', '#hash.txt' ], 'hash.txt 1\n') test.write([ 'bsig', 'subdir', 'bar.txt'], 'bar.txt 1\n') +test.write([ 'bsig', 'subdir', '#hash.txt'], 'hash.txt 1\n') test.write([ 'csig', 'foo.txt' ], 'foo.txt 1\n') +test.write([ 'csig', '#hash.txt' ], 'hash.txt 1\n') test.write([ 'csig', 'subdir', 'bar.txt' ], 'bar.txt 1\n') +test.write([ 'csig', 'subdir', '#hash.txt' ], 'hash.txt 1\n') test.write([ 'cmd-bsig', 'foo.txt' ], 'foo.txt 1\n') +test.write([ 'cmd-bsig', '#hash.txt' ], 'hash.txt 1\n') test.write([ 'cmd-bsig', 'subdir', 'bar.txt' ], 'bar.txt 1\n') +test.write([ 'cmd-bsig', 'subdir', '#hash.txt' ], 'hash.txt 1\n') test.write([ 'cmd-csig', 'foo.txt' ], 'foo.txt 1\n') +test.write([ 'cmd-csig', '#hash.txt' ], '#hash.txt 1\n') test.write([ 'cmd-csig', 'subdir', 'bar.txt' ], 'bar.txt 1\n') +test.write([ 'cmd-csig', 'subdir', '#hash.txt' ], 'hash.txt 1\n') test.write('junk.txt', 'junk.txt\n') test.run(arguments=".", stderr=None)