Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79924 - in trunk/tools/build/v2: build util
From: jurko.gospodnetic_at_[hidden]
Date: 2012-08-08 11:49:34


Author: jurko
Date: 2012-08-08 11:49:33 EDT (Wed, 08 Aug 2012)
New Revision: 79924
URL: http://svn.boost.org/trac/boost/changeset/79924

Log:
Boost Build cleanup - minor stylistic changes.
Text files modified:
   trunk/tools/build/v2/build/project.jam | 22 ++++++++++++--------
   trunk/tools/build/v2/build/project.py | 2
   trunk/tools/build/v2/util/path.jam | 41 ++++++++++++++++++++++-----------------
   3 files changed, 37 insertions(+), 28 deletions(-)

Modified: trunk/tools/build/v2/build/project.jam
==============================================================================
--- trunk/tools/build/v2/build/project.jam (original)
+++ trunk/tools/build/v2/build/project.jam 2012-08-08 11:49:33 EDT (Wed, 08 Aug 2012)
@@ -30,7 +30,7 @@
 # behave as a regular project except that, since it is not associated with any
 # location, it should only declare prebuilt targets.
 #
-# The list of all loaded Jamfile is stored in the .project-locations variable.
+# The list of all loaded Jamfiles is stored in the .project-locations variable.
 # It is possible to obtain a module name for a location using the 'module-name'
 # rule. Standalone projects are not recorded and can only be referenced using
 # their project id.
