|
Boost-Commit : |
From: jurko.gospodnetic_at_[hidden]
Date: 2008-01-20 15:18:50
Author: jurko
Date: 2008-01-20 15:18:50 EST (Sun, 20 Jan 2008)
New Revision: 42884
URL: http://svn.boost.org/trac/boost/changeset/42884
Log:
Minor stylistic changes:
* Removed trailing spaces.
* Added a comment for code discovering the user's home-directories.
* Removed a stale regex import.
* Removed an old corpse 'identity' rule found inside the __test__ rule.
Text files modified:
trunk/tools/build/v2/util/os.jam | 57 +++++++++++++++++++++------------------
1 files changed, 31 insertions(+), 26 deletions(-)
Modified: trunk/tools/build/v2/util/os.jam
==============================================================================
--- trunk/tools/build/v2/util/os.jam (original)
+++ trunk/tools/build/v2/util/os.jam 2008-01-20 15:18:50 EST (Sun, 20 Jan 2008)
@@ -1,8 +1,8 @@
-# Copyright 2001, 2002, 2003, 2005 Dave Abrahams
-# Copyright 2006 Rene Rivera
-# Copyright 2003, 2005 Vladimir Prus
-# Distributed under the Boost Software License, Version 1.0.
-# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+# Copyright 2001, 2002, 2003, 2005 Dave Abrahams
+# Copyright 2006 Rene Rivera
+# Copyright 2003, 2005 Vladimir Prus
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
import modules ;
import string ;
@@ -42,7 +42,7 @@
# export all the common constants
.constants = name platform version shared-library-path-variable path-separator executable-path-variable executable-suffix ;
-for local constant in $(.constants)
+for local constant in $(.constants)
{
IMPORT $(__name__) : get-constant : $(__name__) : $(constant) ;
}
@@ -84,16 +84,20 @@
.executable-path-variable = PATH ;
.executable-suffix = "" ;
-# Return a list of the directories in the PATH. Yes, that information
-# is (sort of) available in the global module, but jam code can change
-# those values, and it isn't always clear what case/capitalization to
-# use when looking. This rule is a more reliable way to get there.
+
+# Return a list of the directories in the PATH. Yes, that information is (sort
+# of) available in the global module, but jam code can change those values, and
+# it isn't always clear what case/capitalization to use when looking. This rule
+# is a more reliable way to get there.
rule executable-path ( )
{
- return [ string.words [ environ [ constant executable-path-variable ] ]
- : [ constant path-separator ] ] ;
+ return [ string.words [ environ [ constant executable-path-variable ] ]
+ : [ constant path-separator ] ] ;
}
-
+
+
+# Initialize the list of home directories for the current user depending on the
+# OS.
if $(.name) = NT
{
local home = [ environ HOMEDRIVE HOMEPATH ] ;
@@ -104,14 +108,16 @@
.home-directories = [ environ HOME ] ;
}
-# Can't use 'constant' mechanism because it only returns 1-element
-# values.
+
+# Can't use 'constant' mechanism because it only returns 1-element values.
rule home-directories ( )
{
return $(.home-directories) ;
}
-# Return the string needed to represent the expansion of the named
-# shell variable.
+
+
+# Return the string needed to represent the expansion of the named shell
+# variable.
rule expand-variable ( variable )
{
local prefix = [ constant expand-variable-prefix ] ;
@@ -119,17 +125,18 @@
return $(prefix)$(variable)$(suffix) ;
}
+
# Returns true if running on windows, whether in cygwin or not.
-rule on-windows
+rule on-windows ( )
{
local result ;
- if [ modules.peek : NT ]
+ if [ modules.peek : NT ]
{
result = true ;
}
- else if [ modules.peek : UNIX ]
+ else if [ modules.peek : UNIX ]
{
- switch [ modules.peek : JAMUNAME ]
+ switch [ modules.peek : JAMUNAME ]
{
case CYGWIN* :
{
@@ -140,24 +147,22 @@
return $(result) ;
}
-if ! [ on-windows ]
+
+if ! [ on-windows ]
{
.on-unix = 1 ;
}
+
rule on-unix
{
return $(.on-unix) ;
}
-
-import regex ;
rule __test__
{
import assert ;
- rule identity ( args * ) { return $(args) ; }
-
if ! ( --quiet in [ modules.peek : ARGV ] )
{
ECHO os: name= [ name ] ;
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