diff options
author | Steven Knight <knight@baldmt.com> | 2003-01-07 23:12:02 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-01-07 23:12:02 (GMT) |
commit | 61a74e9d5770e83b296356700c128bd3dd59601e (patch) | |
tree | ee0ef019043714839245ab5e41ff4aaee45311c2 /src/engine | |
parent | cbb5c537f33929ddf7795d627ccae0f42b5b361f (diff) | |
download | SCons-61a74e9d5770e83b296356700c128bd3dd59601e.zip SCons-61a74e9d5770e83b296356700c128bd3dd59601e.tar.gz SCons-61a74e9d5770e83b296356700c128bd3dd59601e.tar.bz2 |
Fix files with the same name as subdirs.
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/Builder.py | 7 | ||||
-rw-r--r-- | src/engine/SCons/BuilderTests.py | 39 |
2 files changed, 16 insertions, 30 deletions
diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py index 2c45855..9c91c01 100644 --- a/src/engine/SCons/Builder.py +++ b/src/engine/SCons/Builder.py @@ -285,9 +285,10 @@ class BuilderBase: source = adjustixes(source, None, src_suf) if target is None: - target = map(lambda x, s=suf: - os.path.splitext(os.path.split(str(x))[1])[0] + s, - source) + s = source[0] + if isinstance(s, SCons.Node.Node): + s = os.path.split(str(s))[1] + target = [ os.path.splitext(s)[0] + suf ] else: target = adjustixes(target, pre, suf) diff --git a/src/engine/SCons/BuilderTests.py b/src/engine/SCons/BuilderTests.py index 57069df..5c0f0d6 100644 --- a/src/engine/SCons/BuilderTests.py +++ b/src/engine/SCons/BuilderTests.py @@ -641,15 +641,10 @@ class BuilderTestCase(unittest.TestCase): assert str(tgt.sources[0]) == 'ccc.x.c', map(str, tgt.sources) tgt = b(env, ['d0.c', 'd1.c']) - assert len(tgt) == 2, map(str, tgt) - assert str(tgt[0]) == 'd0.o', map(str, tgt) - assert str(tgt[1]) == 'd1.o', map(str, tgt) - assert len(tgt[0].sources) == 2, map(str, tgt[0].sources) - assert str(tgt[0].sources[0]) == 'd0.c', map(str, tgt[0].sources) - assert str(tgt[0].sources[1]) == 'd1.c', map(str, tgt[0].sources) - assert len(tgt[1].sources) == 2, map(str, tgt[1].sources) - assert str(tgt[1].sources[0]) == 'd0.c', map(str, tgt[1].sources) - assert str(tgt[1].sources[1]) == 'd1.c', map(str, tgt[1].sources) + assert str(tgt) == 'd0.o', str(tgt) + assert len(tgt.sources) == 2, map(str, tgt.sources) + assert str(tgt.sources[0]) == 'd0.c', map(str, tgt.sources) + assert str(tgt.sources[1]) == 'd1.c', map(str, tgt.sources) tgt = b(env, source='eee') assert str(tgt) == 'eee.o', str(tgt) @@ -667,28 +662,18 @@ class BuilderTestCase(unittest.TestCase): assert str(tgt.sources[0]) == 'ggg.x.c', map(str, tgt.sources) tgt = b(env, source=['h0.c', 'h1.c']) - assert len(tgt) == 2, map(str, tgt) - assert str(tgt[0]) == 'h0.o', map(str, tgt) - assert str(tgt[1]) == 'h1.o', map(str, tgt) - assert len(tgt[0].sources) == 2, map(str, tgt[0].sources) - assert str(tgt[0].sources[0]) == 'h0.c', map(str, tgt[0].sources) - assert str(tgt[0].sources[1]) == 'h1.c', map(str, tgt[0].sources) - assert len(tgt[1].sources) == 2, map(str, tgt[1].sources) - assert str(tgt[1].sources[0]) == 'h0.c', map(str, tgt[1].sources) - assert str(tgt[1].sources[1]) == 'h1.c', map(str, tgt[1].sources) + assert str(tgt) == 'h0.o', str(tgt) + assert len(tgt.sources) == 2, map(str, tgt.sources) + assert str(tgt.sources[0]) == 'h0.c', map(str, tgt.sources) + assert str(tgt.sources[1]) == 'h1.c', map(str, tgt.sources) w = b(env, target='i0.w', source=['i0.x']) y = b(env, target='i1.y', source=['i1.z']) tgt = b(env, source=[w, y]) - assert len(tgt) == 2, map(str, tgt) - assert str(tgt[0]) == 'i0.o' - assert str(tgt[1]) == 'i1.o' - assert len(tgt[0].sources) == 2, map(str, tgt[0].sources) - assert str(tgt[0].sources[0]) == 'i0.w', map(str, tgt[0].sources) - assert str(tgt[0].sources[1]) == 'i1.y', map(str, tgt[0].sources) - assert len(tgt[1].sources) == 2, map(str, tgt[1].sources) - assert str(tgt[1].sources[0]) == 'i0.w', map(str, tgt[1].sources) - assert str(tgt[1].sources[1]) == 'i1.y', map(str, tgt[1].sources) + assert str(tgt) == 'i0.o', str(tgt) + assert len(tgt.sources) == 2, map(str, tgt.sources) + assert str(tgt.sources[0]) == 'i0.w', map(str, tgt.sources) + assert str(tgt.sources[1]) == 'i1.y', map(str, tgt.sources) if __name__ == "__main__": |