summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-05-29 14:10:24 (GMT)
committerSteven Knight <knight@baldmt.com>2005-05-29 14:10:24 (GMT)
commitf5d37d48553e04629fb7f6feac6e3b6c2243ee65 (patch)
tree6174ed7ca2298e018a5b5ee4f5ba155a9123399d
parentcbedf0f4edb9c97758d1a2173864aa429159cb78 (diff)
downloadSCons-f5d37d48553e04629fb7f6feac6e3b6c2243ee65.zip
SCons-f5d37d48553e04629fb7f6feac6e3b6c2243ee65.tar.gz
SCons-f5d37d48553e04629fb7f6feac6e3b6c2243ee65.tar.bz2
Fix lookups of same-named files.
-rw-r--r--src/CHANGES.txt5
-rw-r--r--src/engine/SCons/Node/FS.py4
-rw-r--r--src/engine/SCons/Node/FSTests.py13
3 files changed, 20 insertions, 2 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index f8f09fd..f1350af 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -397,6 +397,11 @@ RELEASE 0.97 - XXX
- Add $RPATH (-R) support to the Sun linker Tool (sunlink).
+ From Chris Prince:
+
+ - Look in the right directory, not always the local directory, for a
+ same-named file or directory conflict on disk.
+
From Kevin Quick:
- Fix the Builder name returned from ListBuilders and other instances
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 9203e18..527d1e3 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -840,7 +840,7 @@ class FS(LocalFS):
# look at the actual filesystem and make sure there isn't
# a file already there
- path = directory.entry_path(orig)
+ path = directory.entry_abspath(orig)
if self.isfile(path):
raise TypeError, \
"File %s found where directory expected." % path
@@ -866,7 +866,7 @@ class FS(LocalFS):
# make sure we don't create File nodes when there is actually
# a directory at that path on the disk, and vice versa
- path = directory.entry_path(last_orig)
+ path = directory.entry_abspath(last_orig)
if fsclass == File:
if self.isdir(path):
raise TypeError, \
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index 1b31009..6185de8 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -1262,6 +1262,19 @@ class FSTestCase(_tempdirTestCase):
t = z.target_from_source('pre-', '-suf', lambda x: x[:-1])
assert str(t) == 'pre-z-suf', str(t)
+ def test_same_name(self):
+ """Test that a local same-named file isn't found for # Dir lookup"""
+ test = self.test
+ fs = self.fs
+
+ test.subdir('subdir')
+ test.write(['subdir', 'build'], "subdir/build\n")
+
+ subdir = fs.Dir('subdir')
+ fs.chdir(subdir, change_os_dir=1)
+ path, dir = fs._transformPath('#build/file', subdir)
+ self.fs._doLookup(SCons.Node.FS.File, path, dir)
+
def test_above_root(self):
"""Testing looking up a path above the root directory"""
test = self.test