@@ -59,7 +59,7 @@
     {
         if $(.debug-loading)
         {
- ECHO "Loading Jamfile at" '$(jamfile-location)' ;
+ ECHO Loading Jamfile at '$(jamfile-location)' ;
         }
 
         load-jamfile $(jamfile-location) : $(module-name) ;
@@ -82,12 +82,12 @@
 rule load-used-projects ( module-name )
 {
     local used = [ modules.peek $(module-name) : .used-projects ] ;
- local location = [ attribute $(module-name) location ] ;
+ local root-location = [ attribute $(module-name) location ] ;
     while $(used)
     {
         local id = $(used[1]) ;
         local where = $(used[2]) ;
- use $(id) : [ path.root [ path.make $(where) ] $(location) ] ;
+ use $(id) : [ path.root [ path.make $(where) ] $(root-location) ] ;
         used = $(used[3-]) ;
     }
 }
@@ -219,7 +219,8 @@
     #
     if $(jamfile-to-load[2-])
     {
- local v2-jamfiles = [ MATCH (.*[Jj]amfile\\.v2)|(.*[Bb]uild\\.jam) : $(jamfile-to-load) ] ;
+ local v2-jamfiles = [ MATCH (.*[Jj]amfile\\.v2)|(.*[Bb]uild\\.jam) :
+ $(jamfile-to-load) ] ;
 
         if $(v2-jamfiles) && ! $(v2-jamfiles[2])
         {
@@ -575,7 +576,7 @@
 
 # Associate the given id with the given project module.
 #
-rule register-id ( id : module )
+local rule register-id ( id : module )
 {
     $(id).jamfile-module = $(module) ;
 }
@@ -588,12 +589,12 @@
 #
 class project-attributes
 {
- import property ;
- import property-set ;
     import path ;
     import print ;
- import sequence ;
     import project ;
+ import property ;
+ import property-set ;
+ import sequence ;
 
     rule __init__ ( location project-module )
     {
@@ -676,6 +677,9 @@
         }
         else if $(attribute) = "id"
         {
+ # project.register-id() is a local rule so we need to import it
+ # explicitly.
+ IMPORT project : register-id : $(__name__) : project.register-id ;
             self.id = [ path.root $(specification) / ] ;
             project.register-id $(self.id) : $(self.project-module) ;
         }

Modified: trunk/tools/build/v2/build/project.py
==============================================================================
--- trunk/tools/build/v2/build/project.py (original)
+++ trunk/tools/build/v2/build/project.py 2012-08-08 11:49:33 EDT (Wed, 08 Aug 2012)
@@ -34,7 +34,7 @@
 # behave as a regular project except that, since it is not associated with any
 # location, it should only declare prebuilt targets.
 #
-# The list of all loaded Jamfile is stored in the .project-locations variable.
+# The list of all loaded Jamfiles is stored in the .project-locations variable.
 # It is possible to obtain a module name for a location using the 'module-name'
 # rule. Standalone projects are not recorded and can only be references using
 # their project id.

Modified: trunk/tools/build/v2/util/path.jam
==============================================================================
--- trunk/tools/build/v2/util/path.jam (original)
+++ trunk/tools/build/v2/util/path.jam 2012-08-08 11:49:33 EDT (Wed, 08 Aug 2012)
@@ -1,7 +1,6 @@
 # Copyright 2002-2006. Vladimir Prus
 # Copyright 2003-2004. Dave Abrahams
 # Copyright 2003-2006. Rene Rivera
-#
 # Distributed under the Boost Software License, Version 1.0.
 # (See accompanying file LICENSE_1_0.txt or copy at
 # http://www.boost.org/LICENSE_1_0.txt)
@@ -140,13 +139,13 @@
     }
     else
     {
- local tokens = [ regex.split $(path) "/" ] ;
+ local tokens = [ regex.split $(path) / ] ;
         local tokens2 ;
         for local i in $(tokens)
         {
             tokens2 += .. ;
         }
- return [ sequence.join $(tokens2) : "/" ] ;
+ return [ sequence.join $(tokens2) : / ] ;
     }
 }
 
@@ -183,7 +182,7 @@
             # from the path.make-NT rule.
             if ! $(elements[1]) && $(elements[2])
             {
- return [ NORMALIZE_PATH "/" "$(elements[2-])" ] ;
+ return [ NORMALIZE_PATH / "$(elements[2-])" ] ;
             }
             else
             {
@@ -320,13 +319,13 @@
 rule all-parents ( path : upper_limit ? : cwd ? )
 {
     cwd ?= [ pwd ] ;
- local path_ele = [ regex.split [ root $(path) $(cwd) ] "/" ] ;
+ local path_ele = [ regex.split [ root $(path) $(cwd) ] / ] ;
 
     if ! $(upper_limit)
     {
         upper_limit = / ;
     }
- local upper_ele = [ regex.split [ root $(upper_limit) $(cwd) ] "/" ] ;
+ local upper_ele = [ regex.split [ root $(upper_limit) $(cwd) ] / ] ;
 
     # Leave only elements in 'path_ele' below 'upper_ele'.
     while $(path_ele) && ( $(upper_ele[1]) = $(path_ele[1]) )
@@ -534,7 +533,7 @@
     {
         result = [ MATCH "^/?(.*)" : $(path) ] ;
     }
- result = [ sequence.join [ regex.split $(result) "/" ] : "\\" ] ;
+ result = [ sequence.join [ regex.split $(result) / ] : \\ ] ;
     return $(result) ;
 }
 
@@ -585,7 +584,8 @@
 #
 rule split-path-VMS ( native )
 {
- local matches = [ MATCH ([a-zA-Z0-9_-]+:)?(\\[[^\]]*\\])?(.*)?$ : $(native) ] ;
+ local matches = [ MATCH ([a-zA-Z0-9_-]+:)?(\\[[^\]]*\\])?(.*)?$ : $(native)
+ ] ;
     local device = $(matches[1]) ;
     local dir = $(matches[2]) ;
     local file = $(matches[3]) ;
@@ -697,10 +697,9 @@
     #
     # This is no exact science, just guess work:
     #
- # If the last part of the current path spec
- # includes some chars, followed by a dot,
- # optionally followed by more chars -
- # then it is a file (keep your fingers crossed).
+ # If the last part of the current path spec includes some chars, followed by
+ # a dot, optionally followed by more chars - then it is a file (keep your
+ # fingers crossed).
     #
     split = [ regex.split $(dir) / ] ;
     local maybe_file = $(split[-1]) ;
@@ -802,8 +801,10 @@
     local CWD = "/home/ghost/build" ;
     assert.result : all-parents . : . : $(CWD) ;
     assert.result . .. ../.. ../../.. : all-parents "Jamfile" : "" : $(CWD) ;
- assert.result foo . .. ../.. ../../.. : all-parents "foo/Jamfile" : "" : $(CWD) ;
- assert.result ../Work .. ../.. ../../.. : all-parents "../Work/Jamfile" : "" : $(CWD) ;
+ assert.result foo . .. ../.. ../../.. : all-parents "foo/Jamfile" : "" :
+ $(CWD) ;
+ assert.result ../Work .. ../.. ../../.. : all-parents "../Work/Jamfile" : ""
+ : $(CWD) ;
 
     local CWD = "/home/ghost" ;
     assert.result . .. : all-parents "Jamfile" : "/home" : $(CWD) ;
@@ -826,7 +827,8 @@
     assert.result "foo/bar" : make "foo/././././bar" ;
     assert.result "/foo" : make "\\foo" ;
     assert.result "/D:/My Documents" : make "D:\\My Documents" ;
- assert.result "/c:/boost/tools/build/new/project.jam" : make "c:\\boost\\tools\\build\\test\\..\\new\\project.jam" ;
+ assert.result "/c:/boost/tools/build/new/project.jam" : make
+ "c:\\boost\\tools\\build\\test\\..\\new\\project.jam" ;
 
     # Test processing 'invalid' paths containing multiple successive path
     # separators.
@@ -842,7 +844,8 @@
     assert.result "foo/bar" : make "foo//\\//\\\\bar//\\//\\\\\\//\\//\\\\" ;
     assert.result "foo" : make "foo/bar//.." ;
     assert.result "foo/bar" : make "foo/bar/giz//.." ;
- assert.result "foo/giz" : make "foo//\\//\\\\bar///\\\\//\\\\////\\/..///giz\\//\\\\\\//\\//\\\\" ;
+ assert.result "foo/giz" : make
+ "foo//\\//\\\\bar///\\\\//\\\\////\\/..///giz\\//\\\\\\//\\//\\\\" ;
     assert.result "../../../foo" : make "..///.//..///.//..////foo///" ;
 
     # Test processing 'invalid' rooted paths with too many '..' path elements
@@ -908,7 +911,8 @@
     assert.result "giz.h" : make "giz.h" ;
     assert.result "foo/bar/giz.h" : make "[.foo.bar]giz.h" ;
     assert.result "/disk:/my_docs" : make "disk:[my_docs]" ;
- assert.result "/disk:/boost/tools/build/new/project.jam" : make "disk:[boost.tools.build.test.-.new]project.jam" ;
+ assert.result "/disk:/boost/tools/build/new/project.jam" : make
+ "disk:[boost.tools.build.test.-.new]project.jam" ;
 
     #
     # Special case (adds '.' to end of file w/o extension to disambiguate from
@@ -930,7 +934,8 @@
     assert.result "disk:[my_docs.work]" : native "/disk:/my_docs/work" ;
     assert.result "giz.h" : native "giz.h" ;
     assert.result "disk:Jamfile." : native "/disk:Jamfile." ;
- assert.result "disk:[my_docs.work]Jamfile." : native "/disk:/my_docs/work/Jamfile." ;
+ assert.result "disk:[my_docs.work]Jamfile." : native
+ "/disk:/my_docs/work/Jamfile." ;
 
     modules.poke path : os : $(save-os) ;
 }


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