1 diff -dur mongodb-src-r2.2.0.orig/src/mongo/db/db.cpp mongodb-src-r2.2.0/src/mongo/db/db.cpp
2 --- mongodb-src-r2.2.0.orig/src/mongo/db/db.cpp 2012-08-28 07:28:11.000000000 +0200
3 +++ mongodb-src-r2.2.0/src/mongo/db/db.cpp 2012-09-28 13:37:59.000000000 +0200
5 boost::filesystem::path path( dbpath );
6 for ( boost::filesystem::directory_iterator i( path );
7 i != boost::filesystem::directory_iterator(); ++i ) {
8 - string fileName = boost::filesystem::path(*i).leaf();
9 + string fileName = boost::filesystem::path(*i).filename().string();
10 if ( boost::filesystem::is_directory( *i ) &&
11 fileName.length() && fileName[ 0 ] == '$' )
12 boost::filesystem::remove_all( *i );
14 dbExecCommand = argv[0];
16 srand(curTimeMicros());
17 +#if( BOOST_VERSION < 105000 )
18 #if( BOOST_VERSION >= 104500 )
19 boost::filesystem::path::default_name_check( boost::filesystem2::no_check );
21 boost::filesystem::path::default_name_check( boost::filesystem::no_check );
26 unsigned x = 0x12345678;
28 if (params.count("shutdown")){
31 - string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).native_file_string();
32 + string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).native();
33 if ( !boost::filesystem::exists( name ) || boost::filesystem::file_size( name ) == 0 )
36 diff -dur mongodb-src-r2.2.0.orig/src/mongo/db/dur.cpp mongodb-src-r2.2.0/src/mongo/db/dur.cpp
37 --- mongodb-src-r2.2.0.orig/src/mongo/db/dur.cpp 2012-08-28 07:28:11.000000000 +0200
38 +++ mongodb-src-r2.2.0/src/mongo/db/dur.cpp 2012-09-28 13:37:59.000000000 +0200
41 bool samePartition = true;
43 - const string dbpathDir = boost::filesystem::path(dbpath).native_directory_string();
44 + const string dbpathDir = boost::filesystem::path(dbpath).native();
45 samePartition = onSamePartition(getJournalDir().string(), dbpathDir);
48 diff -dur mongodb-src-r2.2.0.orig/src/mongo/db/dur_journal.cpp mongodb-src-r2.2.0/src/mongo/db/dur_journal.cpp
49 --- mongodb-src-r2.2.0.orig/src/mongo/db/dur_journal.cpp 2012-08-28 07:28:11.000000000 +0200
50 +++ mongodb-src-r2.2.0/src/mongo/db/dur_journal.cpp 2012-09-28 13:42:45.000000000 +0200
52 for ( boost::filesystem::directory_iterator i( getJournalDir() );
53 i != boost::filesystem::directory_iterator();
55 - string fileName = boost::filesystem::path(*i).leaf();
56 + string fileName = boost::filesystem::path(*i).filename().string();
57 if( anyFiles || str::startsWith(fileName, "j._") )
61 for ( boost::filesystem::directory_iterator i( getJournalDir() );
62 i != boost::filesystem::directory_iterator();
64 - string fileName = boost::filesystem::path(*i).leaf();
65 + string fileName = boost::filesystem::path(*i).filename().string();
66 if( str::startsWith(fileName, "j._") ) {
68 removeOldJournalFile(*i);
69 diff -dur mongodb-src-r2.2.0.orig/src/mongo/db/dur_recover.cpp mongodb-src-r2.2.0/src/mongo/db/dur_recover.cpp
70 --- mongodb-src-r2.2.0.orig/src/mongo/db/dur_recover.cpp 2012-08-28 07:28:11.000000000 +0200
71 +++ mongodb-src-r2.2.0/src/mongo/db/dur_recover.cpp 2012-09-28 13:43:01.000000000 +0200
73 i != boost::filesystem::directory_iterator();
75 boost::filesystem::path filepath = *i;
76 - string fileName = boost::filesystem::path(*i).leaf();
77 + string fileName = boost::filesystem::path(*i).filename().string();
78 if( str::startsWith(fileName, "j._") ) {
79 unsigned u = str::toUnsigned( str::after(fileName, '_') );
82 if( i != m.begin() && m.count(i->first - 1) == 0 ) {
84 str::stream() << "unexpected file in journal directory " << dir.string()
85 - << " : " << boost::filesystem::path(i->second).leaf() << " : can't find its preceeding file");
86 + << " : " << boost::filesystem::path(i->second).filename().string() << " : can't find its preceeding file");
88 files.push_back(i->second);
90 diff -dur mongodb-src-r2.2.0.orig/src/mongo/db/instance.cpp mongodb-src-r2.2.0/src/mongo/db/instance.cpp
91 --- mongodb-src-r2.2.0.orig/src/mongo/db/instance.cpp 2012-08-28 07:28:11.000000000 +0200
92 +++ mongodb-src-r2.2.0/src/mongo/db/instance.cpp 2012-09-28 13:43:18.000000000 +0200
94 i != boost::filesystem::directory_iterator(); ++i ) {
95 if ( directoryperdb ) {
96 boost::filesystem::path p = *i;
97 - string dbName = p.leaf();
98 + string dbName = p.filename().string();
99 p /= ( dbName + ".ns" );
101 names.push_back( dbName );
104 - string fileName = boost::filesystem::path(*i).leaf();
105 + string fileName = boost::filesystem::path(*i).filename().string();
106 if ( fileName.length() > 3 && fileName.substr( fileName.length() - 3, 3 ) == ".ns" )
107 names.push_back( fileName.substr( 0, fileName.length() - 3 ) );
109 @@ -1102,7 +1102,7 @@
112 void acquirePathLock(bool doingRepair) {
113 - string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).native_file_string();
114 + string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).native();
116 bool oldFile = false;
118 diff -dur mongodb-src-r2.2.0.orig/src/mongo/db/pdfile.cpp mongodb-src-r2.2.0/src/mongo/db/pdfile.cpp
119 --- mongodb-src-r2.2.0.orig/src/mongo/db/pdfile.cpp 2012-08-28 07:28:11.000000000 +0200
120 +++ mongodb-src-r2.2.0/src/mongo/db/pdfile.cpp 2012-09-28 13:43:42.000000000 +0200
121 @@ -1675,7 +1675,7 @@
122 virtual bool apply( const Path &p ) {
123 if ( !boost::filesystem::exists( p ) )
125 - boostRenameWrapper( p, newPath_ / ( p.leaf() + ".bak" ) );
126 + boostRenameWrapper( p, newPath_ / ( p.filename().string() + ".bak" ) );
129 virtual const char * op() const {
130 @@ -1698,7 +1698,7 @@
131 virtual bool apply( const Path &p ) {
132 if ( !boost::filesystem::exists( p ) )
134 - boostRenameWrapper( p, newPath_ / p.leaf() );
135 + boostRenameWrapper( p, newPath_ / p.filename().string() );
138 virtual const char * op() const {
139 @@ -1783,7 +1783,7 @@
140 uniqueReservedPath( ( preserveClonedFilesOnFailure || backupOriginalFiles ) ?
142 MONGO_ASSERT_ON_EXCEPTION( boost::filesystem::create_directory( reservedPath ) );
143 - string reservedPathString = reservedPath.native_directory_string();
144 + string reservedPathString = reservedPath.native();
148 diff -dur mongodb-src-r2.2.0.orig/src/mongo/dbtests/framework.cpp mongodb-src-r2.2.0/src/mongo/dbtests/framework.cpp
149 --- mongodb-src-r2.2.0.orig/src/mongo/dbtests/framework.cpp 2012-08-28 07:28:11.000000000 +0200
150 +++ mongodb-src-r2.2.0/src/mongo/dbtests/framework.cpp 2012-09-28 13:37:59.000000000 +0200
152 boost::filesystem::create_directory(p);
155 - string dbpathString = p.native_directory_string();
156 + string dbpathString = p.native();
157 dbpath = dbpathString.c_str();
159 cmdLine.prealloc = false;
160 Only in mongodb-src-r2.2.0/src/mongo/dbtests: framework.cpp.orig
161 diff -dur mongodb-src-r2.2.0.orig/src/mongo/pch.h mongodb-src-r2.2.0/src/mongo/pch.h
162 --- mongodb-src-r2.2.0.orig/src/mongo/pch.h 2012-08-28 07:28:11.000000000 +0200
163 +++ mongodb-src-r2.2.0/src/mongo/pch.h 2012-09-28 13:38:28.000000000 +0200
168 -#define BOOST_FILESYSTEM_VERSION 2
169 +#define BOOST_FILESYSTEM_VERSION 3
170 #include <boost/shared_ptr.hpp>
171 #include <boost/smart_ptr.hpp>
172 #include <boost/function.hpp>
173 diff -dur mongodb-src-r2.2.0.orig/src/mongo/shell/shell_utils_launcher.cpp mongodb-src-r2.2.0/src/mongo/shell/shell_utils_launcher.cpp
174 --- mongodb-src-r2.2.0.orig/src/mongo/shell/shell_utils_launcher.cpp 2012-08-28 07:28:11.000000000 +0200
175 +++ mongodb-src-r2.2.0/src/mongo/shell/shell_utils_launcher.cpp 2012-09-28 13:39:57.000000000 +0200
180 - _argv.push_back( programPath.native_file_string() );
181 + _argv.push_back( programPath.native() );
185 Only in mongodb-src-r2.2.0/src/mongo/shell: shell_utils_launcher.cpp~
186 diff -dur mongodb-src-r2.2.0.orig/src/mongo/tools/restore.cpp mongodb-src-r2.2.0/src/mongo/tools/restore.cpp
187 --- mongodb-src-r2.2.0.orig/src/mongo/tools/restore.cpp 2012-08-28 07:28:11.000000000 +0200
188 +++ mongodb-src-r2.2.0/src/mongo/tools/restore.cpp 2012-09-28 13:41:57.000000000 +0200
190 log(2) << "drillDown: " << root.string() << endl;
192 // skip hidden files and directories
193 - if (root.leaf()[0] == '.' && root.leaf() != ".")
194 + if (root.filename().string()[0] == '.' && root.filename().string() != ".")
197 if ( is_directory( root ) ) {
198 @@ -204,10 +204,10 @@
201 // don't insert oplog
202 - if (top_level && !use_db && p.leaf() == "oplog.bson")
203 + if (top_level && !use_db && p.filename().string() == "oplog.bson")
206 - if ( p.leaf() == "system.indexes.bson" ) {
207 + if ( p.filename().string() == "system.indexes.bson" ) {
210 drillDown(p, use_db, use_coll);
213 log() << root.string() << endl;
215 - if ( root.leaf() == "system.profile.bson" ) {
216 + if ( root.filename().string() == "system.profile.bson" ) {
217 log() << "\t skipping" << endl;
224 - string oldCollName = root.leaf(); // Name of the collection that was dumped from
225 + string oldCollName = root.filename().string(); // Name of the collection that was dumped from
226 oldCollName = oldCollName.substr( 0 , oldCollName.find_last_of( "." ) );
230 log() << "\tgoing into namespace [" << ns << "]" << endl;
233 - if (root.leaf() != "system.users.bson" ) {
234 + if (root.filename().string() != "system.users.bson" ) {
235 log() << "\t dropping" << endl;
236 conn().dropCollection( ns );
239 if (!boost::filesystem::exists(metadataFile.string())) {
240 // This is fine because dumps from before 2.1 won't have a metadata file, just print a warning.
241 // System collections shouldn't have metadata so don't warn if that file is missing.
242 - if (!startsWith(metadataFile.leaf(), "system.")) {
243 + if (!startsWith(metadataFile.filename().string(), "system.")) {
244 log() << metadataFile.string() << " not found. Skipping." << endl;
251 - if (_drop && root.leaf() == "system.users.bson") {
252 + if (_drop && root.filename().string() == "system.users.bson") {
253 // Delete any users that used to exist but weren't in the dump file
254 for (set<string>::iterator it = _users.begin(); it != _users.end(); ++it) {
255 BSONObj userMatch = BSON("user" << *it);
256 diff -dur mongodb-src-r2.2.0.orig/src/mongo/tools/tool.cpp mongodb-src-r2.2.0/src/mongo/tools/tool.cpp
257 --- mongodb-src-r2.2.0.orig/src/mongo/tools/tool.cpp 2012-08-28 07:28:11.000000000 +0200
258 +++ mongodb-src-r2.2.0/src/mongo/tools/tool.cpp 2012-09-28 13:37:59.000000000 +0200
259 @@ -118,11 +118,13 @@
260 // we want durability to be disabled.
263 +#if( BOOST_VERSION < 105000 )
264 #if( BOOST_VERSION >= 104500 )
265 boost::filesystem::path::default_name_check( boost::filesystem2::no_check );
267 boost::filesystem::path::default_name_check( boost::filesystem::no_check );