summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2010-06-15 21:04:47 +0000
committerSteven Knight <knight@baldmt.com>2010-06-15 21:04:47 +0000
commitdd8fe6f847d5ad5059f6b3752c904f956ec56c67 (patch)
treec13f47a573efee1038ead7d21149454a70b0dc52
parente93ccd80add56640acbc325439a2f6f5c5ff032e (diff)
downloadscons-dd8fe6f847d5ad5059f6b3752c904f956ec56c67.tar.gz
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)
-rw-r--r--QMTest/scons_tdb.py2
-rw-r--r--bin/install_python.py17
-rw-r--r--bin/scons_dev_master.py2
-rw-r--r--src/CHANGES.txt6
-rw-r--r--src/engine/SCons/EnvironmentTests.py14
-rw-r--r--src/engine/SCons/Util.py18
6 files changed, 43 insertions, 16 deletions
diff --git a/QMTest/scons_tdb.py b/QMTest/scons_tdb.py
index 6be4696b..cc2f1272 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 86807af6..0cc805bf 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 4fa810d4..f7621c26 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 2dda4d15..f6a38e1c 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 ec696072..7feb76db 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 cc6c95e0..7a6cb515 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