Boost logo

Boost :

From: Daniel James (daniel_at_[hidden])
Date: 2004-07-27 13:59:48


Hi,

When bcp is searching for files to copy, it doesn't normalize the path, so
if a file is referenced from two different locations using relative paths
it doesn't work. This happens when it is used on the preprocessor library.

The following patch fixes this by normalizing the path in
bcp_implementation::add_path. It also updates bcp's Jamfile.v2.

Daniel

Index: Jamfile.v2
===================================================================
RCS file: /cvsroot/boost/boost/tools/bcp/Jamfile.v2,v
retrieving revision 1.1
diff -u -r1.1 Jamfile.v2
--- Jamfile.v2 29 Aug 2003 07:51:22 -0000 1.1
+++ Jamfile.v2 27 Jul 2004 18:55:59 -0000
@@ -4,9 +4,9 @@
   : add_path.cpp bcp_imp.cpp copy_path.cpp file_types.cpp
     fileview.cpp main.cpp path_operations.cpp scan_cvs_path.cpp
     licence_info.cpp scan_licence.cpp output_licence_info.cpp
- ../../libs/filesystem/build//boost_filesystem
- ../../libs/regex/build//boost_regex
- ../../libs/test/build//prg_exec_monitor
+ /boost/filesystem//boost_filesystem
+ /boost/regex//boost_regex
+ /boost/test//boost_prg_exec_monitor
   :
   <define>BOOST_REGEX_NO_LIB=1
   :
Index: add_path.cpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/bcp/add_path.cpp,v
retrieving revision 1.6
diff -u -r1.6 add_path.cpp
--- add_path.cpp 14 Jul 2004 10:59:37 -0000 1.6
+++ add_path.cpp 27 Jul 2004 18:56:00 -0000
@@ -21,10 +21,13 @@
 
 void bcp_implementation::add_path(const fs::path& p)
 {
- if(fs::exists(m_boost_path / p) && fs::is_directory(m_boost_path / p))
- add_directory(p);
+ fs::path normalized_path = p;
+ normalized_path.normalize();
+ if(fs::exists(m_boost_path / normalized_path)
+ && fs::is_directory(m_boost_path / normalized_path))
+ add_directory(normalized_path);
    else
- add_file(p);
+ add_file(normalized_path);
 }
 
 void bcp_implementation::add_directory(const fs::path& p)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk