|
Boost-Commit : |
From: dave_at_[hidden]
Date: 2007-11-14 15:10:58
Author: dave
Date: 2007-11-14 15:10:58 EST (Wed, 14 Nov 2007)
New Revision: 41096
URL: http://svn.boost.org/trac/boost/changeset/41096
Log:
Merge Beman's changes from trunk
Text files modified:
branches/bitten/tools/regression/src/process_jam_log.cpp | 54 +++++++++++++++++++++++----------------
1 files changed, 32 insertions(+), 22 deletions(-)
Modified: branches/bitten/tools/regression/src/process_jam_log.cpp
==============================================================================
--- branches/bitten/tools/regression/src/process_jam_log.cpp (original)
+++ branches/bitten/tools/regression/src/process_jam_log.cpp 2007-11-14 15:10:58 EST (Wed, 14 Nov 2007)
@@ -16,12 +16,10 @@
#include <string>
#include <cstring>
#include <map>
-#include <utility> // for make_pair
+#include <utility> // for make_pair
#include <ctime>
#include <cctype> // for tolower
-
-#undef NDEBUG
-#include <cassert>
+#include <cstdlib> // for exit
using std::string;
namespace xml = boost::tiny_xml;
@@ -47,7 +45,33 @@
fs::path boost_root;
fs::path locate_root; // ALL_LOCATE_TARGET (or boost_root if none)
-// append_html -------------------------------------------------------------//
+ // set_boost_root --------------------------------------------------------//
+
+ void set_boost_root()
+ {
+
+ boost_root = fs::initial_path();
+
+ for(;;)
+ {
+ if ( fs::exists( boost_root / "libs" ) )
+ {
+ fs::current_path( fs::initial_path() ); // restore initial path
+ return;
+ }
+ fs::current_path( ".." );
+ if ( boost_root == fs::current_path() )
+ {
+ fs::current_path( fs::initial_path() ); // restore initial path
+ std::cout <<
+ "Abort: process_jam_log must be run from within a boost directory tree\n";
+ std::exit(1);
+ }
+ boost_root = fs::current_path();
+ }
+ }
+
+ // append_html -------------------------------------------------------------//
void append_html( const string & src, string & target )
{
@@ -531,6 +555,8 @@
// streams are implemented using standard C files.
std::ios::sync_with_stdio(false);
+ fs::initial_path();
+
if ( argc <= 1 )
std::cout << "Usage: bjam [bjam-args] | process_jam_log [--echo] [--create-directories] [--v1|v2] [locate-root]\n"
"locate-root - the same as the bjam ALL_LOCATE_TARGET\n"
@@ -541,23 +567,7 @@
"v1 - bjam version 1 used.\n"
;
- boost_root = fs::initial_path();
-
- std::cout << "looking for boost_root in: " << boost_root << std::endl;
-
- while ( !boost_root.empty()
- && !fs::exists( boost_root / "libs" ) )
- {
- boost_root /= "..";
- boost_root.normalize();
- std::cout << "searching upward to: " << boost_root << std::endl;
- }
-
- if ( boost_root.empty() )
- {
- std::cout << "must be run from within the boost-root directory tree\n";
- return 1;
- }
+ set_boost_root();
boost_root.normalize();
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