From 651972979462ebc48aac362dd53119ef79291cf5 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Fri, 21 Jun 2002 18:19:45 +0000 Subject: Fix handling file names with multiple dots. (Charles Crain) --- src/CHANGES.txt | 2 ++ src/engine/SCons/Builder.py | 2 +- src/engine/SCons/BuilderTests.py | 12 ++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index ad9f56c..5f87eb9 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -38,6 +38,8 @@ RELEASE 0.08 - - Removed support for the prefix, suffix and src_suffix arguments to Builder() to be callable functions. + - Fix handling file names with multiple dots. + From Charles Crain and Steven Knight: - Add a "tools=" keyword argument to Environment instantiation, diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py index 4dd6163..0b54303 100644 --- a/src/engine/SCons/Builder.py +++ b/src/engine/SCons/Builder.py @@ -456,7 +456,7 @@ class MultiStepBuilder(BuilderBase): src_bld = sdict[ext] dictArgs = copy.copy(kw) - dictArgs['target'] = [path] + dictArgs['target'] = [ path + src_bld.get_suffix(env) ] dictArgs['source'] = snode dictArgs['env'] = env tgt = apply(src_bld, (), dictArgs) diff --git a/src/engine/SCons/BuilderTests.py b/src/engine/SCons/BuilderTests.py index 7ff06c2..c0ed108 100644 --- a/src/engine/SCons/BuilderTests.py +++ b/src/engine/SCons/BuilderTests.py @@ -578,9 +578,9 @@ class BuilderTestCase(unittest.TestCase): action='bar', src_builder = builder1, src_suffix = '.foo') - tgt = builder2(env, target='baz', source=['test.bar', 'test2.foo', 'test3.txt']) - assert str(tgt.sources[0]) == 'test.foo', str(tgt.sources[0]) - assert str(tgt.sources[0].sources[0]) == 'test.bar', \ + tgt = builder2(env, target='baz', source=['test.bleh.bar', 'test2.foo', 'test3.txt']) + assert str(tgt.sources[0]) == 'test.bleh.foo', str(tgt.sources[0]) + assert str(tgt.sources[0].sources[0]) == 'test.bleh.bar', \ str(tgt.sources[0].sources[0]) assert str(tgt.sources[1]) == 'test2.foo', str(tgt.sources[1]) assert str(tgt.sources[2]) == 'test3.txt', str(tgt.sources[2]) @@ -654,7 +654,7 @@ class BuilderTestCase(unittest.TestCase): assert isinstance(tgt.builder, SCons.Builder.MultiStepBuilder) flag = 0 - tgt = builder(env, target='t5', source='test5a.foo test5b.inb') + tgt = builder(env, target='t5', source=[ 'test5a.foo', 'test5b.inb' ]) try: tgt.build() except SCons.Errors.UserError: @@ -662,7 +662,7 @@ class BuilderTestCase(unittest.TestCase): assert flag, "UserError should be thrown when we build targets with files of different suffixes." flag = 0 - tgt = builder(env, target='t6', source='test6a.bar test6b.ina') + tgt = builder(env, target='t6', source=[ 'test6a.bar', 'test6b.ina' ]) try: tgt.build() except SCons.Errors.UserError: @@ -670,7 +670,7 @@ class BuilderTestCase(unittest.TestCase): assert flag, "UserError should be thrown when we build targets with files of different suffixes." flag = 0 - tgt = builder(env, target='t4', source='test4a.ina test4b.inb') + tgt = builder(env, target='t4', source=[ 'test4a.ina', 'test4b.inb' ]) try: tgt.build() except SCons.Errors.UserError: -- cgit v0.12