diff options
author | Steven Knight <knight@baldmt.com> | 2003-07-31 19:02:45 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-07-31 19:02:45 (GMT) |
commit | 75a074d126ff285d21033ea39a962023f785089f (patch) | |
tree | 983c745a085c9263c14c69f8a6809f344faac166 /src | |
parent | cdd0eab5e0c816de539b72d681f43d33001cf595 (diff) | |
download | SCons-75a074d126ff285d21033ea39a962023f785089f.zip SCons-75a074d126ff285d21033ea39a962023f785089f.tar.gz SCons-75a074d126ff285d21033ea39a962023f785089f.tar.bz2 |
Don't Split() SConscript file name strings on white space.
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 6 | ||||
-rw-r--r-- | src/RELEASE.txt | 30 | ||||
-rw-r--r-- | src/engine/SCons/Script/SConscript.py | 33 | ||||
-rw-r--r-- | src/engine/SCons/Util.py | 3 |
4 files changed, 46 insertions, 26 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 8c8f08a..f966b79 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -68,6 +68,12 @@ RELEASE 0.XX - XXX - Refactor the creation of the Program, *Object and *Library Builders so that they're moved out of SCons.Defaults and created on demand. + - Don't split SConscript file names on white space. + + - Document the SConscript function's "dirs" and "name" keywords. + + - Remove the internal (and superfluous) SCons.Util.argmunge() function. + From Gary Oberbrunner: - Report the target being built in error messages when building diff --git a/src/RELEASE.txt b/src/RELEASE.txt index 3cf87ca..f8c29d5 100644 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -7,7 +7,7 @@ Release Notes -This is an alpha release of SCons, a tool for building software (and +This is an beta release of SCons, a tool for building software (and other files). SCons is implemented in Python, and its "configuration files" are actually Python scripts, allowing you to use the full power of a real scripting language to solve build problems. You do not, @@ -32,19 +32,32 @@ RELEASE 0.XX - XXX spelling still works but has been deprecated and generates a warning. + - The SConscript() function no longer splits its first argument on + white space into a list of SConscript file names. You must now + explicitly enclose the file names in a list: + + SConscript(['sub1/SConscript', 'sub2/SConscript']) + + Or use the Split() function (or something similar) to create a list: + + SConscript(Split('sub1/SConscript sub2/SConscript')) + + This makes the SConscript() function's handling of file names + consistent with the rest of SCons. + Please note the following important changes since release 0.14: - SCons now tries to verify that Microsoft Visual Studio (including - Visual C++) is actually installed before using it, by checking that - the program directory exists. If SCons cannot find your copy of - Visual Studio, it is probably because it installed itself itself in - a default directory that we have not seen before. If this is the + Visual C++) is actually installed before using it, by checking + that the program directory exists. If SCons cannot find your copy + of Visual Studio, it is probably because it installed itself in a + default directory that we have not seen before. If this is the case, please let us know so that we can update future versions. SCons is developed with an extensive regression test suite, and a rigorous development methodology for continually improving that suite. Because of this, SCons is of sufficient quality that you can use it - for real work. The "alpha" status of the release reflects that we + for real work. The "beta" status of the release reflects that we still may change interfaces in future releases, which may require modifications to your SConscript files. We strive to hold these changes to a minimum. @@ -143,12 +156,12 @@ RELEASE 0.XX - XXX an infinite loop. - When using SourceSignatures('timestamp'), changes to Python - Value() do not cause rebuilds. + Value() Nodes do not cause rebuilds. - No support yet for the following planned command-line options: -d -e -l --list-actions --list-derived --list-where - -o --override -p -r -R --random -w --write-filenames + -o --override -p -r -R -w --write-filenames -W --warn-undefined-variables @@ -164,6 +177,7 @@ With plenty of help from the SCons Development team: Chad Austin Charles Crain Steve Leblanc + Gary Oberbrunner Anthony Roach Greg Spencer Christoph Wiedemann diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index 8987908..ee53a63 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/engine/SCons/Script/SConscript.py @@ -91,7 +91,8 @@ def get_calling_namespaces(): def compute_exports(exports): """Compute a dictionary of exports given one of the parameters to the Export() function or the exports argument to SConscript().""" - exports = SCons.Util.argmunge(exports) + + exports = SCons.Util.Split(exports) loc, glob = get_calling_namespaces() retval = {} @@ -149,41 +150,43 @@ def Return(*vars): # exports. def GetSConscriptFilenames(ls, kw): - files = [] exports = [] if len(ls) == 0: try: - dirs = map(str, SCons.Util.argmunge(kw["dirs"])) + dirs = kw["dirs"] except KeyError: raise SCons.Errors.UserError, \ "Invalid SConscript usage - no parameters" - name = kw.get('name', 'SConscript') + if not SCons.Util.is_List(dirs): + dirs = [ dirs ] + dirs = map(str, dirs) - if kw.get('exports'): - exports = SCons.Util.argmunge(kw['exports']) + name = kw.get('name', 'SConscript') files = map(lambda n, name = name: os.path.join(n, name), dirs) elif len(ls) == 1: - files = SCons.Util.argmunge(ls[0]) - if kw.get('exports'): - exports = SCons.Util.argmunge(kw['exports']) + files = ls[0] elif len(ls) == 2: - files = SCons.Util.argmunge(ls[0]) - exports = SCons.Util.argmunge(ls[1]) - - if kw.get('exports'): - exports.extend(SCons.Util.argmunge(kw['exports'])) + files = ls[0] + exports = SCons.Util.Split(ls[1]) else: + raise SCons.Errors.UserError, \ "Invalid SConscript() usage - too many arguments" + if not SCons.Util.is_List(files): + files = [ files ] + + if kw.get('exports'): + exports.extend(SCons.Util.Split(kw['exports'])) + build_dir = kw.get('build_dir') if build_dir: if len(files) != 1: @@ -398,7 +401,7 @@ def Export(*vars): def Import(*vars): try: for var in vars: - var = SCons.Util.argmunge(var) + var = SCons.Util.Split(var) for v in var: if v == '*': stack[-1].globals.update(global_exports) diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index 2a96d25..cba61e5 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -619,9 +619,6 @@ def is_Dict(e): def is_List(e): return type(e) is types.ListType or isinstance(e, UserList.UserList) -def argmunge(arg): - return Split(arg) - def Split(arg): """This function converts a string or list into a list of strings or Nodes. This makes things easier for users by allowing files to |