Skip to content

Commit

Permalink
Upgrade inspect for Filesystem V3
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.boost.org/svn/boost/trunk@67493 b8fc166d-592f-0410-95f2-cb63ce0dd405
  • Loading branch information
bemandawes committed Dec 29, 2010
1 parent facebef commit 23ea5f1
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tools/inspect/apple_macro_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace boost

// Only check files in the boost directory, as we can avoid including the
// apple test headers elsewhere.
path relative( relative_to( full_path, fs::initial_path() ), fs::no_check );
path relative( relative_to( full_path, fs::initial_path() ) );
if ( relative.empty() || *relative.begin() != "boost") return;

boost::sregex_iterator cur(contents.begin(), contents.end(), apple_macro_regex), end;
Expand Down
2 changes: 1 addition & 1 deletion tools/inspect/assert_macro_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace boost
// Check files iff (a) they are in the boost directory, or (b) they
// are in the src directory under libs.
if (m_from_boost_root) {
path relative( relative_to( full_path, fs::initial_path() ), fs::no_check );
path relative( relative_to( full_path, fs::initial_path() ) );
path::const_iterator pbeg = relative.begin(), pend = relative.end();
if (pbeg != std::find(pbeg, pend, "boost") &&
!(pbeg == std::find(pbeg, pend, "libs") && pend != std::find(pbeg, pend, "src")))
Expand Down
15 changes: 13 additions & 2 deletions tools/inspect/build/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,19 @@ project

exe inspect
:
inspect.cpp license_check.cpp link_check.cpp path_name_check.cpp tab_check.cpp crlf_check.cpp end_check.cpp unnamed_namespace_check.cpp ascii_check.cpp
copyright_check.cpp minmax_check.cpp apple_macro_check.cpp assert_macro_check.cpp
apple_macro_check.cpp
ascii_check.cpp
assert_macro_check.cpp
copyright_check.cpp
crlf_check.cpp
end_check.cpp
inspect.cpp
license_check.cpp
link_check.cpp
minmax_check.cpp
path_name_check.cpp
tab_check.cpp
unnamed_namespace_check.cpp
/boost//filesystem/<link>static
/boost//regex/<link>static
:
Expand Down
2 changes: 1 addition & 1 deletion tools/inspect/cvs_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace hack
} while ( contents == "D" );
if ( contents[0] == 'D' ) contents.erase( 0, 1 );
value_path = dir_path
/ boost::filesystem::path( contents.substr( 1, contents.find( '/', 1 ) ), boost::filesystem::no_check );
/ boost::filesystem::path( contents.substr( 1, contents.find( '/', 1 ) ) );

// in case entries file is mistaken, do until value_path actually found
} while ( !boost::filesystem::exists( value_path ) );
Expand Down
11 changes: 5 additions & 6 deletions tools/inspect/inspect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ namespace
bool visit_predicate( const path & pth )
{
string local( boost::inspect::relative_to( pth, fs::initial_path() ) );
string leaf( pth.leaf() );
string leaf( pth.leaf().string() );
return
// so we can inspect a checkout
leaf != "CVS"
Expand Down Expand Up @@ -202,7 +202,7 @@ namespace
bool find_signature( const path & file_path,
const boost::inspect::string_set & signatures )
{
string name( file_path.leaf() );
string name( file_path.leaf().string() );
if ( signatures.find( name ) == signatures.end() )
{
string::size_type pos( name.rfind( '.' ) );
Expand Down Expand Up @@ -675,13 +675,12 @@ namespace boost
// may return an empty string [gps]
string impute_library( const path & full_dir_path )
{
path relative( relative_to( full_dir_path, fs::initial_path() ),
fs::no_check );
path relative( relative_to( full_dir_path, fs::initial_path() ) );
if ( relative.empty() ) return "boost-root";
string first( *relative.begin() );
string first( (*relative.begin()).string() );
string second = // borland 5.61 requires op=
++relative.begin() == relative.end()
? string() : *++relative.begin();
? string() : (*++relative.begin()).string();

if ( first == "boost" )
return second;
Expand Down
4 changes: 2 additions & 2 deletions tools/inspect/link_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ namespace boost
// url is relative source_path.branch()
// convert to target_path, which is_complete()
path target_path;
try { target_path = source_path.branch_path() /= path( decoded_path, fs::no_check ); }
try { target_path = source_path.branch_path() /= path( decoded_path ); }
catch ( const fs::filesystem_error & )
{
if(!no_link_errors) {
Expand Down Expand Up @@ -476,7 +476,7 @@ namespace boost
&& itr->first.rfind( "index.htm" ) == string::npos )
{
++m_unlinked_errors;
path full_path( fs::initial_path() / path(itr->first, fs::no_check) );
path full_path( fs::initial_path() / path(itr->first) );
error( impute_library( full_path ), full_path, "Unlinked file" );
}
}
Expand Down
2 changes: 1 addition & 1 deletion tools/inspect/path_name_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace boost
string::size_type pos;

// called for each file and directory, so only the leaf need be tested
string const leaf( full_path.leaf() );
string const leaf( full_path.leaf().string() );

// includes only allowable characters
if ( (pos = leaf.find_first_not_of( allowable )) != string::npos )
Expand Down

0 comments on commit 23ea5f1

Please sign in to comment.