From fabff06e1ff1863ded70136f0797814a676a86d4 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Tue, 15 Jun 2010 21:04:47 +0000 Subject: Issue 2390: Support appending to $*FLAGS values (CLVar instances) in a copied construction environment without also affecting the value in the original construction environment. (Matt Hughes) --- QMTest/scons_tdb.py | 2 +- bin/install_python.py | 17 +++++++++++++---- bin/scons_dev_master.py | 2 ++ src/CHANGES.txt | 6 ++++++ src/engine/SCons/EnvironmentTests.py | 14 ++++++++++++++ src/engine/SCons/Util.py | 18 +++++++----------- 6 files changed, 43 insertions(+), 16 deletions(-) diff --git a/QMTest/scons_tdb.py b/QMTest/scons_tdb.py index 6be4696..cc2f127 100644 --- a/QMTest/scons_tdb.py +++ b/QMTest/scons_tdb.py @@ -134,7 +134,7 @@ def check_exit_status(result, prefix, desc, status): -class Null: +class Null(object): pass _null = Null() diff --git a/bin/install_python.py b/bin/install_python.py index 86807af..0cc805b 100644 --- a/bin/install_python.py +++ b/bin/install_python.py @@ -15,10 +15,19 @@ import sys from Command import CommandRunner, Usage all_versions = [ - '2.3.7', - '2.4.5', - #'2.5.2', - '2.6', + #'1.5.2', # no longer available at python.org + #'2.0.1', # no longer supported by SCons + #'2.1.3', # no longer supported by SCons + '2.2', + #'2.2.3', + '2.3', + #'2.3.7', + #'2.4', + '2.4.6', + '2.5.5', + '2.6.5', + '3.0.1', + '3.1.2', ] def main(argv=None): diff --git a/bin/scons_dev_master.py b/bin/scons_dev_master.py index 4fa810d..f7621c2 100644 --- a/bin/scons_dev_master.py +++ b/bin/scons_dev_master.py @@ -56,6 +56,8 @@ DOCUMENTATION_PACKAGES = [ 'sun-java6-doc', 'swig-doc', 'texlive-doc', + # Needed for aeguill.sty when generating API docs: + 'texlive-lang-french', ] TESTING_PACKAGES = [ diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 2dda4d1..f6a38e1 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -12,6 +12,12 @@ RELEASE 2.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE - Fix explicit dependencies (Depends()) on Nodes that don't have attached Builders. + From Matt Hughes: + + - Fix the ability to append to default $*FLAGS values (which are + implemented as CLVar instances) in a copied construction environment + without affecting the original construction environment's value. + RELEASE 2.0.0.beta.20100605 - Sat, 05 Jun 2010 21:02:48 -0700 diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index ec69607..7feb76d 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -1806,6 +1806,20 @@ def exists(env): env2.Append(FLAGS = 'flag3 flag4') x = env2.get('FLAGS') assert x == ['flag1', 'flag2', 'flag3', 'flag4'], x + x = env1.get('FLAGS') + assert x == ['flag1', 'flag2'], x + + # Ensure that appending directly to a copied CLVar + # doesn't modify the original. + env1 = self.TestEnvironment(FLAGS = CLVar('flag1 flag2')) + x = env1.get('FLAGS') + assert x == ['flag1', 'flag2'], x + env2 = env1.Clone() + env2['FLAGS'] += ['flag3', 'flag4'] + x = env2.get('FLAGS') + assert x == ['flag1', 'flag2', 'flag3', 'flag4'], x + x = env1.get('FLAGS') + assert x == ['flag1', 'flag2'], x # Test that the environment stores the toolpath and # re-uses it for copies. diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index cc6c95e..7a6cb51 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -459,22 +459,18 @@ def _semi_deepcopy_tuple(x): return tuple(map(semi_deepcopy, x)) d[tuple] = _semi_deepcopy_tuple -def _semi_deepcopy_inst(x): - if hasattr(x, '__semi_deepcopy__'): - return x.__semi_deepcopy__() - elif isinstance(x, UserDict): - return x.__class__(_semi_deepcopy_dict(x)) - elif isinstance(x, UserList): - return x.__class__(_semi_deepcopy_list(x)) - else: - return x -d[InstanceType] = _semi_deepcopy_inst - def semi_deepcopy(x): copier = _semi_deepcopy_dispatch.get(type(x)) if copier: return copier(x) else: + if hasattr(x, '__semi_deepcopy__'): + return x.__semi_deepcopy__() + elif isinstance(x, UserDict): + return x.__class__(_semi_deepcopy_dict(x)) + elif isinstance(x, UserList): + return x.__class__(_semi_deepcopy_list(x)) + return x -- cgit v0.12