diff options
-rw-r--r-- | SCons/Script/Main.py | 7 | ||||
-rw-r--r-- | SCons/Tool/textfile.py | 4 | ||||
-rw-r--r-- | SCons/__init__.py | 56 | ||||
-rw-r--r-- | SConstruct | 2 | ||||
-rw-r--r-- | site_scons/update_build_info.py | 13 | ||||
-rw-r--r-- | test/option-v.py | 15 |
6 files changed, 27 insertions, 70 deletions
diff --git a/SCons/Script/Main.py b/SCons/Script/Main.py index d7b07a2..7aa3779 100644 --- a/SCons/Script/Main.py +++ b/SCons/Script/Main.py @@ -1371,14 +1371,13 @@ def main(): parts = ["SCons by Steven Knight et al.:\n"] try: import __main__ - parts.append(version_string("script", __main__)) + parts.append(version_string("SCons", __main__)) except (ImportError, AttributeError): # On Windows there is no scons.py, so there is no # __main__.__version__, hence there is no script version. pass - parts.append(version_string("engine", SCons)) - parts.append(path_string("engine", SCons)) - parts.append("__COPYRIGHT__") + parts.append(path_string("SCons", SCons)) + parts.append(SCons.__copyright__) version = ''.join(parts) from . import SConsOptions diff --git a/SCons/Tool/textfile.py b/SCons/Tool/textfile.py index b404304..bb8a0f9 100644 --- a/SCons/Tool/textfile.py +++ b/SCons/Tool/textfile.py @@ -124,8 +124,8 @@ def _action(target, source, env): # write the file try: target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE, newline='') - except (OSError, IOError): - raise SCons.Errors.UserError("Can't write target file %s" % target[0]) + except (OSError, IOError) as e: + raise SCons.Errors.UserError("Can't write target file %s [%s]" % (target[0],e)) # separate lines by 'linesep' only if linesep is not empty lsep = None diff --git a/SCons/__init__.py b/SCons/__init__.py index 532f07b..9e12a3f 100644 --- a/SCons/__init__.py +++ b/SCons/__init__.py @@ -1,49 +1,9 @@ -"""SCons - -The main package for the SCons software construction utility. - -""" - -# -# __COPYRIGHT__ -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - -__version__ = "__VERSION__" - -__build__ = "__BUILD__" - -__buildsys__ = "__BUILDSYS__" - -__date__ = "__DATE__" - -__developer__ = "__DEVELOPER__" -__copyright__ = "COPYRIGHT" +__VERSION__="3.9.9a996" +__copyright__="Copyright (c) 2001 - 2020 The SCons Foundation" +__DEVELOPER__="bdbaddog" +__DATE__="2020-06-30 20:17:38" +__BUILDSYS__="ProDog2020" +__REVISION__="f2fb4bb5449c1375c0cbde5d15f674a168f2b3bf" +__BUILD__="f2fb4bb5449c1375c0cbde5d15f674a168f2b3bf" # make sure compatibility is always in place -import SCons.compat - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: +import SCons.compat
\ No newline at end of file @@ -37,7 +37,7 @@ month_year = strftime('%B %Y') project = 'scons' -default_version = '3.9.9' +default_version = '3.9.9a996' copyright = "Copyright (c) %s The SCons Foundation" % copyright_years # diff --git a/site_scons/update_build_info.py b/site_scons/update_build_info.py index f1c5468..9c34286 100644 --- a/site_scons/update_build_info.py +++ b/site_scons/update_build_info.py @@ -1,13 +1,18 @@ def update_init_file(env): substitutions = { '__VERSION__': env['VERSION'], - "__COPYRIGHT__": env['COPYRIGHT'], + "__copyright__": env['COPYRIGHT'], "__DEVELOPER__": env['DEVELOPER'], "__DATE__": env['DATE'], "__BUILDSYS__": env['BUILDSYS'], "__REVISION__": env['REVISION'], "__BUILD__": env['BUILD'], } - env.Textfile('#SCons/__versioninfo.py', - ["%s=%s"%(k,v) for k,v in substitutions.items()], - ) + # env.Textfile('#SCons/__versioninfo.py', + + si = env.Textfile('#SCons/__init__.py', + ["%s=\"%s\"" % (k, v) for k, v in substitutions.items()] + + ['# make sure compatibility is always in place', + 'import SCons.compat'], + ) + env.Precious(si) diff --git a/test/option-v.py b/test/option-v.py index ec20b20..49dd84d 100644 --- a/test/option-v.py +++ b/test/option-v.py @@ -36,28 +36,21 @@ copyright_line = """\ (_{2}COPYRIGHT__|Copyright \\(c\\) 2001[-\\d, ]+ The SCons Foundation) """ -# Windows may or may not print a line for the script version -# depending on whether it's invoked through scons.py or scons.bat. -expect1 = r"""SCons by Steven Knight et al.: -\tengine: v\S+, [^,]*, by \S+ on \S+ -\tengine path: \[.*\] -""" + copyright_line expect2 = r"""SCons by Steven Knight et al.: -\tscript: v\S+, [^,]*, by \S+ on \S+ -\tengine: v\S+, [^,]*, by \S+ on \S+ -\tengine path: \[.*\] +\tSCons: v\S+, [^,]*, by \S+ on \S+ +\tSCons path: \[.*\] """ + copyright_line test.run(arguments = '-v') stdout = test.stdout() -if not test.match_re(stdout, expect1) and not test.match_re(stdout, expect2): +if not test.match_re(stdout, expect2): print(stdout) test.fail_test() test.run(arguments = '--version') stdout = test.stdout() -if not test.match_re(stdout, expect1) and not test.match_re(stdout, expect2): +if not test.match_re(stdout, expect2): print(stdout) test.fail_test() |