Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49280 - branches/release/tools/bcp
From: john_at_[hidden]
Date: 2008-10-11 11:32:37


Author: johnmaddock
Date: 2008-10-11 11:32:36 EDT (Sat, 11 Oct 2008)
New Revision: 49280
URL: http://svn.boost.org/trac/boost/changeset/49280

Log:
Merge changes from Trunk.
Text files modified:
   branches/release/tools/bcp/add_path.cpp | 4 ++--
   branches/release/tools/bcp/bcp_imp.cpp | 10 +++++++++-
   branches/release/tools/bcp/main.cpp | 19 +++++++++++++++----
   3 files changed, 26 insertions(+), 7 deletions(-)

Modified: branches/release/tools/bcp/add_path.cpp
==============================================================================
--- branches/release/tools/bcp/add_path.cpp (original)
+++ branches/release/tools/bcp/add_path.cpp 2008-10-11 11:32:36 EDT (Sat, 11 Oct 2008)
@@ -253,7 +253,7 @@
          }
          include_file = i->str();
       }
- catch(const fs::filesystem_error& e)
+ catch(const fs::filesystem_error&)
       {
          std::cerr << "Can't parse filename " << *i << " included by file " << p.string() << std::endl;
          ++i;
@@ -292,7 +292,7 @@
       try{
          include_file = i->str();
       }
- catch(const fs::filesystem_error& e)
+ catch(const fs::filesystem_error&)
       {
          std::cerr << "Can't parse filename " << *i << " included by file " << p.string() << std::endl;
          ++i;

Modified: branches/release/tools/bcp/bcp_imp.cpp
==============================================================================
--- branches/release/tools/bcp/bcp_imp.cpp (original)
+++ branches/release/tools/bcp/bcp_imp.cpp 2008-10-11 11:32:36 EDT (Sat, 11 Oct 2008)
@@ -78,7 +78,8 @@
 
 void bcp_implementation::set_boost_path(const char* p)
 {
- m_boost_path = fs::path(p, fs::native);
+ // Hack to strip trailing slashes from the path
+ m_boost_path = (fs::path(p, fs::native) / "boost").parent_path();
    fs::path check = m_boost_path / "boost" / "version.hpp";
    if(!fs::exists(check))
    {
@@ -125,6 +126,13 @@
       std::runtime_error e(msg);
       boost::throw_exception(e);
    }
+ //
+ // Check Boost path is OK if it hasn't been checked already:
+ //
+ if(m_boost_path == "")
+ {
+ set_boost_path("");
+ }
    // start by building a list of permitted files
    // if m_cvs_mode is true:
    if(m_cvs_mode)

Modified: branches/release/tools/bcp/main.cpp
==============================================================================
--- branches/release/tools/bcp/main.cpp (original)
+++ branches/release/tools/bcp/main.cpp 2008-10-11 11:32:36 EDT (Sat, 11 Oct 2008)
@@ -11,6 +11,8 @@
 
 #include <iostream>
 #include <cstring>
+#include <string>
+#include <list>
 #include <boost/filesystem/path.hpp>
 #include <boost/version.hpp>
 #include "bcp.hpp"
@@ -74,6 +76,7 @@
    // object what ir needs to do:
    //
    bool list_mode = false;
+ std::list<const char*> positional_args;
    for(int i = 1; i < argc; ++i)
    {
       if(0 == std::strcmp("-h", argv[i])
@@ -138,13 +141,21 @@
       }
       else
       {
- if(!list_mode && (i == argc - 1))
- papp->set_destination(argv[i]);
- else
- papp->add_module(argv[i]);
+ positional_args.push_back(argv[i]);
       }
    }
    //
+ // Handle positional args last:
+ //
+ for(std::list<const char*>::const_iterator i = positional_args.begin();
+ i != positional_args.end(); ++i)
+ {
+ if(!list_mode && (i == --positional_args.end()))
+ papp->set_destination(*i);
+ else
+ papp->add_module(*i);
+ }
+ //
    // run the application object:
    //
    return papp->run();


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