|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75110 - in trunk/tools/build/v2: . test
From: ghost_at_[hidden]
Date: 2011-10-25 04:26:43
Author: vladimir_prus
Date: 2011-10-25 04:26:40 EDT (Tue, 25 Oct 2011)
New Revision: 75110
URL: http://svn.boost.org/trac/boost/changeset/75110
Log:
Fix the functionality of ignoring using config in Python port.
Text files modified:
trunk/tools/build/v2/build_system.py | 29 +++++++++++++++++------------
trunk/tools/build/v2/test/conditionals_multiple.py | 4 ++--
2 files changed, 19 insertions(+), 14 deletions(-)
Modified: trunk/tools/build/v2/build_system.py
==============================================================================
--- trunk/tools/build/v2/build_system.py (original)
+++ trunk/tools/build/v2/build_system.py 2011-10-25 04:26:40 EDT (Tue, 25 Oct 2011)
@@ -291,6 +291,9 @@
initialize_config_module('user-config')
if not test_config and not legacy_ignore_config:
+ # Here, user_config has value of None if nothing is explicitly
+ # specified, and value of '' if user explicitly does not want
+ # to load any user config.
user_config = None
for a in sys.argv:
m = re.match("--user-config=(.*)$", a)
@@ -298,30 +301,32 @@
user_config = m.group(1)
break
- if not user_config:
+ if user_config is None:
user_config = os.getenv("BOOST_BUILD_USER_CONFIG")
# Special handling for the case when the OS does not strip the quotes
# around the file name, as is the case when using Cygwin bash.
user_config = b2.util.unquote(user_config)
explicitly_requested = user_config
- if not user_config:
+
+ if user_config is None:
user_config = "user-config.jam"
- if explicitly_requested:
+ if user_config:
+ if explicitly_requested:
- user_config = os.path.abspath(user_config)
+ user_config = os.path.abspath(user_config)
- if debug_config:
- print "notice: Loading explicitly specified user configuration file:"
- print " " + user_config
+ if debug_config:
+ print "notice: Loading explicitly specified user configuration file:"
+ print " " + user_config
- load_config('user-config', os.path.basename(user_config), [os.path.dirname(user_config)], True)
+ load_config('user-config', os.path.basename(user_config), [os.path.dirname(user_config)], True)
+ else:
+ load_config('user-config', os.path.basename(user_config), user_path)
else:
- load_config('user-config', os.path.basename(user_config), user_path)
-
- elif debug_config:
- print "notice: User configuration file loading explicitly disabled." ;
+ if debug_config:
+ print "notice: User configuration file loading explicitly disabled."
# We look for project-config.jam from "." upward.
# I am not sure this is 100% right decision, we might as well check for
Modified: trunk/tools/build/v2/test/conditionals_multiple.py
==============================================================================
--- trunk/tools/build/v2/test/conditionals_multiple.py (original)
+++ trunk/tools/build/v2/test/conditionals_multiple.py 2011-10-25 04:26:40 EDT (Tue, 25 Oct 2011)
@@ -21,7 +21,7 @@
"""Basic tests for properties conditioned on multiple other properties.
"""
- t = BoostBuild.Tester("--ignore-regular-config toolset=testToolset",
+ t = BoostBuild.Tester("--user-config= --ignore-site-config toolset=testToolset",
pass_toolset=False, use_test_config=False)
t.write("testToolset.jam", """
@@ -133,7 +133,7 @@
toolset = "testToolset" ;
- t = BoostBuild.Tester("--ignore-regular-config", pass_toolset=False, use_test_config=False)
+ t = BoostBuild.Tester("--user-config= --ignore-site-config", pass_toolset=False, use_test_config=False)
t.write( toolset + ".jam", """
import feature ;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk