summaryrefslogtreecommitdiff
path: root/src/engine/SCons/Script
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2014-07-26 16:31:27 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2014-07-26 16:31:27 +0200
commit78989ebb445af2c6462ae2bf05ffd588d76610e4 (patch)
tree931f0ae1302ff7d45e41a1aa4b6dbc96be174744 /src/engine/SCons/Script
parent9d8eae9f5bf53a4a80e29d7a3a1d2c7d7197688a (diff)
Imported Upstream version 2.3.2upstream/2.3.2
Diffstat (limited to 'src/engine/SCons/Script')
-rw-r--r--src/engine/SCons/Script/Interactive.py4
-rw-r--r--src/engine/SCons/Script/Main.py70
-rw-r--r--src/engine/SCons/Script/Main.xml4
-rw-r--r--src/engine/SCons/Script/MainTests.py10
-rw-r--r--src/engine/SCons/Script/SConsOptions.py4
-rw-r--r--src/engine/SCons/Script/SConscript.py4
-rw-r--r--src/engine/SCons/Script/SConscript.xml6
-rw-r--r--src/engine/SCons/Script/SConscriptTests.py4
-rw-r--r--src/engine/SCons/Script/__init__.py4
9 files changed, 60 insertions, 50 deletions
diff --git a/src/engine/SCons/Script/Interactive.py b/src/engine/SCons/Script/Interactive.py
index 1bc4fc8..b800882 100644
--- a/src/engine/SCons/Script/Interactive.py
+++ b/src/engine/SCons/Script/Interactive.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
+# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,7 +20,7 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "src/engine/SCons/Script/Interactive.py 2014/03/02 14:18:15 garyo"
+__revision__ = "src/engine/SCons/Script/Interactive.py 2014/07/05 09:42:21 garyo"
__doc__ = """
SCons interactive mode
diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py
index 164c61d..b38f13f 100644
--- a/src/engine/SCons/Script/Main.py
+++ b/src/engine/SCons/Script/Main.py
@@ -13,7 +13,7 @@ it goes here.
unsupported_python_version = (2, 3, 0)
deprecated_python_version = (2, 7, 0)
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
+# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -34,7 +34,7 @@ deprecated_python_version = (2, 7, 0)
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "src/engine/SCons/Script/Main.py 2014/03/02 14:18:15 garyo"
+__revision__ = "src/engine/SCons/Script/Main.py 2014/07/05 09:42:21 garyo"
import SCons.compat
@@ -312,7 +312,7 @@ class BuildTask(SCons.Taskmaster.OutOfDateTask):
class CleanTask(SCons.Taskmaster.AlwaysTask):
"""An SCons clean task."""
- def fs_delete(self, path, pathstr, remove=1):
+ def fs_delete(self, path, pathstr, remove=True):
try:
if os.path.lexists(path):
if os.path.isfile(path) or os.path.islink(path):
@@ -339,37 +339,41 @@ class CleanTask(SCons.Taskmaster.AlwaysTask):
except (IOError, OSError), e:
print "scons: Could not remove '%s':" % pathstr, e.strerror
- def show(self):
+ def _get_files_to_clean(self):
+ result = []
target = self.targets[0]
- if (target.has_builder() or target.side_effect) and not target.noclean:
- for t in self.targets:
- if not t.isdir():
- display("Removed " + str(t))
- if target in SCons.Environment.CleanTargets:
- files = SCons.Environment.CleanTargets[target]
- for f in files:
- self.fs_delete(f.abspath, str(f), 0)
+ if target.has_builder() or target.side_effect:
+ result = [t for t in self.targets if not t.noclean]
+ return result
- def remove(self):
+ def _clean_targets(self, remove=True):
target = self.targets[0]
- if (target.has_builder() or target.side_effect) and not target.noclean:
- for t in self.targets:
- try:
- removed = t.remove()
- except OSError, e:
- # An OSError may indicate something like a permissions
- # issue, an IOError would indicate something like
- # the file not existing. In either case, print a
- # message and keep going to try to remove as many
- # targets aa possible.
- print "scons: Could not remove '%s':" % str(t), e.strerror
- else:
- if removed:
- display("Removed " + str(t))
if target in SCons.Environment.CleanTargets:
files = SCons.Environment.CleanTargets[target]
for f in files:
- self.fs_delete(f.abspath, str(f))
+ self.fs_delete(f.abspath, str(f), remove)
+
+ def show(self):
+ for t in self._get_files_to_clean():
+ if not t.isdir():
+ display("Removed " + str(t))
+ self._clean_targets(remove=False)
+
+ def remove(self):
+ for t in self._get_files_to_clean():
+ try:
+ removed = t.remove()
+ except OSError, e:
+ # An OSError may indicate something like a permissions
+ # issue, an IOError would indicate something like
+ # the file not existing. In either case, print a
+ # message and keep going to try to remove as many
+ # targets aa possible.
+ print "scons: Could not remove '%s':" % str(t), e.strerror
+ else:
+ if removed:
+ display("Removed " + str(t))
+ self._clean_targets(remove=True)
execute = remove
@@ -1021,13 +1025,17 @@ def _main(parser):
# in case they disabled the warning in the SConscript files.
if python_version_deprecated():
msg = "Support for pre-%s Python version (%s) is deprecated.\n" + \
- " If this will cause hardship, contact dev@scons.tigris.org."
+ " If this will cause hardship, contact scons-dev@scons.org"
deprecated_version_string = ".".join(map(str, deprecated_python_version))
SCons.Warnings.warn(SCons.Warnings.PythonVersionWarning,
msg % (deprecated_version_string, python_version_string()))
if not options.help:
- SCons.SConf.CreateConfigHBuilder(SCons.Defaults.DefaultEnvironment())
+ # [ ] Clarify why we need to create Builder here at all, and
+ # why it is created in DefaultEnvironment
+ # https://bitbucket.org/scons/scons/commits/d27a548aeee8ad5e67ea75c2d19a7d305f784e30
+ if SCons.SConf.NeedConfigHBuilder():
+ SCons.SConf.CreateConfigHBuilder(SCons.Defaults.DefaultEnvironment())
# Now re-parse the command-line options (any to the left of a '--'
# argument, that is) with any user-defined command-line options that
@@ -1343,7 +1351,7 @@ def main():
pass
parts.append(version_string("engine", SCons))
parts.append(path_string("engine", SCons))
- parts.append("Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation")
+ parts.append("Copyright (c) 2001 - 2014 The SCons Foundation")
version = ''.join(parts)
import SConsOptions
diff --git a/src/engine/SCons/Script/Main.xml b/src/engine/SCons/Script/Main.xml
index 162dfac..e494328 100644
--- a/src/engine/SCons/Script/Main.xml
+++ b/src/engine/SCons/Script/Main.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
+Copyright (c) 2001 - 2014 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
@@ -21,7 +21,7 @@ See its __doc__ string for a discussion of the format.
<sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0/scons.xsd scons.xsd">
+ xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
<scons_function name="AddOption">
diff --git a/src/engine/SCons/Script/MainTests.py b/src/engine/SCons/Script/MainTests.py
index 25977fa..879ee4f 100644
--- a/src/engine/SCons/Script/MainTests.py
+++ b/src/engine/SCons/Script/MainTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
+# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,9 +21,12 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Script/MainTests.py 2014/03/02 14:18:15 garyo"
+__revision__ = "src/engine/SCons/Script/MainTests.py 2014/07/05 09:42:21 garyo"
import unittest
+
+import TestUnit
+
import SCons.Errors
import SCons.Script.Main
@@ -43,8 +46,7 @@ if __name__ == "__main__":
for tclass in tclasses:
names = unittest.getTestCaseNames(tclass, 'test_')
suite.addTests(list(map(tclass, names)))
- if not unittest.TextTestRunner().run(suite).wasSuccessful():
- sys.exit(1)
+ TestUnit.run(suite)
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py
index 09f71b7..10c3a98 100644
--- a/src/engine/SCons/Script/SConsOptions.py
+++ b/src/engine/SCons/Script/SConsOptions.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
+# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Script/SConsOptions.py 2014/03/02 14:18:15 garyo"
+__revision__ = "src/engine/SCons/Script/SConsOptions.py 2014/07/05 09:42:21 garyo"
import optparse
import re
diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py
index 52aade2..9f837aa 100644
--- a/src/engine/SCons/Script/SConscript.py
+++ b/src/engine/SCons/Script/SConscript.py
@@ -6,7 +6,7 @@ files.
"""
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
+# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -28,7 +28,7 @@ files.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
from __future__ import division
-__revision__ = "src/engine/SCons/Script/SConscript.py 2014/03/02 14:18:15 garyo"
+__revision__ = "src/engine/SCons/Script/SConscript.py 2014/07/05 09:42:21 garyo"
import SCons
import SCons.Action
diff --git a/src/engine/SCons/Script/SConscript.xml b/src/engine/SCons/Script/SConscript.xml
index 9fab301..1c72b4d 100644
--- a/src/engine/SCons/Script/SConscript.xml
+++ b/src/engine/SCons/Script/SConscript.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
+Copyright (c) 2001 - 2014 The SCons Foundation
This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
@@ -21,7 +21,7 @@ See its __doc__ string for a discussion of the format.
<sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0/scons.xsd scons.xsd">
+ xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
<scons_function name="Default">
@@ -593,4 +593,4 @@ SConscript('src/SConscript', variant_dir='build/ppc', duplicate=0)
</summary>
</scons_function>
-</sconsdoc> \ No newline at end of file
+</sconsdoc>
diff --git a/src/engine/SCons/Script/SConscriptTests.py b/src/engine/SCons/Script/SConscriptTests.py
index 6a2dcda..807d263 100644
--- a/src/engine/SCons/Script/SConscriptTests.py
+++ b/src/engine/SCons/Script/SConscriptTests.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
+# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -21,7 +21,7 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Script/SConscriptTests.py 2014/03/02 14:18:15 garyo"
+__revision__ = "src/engine/SCons/Script/SConscriptTests.py 2014/07/05 09:42:21 garyo"
import SCons.Script.SConscript
diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py
index c27dacd..d327753 100644
--- a/src/engine/SCons/Script/__init__.py
+++ b/src/engine/SCons/Script/__init__.py
@@ -12,7 +12,7 @@ it goes here.
"""
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
+# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -34,7 +34,7 @@ it goes here.
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "src/engine/SCons/Script/__init__.py 2014/03/02 14:18:15 garyo"
+__revision__ = "src/engine/SCons/Script/__init__.py 2014/07/05 09:42:21 garyo"
import time
start_time = time.time()