diff options
author | Steven Knight <knight@baldmt.com> | 2001-12-21 18:05:38 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2001-12-21 18:05:38 (GMT) |
commit | ed3aa5e39e64a5b48b493f33d1438572678d8b65 (patch) | |
tree | c6d413502e18ee12dd833f647437ac10503cc263 | |
parent | 15674b6b3ee16f5979f5ceb971531d3b1f29f567 (diff) | |
download | SCons-ed3aa5e39e64a5b48b493f33d1438572678d8b65.zip SCons-ed3aa5e39e64a5b48b493f33d1438572678d8b65.tar.gz SCons-ed3aa5e39e64a5b48b493f33d1438572678d8b65.tar.bz2 |
Create the Script directory
-rw-r--r-- | doc/man/scons.1 | 3 | ||||
-rw-r--r-- | rpm/scons.spec | 6 | ||||
-rw-r--r-- | src/engine/MANIFEST.in | 4 | ||||
-rw-r--r-- | src/engine/SCons/Script/SConscript.py (renamed from src/engine/SCons/SConscript.py) | 5 | ||||
-rw-r--r-- | src/engine/SCons/Script/SConscriptTests.py (renamed from src/engine/SCons/SConscriptTests.py) | 2 | ||||
-rw-r--r-- | src/engine/SCons/Script/__init__.py (renamed from src/engine/SCons/Script.py) | 21 | ||||
-rw-r--r-- | src/engine/setup.py | 3 | ||||
-rw-r--r-- | src/setup.py | 3 | ||||
-rw-r--r-- | test/SConstruct.py | 4 | ||||
-rw-r--r-- | test/errors.py | 12 |
10 files changed, 35 insertions, 28 deletions
diff --git a/doc/man/scons.1 b/doc/man/scons.1 index 5b7b985..b93ccc4 100644 --- a/doc/man/scons.1 +++ b/doc/man/scons.1 @@ -780,7 +780,8 @@ This specifies help text to be printed if the .B -h argument is given to .BR scons . -This function can be called multiple times to print multiple help messages. +.B scons +will exit after printing out the help text. .TP .RI BuildDir( build_dir ", " src_dir ) diff --git a/rpm/scons.spec b/rpm/scons.spec index c8feb9c..74206f3 100644 --- a/rpm/scons.spec +++ b/rpm/scons.spec @@ -70,8 +70,10 @@ rm -rf $RPM_BUILD_ROOT /usr/lib/scons/SCons/Scanner/Prog.pyc /usr/lib/scons/SCons/Scanner/__init__.py /usr/lib/scons/SCons/Scanner/__init__.pyc -/usr/lib/scons/SCons/Script.py -/usr/lib/scons/SCons/Script.pyc +/usr/lib/scons/SCons/Script/__init__.py +/usr/lib/scons/SCons/Script/__init__.pyc +/usr/lib/scons/SCons/Script/SConscript.py +/usr/lib/scons/SCons/Script/SConscript.pyc /usr/lib/scons/SCons/Sig/MD5.py /usr/lib/scons/SCons/Sig/MD5.pyc /usr/lib/scons/SCons/Sig/TimeStamp.py diff --git a/src/engine/MANIFEST.in b/src/engine/MANIFEST.in index ad38b18..5c6c0b0 100644 --- a/src/engine/MANIFEST.in +++ b/src/engine/MANIFEST.in @@ -10,8 +10,8 @@ SCons/Node/FS.py SCons/Scanner/__init__.py SCons/Scanner/C.py SCons/Scanner/Prog.py -SCons/SConscript.py -SCons/Script.py +SCons/Script/SConscript.py +SCons/Script/__init__.py SCons/Sig/__init__.py SCons/Sig/MD5.py SCons/Sig/TimeStamp.py diff --git a/src/engine/SCons/SConscript.py b/src/engine/SCons/Script/SConscript.py index 1479c7a..5fc5487 100644 --- a/src/engine/SCons/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -40,7 +40,7 @@ import string import sys default_targets = [] -help_option = None +print_help = 0 # global exports set by Export(): global_exports = {} @@ -117,8 +117,7 @@ def Default(*targets): default_targets.append(s) def Help(text): - global help_option - if help_option == 'h': + if print_help: print text print "Use scons -H for help about command-line options." sys.exit(0) diff --git a/src/engine/SCons/SConscriptTests.py b/src/engine/SCons/Script/SConscriptTests.py index d44af5c..f17c026 100644 --- a/src/engine/SCons/SConscriptTests.py +++ b/src/engine/SCons/Script/SConscriptTests.py @@ -23,6 +23,6 @@ __revision__ = "src/engine/SCons/SConscriptTests.py __REVISION__ __DATE__ __DEVELOPER__" -import SCons.SConscript +import SCons.Script.SConscript # all of the SConscript.py tests are in test/SConscript.py diff --git a/src/engine/SCons/Script.py b/src/engine/SCons/Script/__init__.py index e35e03d..bb67991 100644 --- a/src/engine/SCons/Script.py +++ b/src/engine/SCons/Script/__init__.py @@ -59,7 +59,7 @@ import SCons.Sig import SCons.Sig.MD5 from SCons.Taskmaster import Taskmaster import SCons.Builder -import SCons.SConscript +import SCons.Script.SConscript # @@ -105,7 +105,7 @@ current_func = None calc = None ignore_errors = 0 keep_going_on_error = 0 - +help_option = None # utility functions @@ -357,14 +357,17 @@ def options_init(): help = "Read FILE as the top-level SConstruct file.") def opt_help(opt, arg): - SCons.SConscript.help_option = 'h' + global help_option + help_option = 'h' + SCons.Script.SConscript.print_help = 1 Option(func = opt_help, short = 'h', long = ['help'], help = "Print defined help message, or this one.") def opt_help_options(opt, arg): - SCons.SConscript.help_option = 'H' + global help_option + help_option = 'H' Option(func = opt_help_options, short = 'H', long = ['help-options'], @@ -574,12 +577,12 @@ def _main(): scripts.append(file) break - if SCons.SConscript.help_option == 'H': + if help_option == 'H': print UsageString() sys.exit(0) if not scripts: - if SCons.SConscript.help_option == 'h': + if help_option == 'h': # There's no SConstruct, but they specified -h. # Give them the options usage now, before we fail # trying to read a non-existent SConstruct file. @@ -591,18 +594,18 @@ def _main(): sys.path = include_dirs + sys.path for script in scripts: - SCons.SConscript.SConscript(script) + SCons.Script.SConscript.SConscript(script) SCons.Node.FS.default_fs.chdir(SCons.Node.FS.default_fs.Top) - if SCons.SConscript.help_option == 'h': + if help_option == 'h': # They specified -h, but there was no Help() inside the # SConscript files. Give them the options usage. print UsageString() sys.exit(0) if not targets: - targets = SCons.SConscript.default_targets + targets = SCons.Script.SConscript.default_targets def Entry(x): if isinstance(x, SCons.Node.Node): diff --git a/src/engine/setup.py b/src/engine/setup.py index 3d51b0e..8039b69 100644 --- a/src/engine/setup.py +++ b/src/engine/setup.py @@ -64,4 +64,5 @@ software.""", packages = ["SCons", "SCons.Node", "SCons.Scanner", - "SCons.Sig"]) + "SCons.Sig", + "SCons.Script"]) diff --git a/src/setup.py b/src/setup.py index fb90467..c0d1510 100644 --- a/src/setup.py +++ b/src/setup.py @@ -69,7 +69,8 @@ arguments = { 'packages' : ["SCons", "SCons.Node", "SCons.Scanner", - "SCons.Sig"], + "SCons.Sig", + "SCons.Script"], 'package_dir' : {'' : 'engine'}, 'scripts' : ["script/scons"], 'cmdclass' : {'install_lib' : my_install_lib} diff --git a/test/SConstruct.py b/test/SConstruct.py index 33a20ce..1c830d7 100644 --- a/test/SConstruct.py +++ b/test/SConstruct.py @@ -30,9 +30,9 @@ import TestSCons test = TestSCons.TestSCons(match = TestCmd.match_re) test.run(stdout = "", - stderr = """ + stderr = r""" SCons error: No SConstruct file found. -File "\S+Script.py", line \d+, in _main +File "\S+", line \d+, in \S+ """) test.match_func = TestCmd.match_exact diff --git a/test/errors.py b/test/errors.py index cb2248d..526ffaa 100644 --- a/test/errors.py +++ b/test/errors.py @@ -68,12 +68,12 @@ raise InternalError, 'error inside' test.run(arguments='-f SConstruct3', stdout = "other errors\n", stderr = r"""Traceback \((most recent call|innermost) last\): - File ".*Script.py", line \d+, in main - _main\(\) - File ".*Script.py", line \d+, in _main - SCons.SConscript.SConscript\(script\) - File ".*SConscript.py", line \d+, in SConscript - exec file in stack\[-1\].globals + File ".+", line \d+, in .+ + .+ + File ".+", line \d+, in .+ + .+ + File ".+", line \d+, in .+ + .+ File "SConstruct3", line \d+, in \? raise InternalError, 'error inside' InternalError: error inside |