Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70471 - in trunk/tools/build/v2: engine util
From: ghost_at_[hidden]
Date: 2011-03-23 05:55:31


Author: vladimir_prus
Date: 2011-03-23 05:55:29 EDT (Wed, 23 Mar 2011)
New Revision: 70471
URL: http://svn.boost.org/trac/boost/changeset/70471

Log:
Fix path.makedirs on Windows.

Text files modified:
   trunk/tools/build/v2/engine/filent.c | 17 ++++++++++++++++-
   trunk/tools/build/v2/util/path.jam | 5 +++--
   2 files changed, 19 insertions(+), 3 deletions(-)

Modified: trunk/tools/build/v2/engine/filent.c
==============================================================================
--- trunk/tools/build/v2/engine/filent.c (original)
+++ trunk/tools/build/v2/engine/filent.c 2011-03-23 05:55:29 EDT (Wed, 23 Mar 2011)
@@ -185,8 +185,23 @@
         unsigned long len = strlen(d->name);
         if ( len == 1 && d->name[0] == '\\' )
             (*func)( closure, d->name, 1 /* stat()'ed */, d->time );
- else if ( len == 3 && d->name[1] == ':' )
+ else if ( len == 3 && d->name[1] == ':' ) {
             (*func)( closure, d->name, 1 /* stat()'ed */, d->time );
+ /* We've just entered 3-letter drive name spelling (with trailing
+ slash), into the hash table. Now enter two-letter variant,
+ without trailing slash, so that if we try to check whether
+ "c:" exists, we hit it.
+
+ Jam core has workarounds for that. Given:
+ x = c:\whatever\foo ;
+ p = $(x:D) ;
+ p2 = $(p:D) ;
+ There will be no trailing slash in $(p), but there will be one
+ in $(p2). But, that seems rather fragile.
+ */
+ d->name[2] = '0';
+ (*func)( closure, d->name, 1 /* stat()'ed */, d->time );
+ }
     }
 
     /* Now enter contents of directory */

Modified: trunk/tools/build/v2/util/path.jam
==============================================================================
--- trunk/tools/build/v2/util/path.jam (original)
+++ trunk/tools/build/v2/util/path.jam 2011-03-23 05:55:29 EDT (Wed, 23 Mar 2011)
@@ -468,11 +468,12 @@
 rule makedirs ( path )
 {
     local result = true ;
- if ! [ exists $(path) ]
+ local native = [ native $(path) ] ;
+ if ! [ exists $(native) ]
     {
         if [ makedirs [ parent $(path) ] ]
         {
- if ! [ MAKEDIR $(path) ]
+ if ! [ MAKEDIR $(native) ]
             {
                 errors.error "Could not create directory '$(path)'" ;
                 result = ;


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