1 --- mongodb-src-r2.0.6/pch.h~ 2012-06-04 15:42:54.000000000 +0200
2 +++ mongodb-src-r2.0.6/pch.h 2012-07-11 14:32:55.482057987 +0200
4 //#include <boost/any.hpp>
5 #include "boost/thread/once.hpp"
6 //#include <boost/archive/iterators/transform_width.hpp>
7 -#define BOOST_FILESYSTEM_VERSION 2
8 +#define BOOST_FILESYSTEM_VERSION 3
9 #include <boost/filesystem/convenience.hpp>
10 #include <boost/filesystem/exception.hpp>
11 #include <boost/filesystem/operations.hpp>
12 Binary files mongodb-src-r2.0.6.orig/lib/libboost_thread-gcc41-mt-d-1_34_1.a and mongodb-src-r2.0.6/lib/libboost_thread-gcc41-mt-d-1_34_1.a differ
13 diff -ur mongodb-src-r2.0.6.orig/util/background.cpp mongodb-src-r2.0.6/util/background.cpp
14 --- mongodb-src-r2.0.6.orig/util/background.cpp 2012-06-04 15:42:54.000000000 +0200
15 +++ mongodb-src-r2.0.6/util/background.cpp 2012-07-11 14:35:09.392053263 +0200
18 // add msTimeOut millisecond to current time
20 - boost::xtime_get( &xt, boost::TIME_UTC );
21 + boost::xtime_get( &xt, boost::TIME_UTC_ );
23 unsigned long long ns = msTimeOut * 1000000ULL; // milli to nano
24 if ( xt.nsec + ns < 1000000000 ) {
25 diff -ur mongodb-src-r2.0.6.orig/util/concurrency/mutex.h mongodb-src-r2.0.6/util/concurrency/mutex.h
26 --- mongodb-src-r2.0.6.orig/util/concurrency/mutex.h 2012-06-04 15:42:54.000000000 +0200
27 +++ mongodb-src-r2.0.6/util/concurrency/mutex.h 2012-07-11 14:35:09.392053263 +0200
30 inline boost::xtime incxtimemillis( long long s ) {
32 - boost::xtime_get(&xt, boost::TIME_UTC);
33 + boost::xtime_get(&xt, boost::TIME_UTC_);
34 xt.sec += (int)( s / 1000 );
35 xt.nsec += (int)(( s % 1000 ) * 1000000);
36 if ( xt.nsec >= 1000000000 ) {
37 diff -ur mongodb-src-r2.0.6.orig/util/queue.h mongodb-src-r2.0.6/util/queue.h
38 --- mongodb-src-r2.0.6.orig/util/queue.h 2012-06-04 15:42:54.000000000 +0200
39 +++ mongodb-src-r2.0.6/util/queue.h 2012-07-11 14:35:09.392053263 +0200
44 - boost::xtime_get(&xt, boost::TIME_UTC);
45 + boost::xtime_get(&xt, boost::TIME_UTC_);
46 xt.sec += maxSecondsToWait;
48 scoped_lock l( _lock );
49 diff -ur mongodb-src-r2.0.6.orig/util/time_support.h mongodb-src-r2.0.6/util/time_support.h
50 --- mongodb-src-r2.0.6.orig/util/time_support.h 2012-06-04 15:42:54.000000000 +0200
51 +++ mongodb-src-r2.0.6/util/time_support.h 2012-07-11 14:35:09.392053263 +0200
56 - boost::xtime_get(&xt, boost::TIME_UTC);
57 + boost::xtime_get(&xt, boost::TIME_UTC_);
58 xt.sec += (int)( s / 1000000 );
59 xt.nsec += (int)(( s % 1000000 ) * 1000);
60 if ( xt.nsec >= 1000000000 ) {
62 #elif defined(__sunos__)
63 inline void sleepsecs(int s) {
65 - boost::xtime_get(&xt, boost::TIME_UTC);
66 + boost::xtime_get(&xt, boost::TIME_UTC_);
68 boost::thread::sleep(xt);
70 inline void sleepmillis(long long s) {
72 - boost::xtime_get(&xt, boost::TIME_UTC);
73 + boost::xtime_get(&xt, boost::TIME_UTC_);
74 xt.sec += (int)( s / 1000 );
75 xt.nsec += (int)(( s % 1000 ) * 1000000);
76 if ( xt.nsec >= 1000000000 ) {
81 - boost::xtime_get(&xt, boost::TIME_UTC);
82 + boost::xtime_get(&xt, boost::TIME_UTC_);
83 xt.sec += (int)( s / 1000000 );
84 xt.nsec += (int)(( s % 1000000 ) * 1000);
85 if ( xt.nsec >= 1000000000 ) {
87 #ifdef _WIN32 // no gettimeofday on windows
88 inline unsigned long long curTimeMillis64() {
90 - boost::xtime_get(&xt, boost::TIME_UTC);
91 + boost::xtime_get(&xt, boost::TIME_UTC_);
92 return ((unsigned long long)xt.sec) * 1000 + xt.nsec / 1000000;
94 inline Date_t jsTime() {
96 - boost::xtime_get(&xt, boost::TIME_UTC);
97 + boost::xtime_get(&xt, boost::TIME_UTC_);
98 unsigned long long t = xt.nsec / 1000000;
99 return ((unsigned long long) xt.sec * 1000) + t + getJSTimeVirtualSkew() + getJSTimeVirtualThreadSkew();
101 inline unsigned long long curTimeMicros64() {
103 - boost::xtime_get(&xt, boost::TIME_UTC);
104 + boost::xtime_get(&xt, boost::TIME_UTC_);
105 unsigned long long t = xt.nsec / 1000;
106 return (((unsigned long long) xt.sec) * 1000000) + t;
108 inline unsigned curTimeMicros() {
110 - boost::xtime_get(&xt, boost::TIME_UTC);
111 + boost::xtime_get(&xt, boost::TIME_UTC_);
112 unsigned t = xt.nsec / 1000;
113 unsigned secs = xt.sec % 1024;
114 return secs*1000000 + t;
115 diff -ur mongodb-src-r2.0.6.orig/db/db.cpp mongodb-src-r2.0.6/db/db.cpp
116 --- mongodb-src-r2.0.6.orig/db/db.cpp 2012-06-04 15:42:54.000000000 +0200
117 +++ mongodb-src-r2.0.6/db/db.cpp 2012-07-11 14:39:15.945377899 +0200
119 boost::filesystem::path path( dbpath );
120 for ( boost::filesystem::directory_iterator i( path );
121 i != boost::filesystem::directory_iterator(); ++i ) {
122 - string fileName = boost::filesystem::path(*i).leaf();
123 + string fileName = boost::filesystem::path(*i).filename().string();
124 if ( boost::filesystem::is_directory( *i ) &&
125 fileName.length() && fileName[ 0 ] == '$' )
126 boost::filesystem::remove_all( *i );
127 @@ -655,11 +655,13 @@
128 dbExecCommand = argv[0];
130 srand(curTimeMicros());
131 +#if( BOOST_VERSION < 105000 )
132 #if( BOOST_VERSION >= 104500 )
133 boost::filesystem::path::default_name_check( boost::filesystem2::no_check );
135 boost::filesystem::path::default_name_check( boost::filesystem::no_check );
140 unsigned x = 0x12345678;
142 if (params.count("shutdown")){
145 - string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).native_file_string();
146 + string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).native();
147 if ( !boost::filesystem::exists( name ) || boost::filesystem::file_size( name ) == 0 )
150 diff -ur mongodb-src-r2.0.6.orig/db/dur.cpp mongodb-src-r2.0.6/db/dur.cpp
151 --- mongodb-src-r2.0.6.orig/db/dur.cpp 2012-06-04 15:42:54.000000000 +0200
152 +++ mongodb-src-r2.0.6/db/dur.cpp 2012-07-11 14:38:50.248712139 +0200
155 bool samePartition = true;
157 - const string dbpathDir = boost::filesystem::path(dbpath).native_directory_string();
158 + const string dbpathDir = boost::filesystem::path(dbpath).native();
159 samePartition = onSamePartition(getJournalDir().string(), dbpathDir);
162 diff -ur mongodb-src-r2.0.6.orig/db/instance.cpp mongodb-src-r2.0.6/db/instance.cpp
163 --- mongodb-src-r2.0.6.orig/db/instance.cpp 2012-06-04 15:42:54.000000000 +0200
164 +++ mongodb-src-r2.0.6/db/instance.cpp 2012-07-11 14:39:15.948711232 +0200
168 void acquirePathLock(bool doingRepair) {
169 - string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).native_file_string();
170 + string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).native();
172 bool oldFile = false;
174 diff -ur mongodb-src-r2.0.6.orig/db/pdfile.cpp mongodb-src-r2.0.6/db/pdfile.cpp
175 --- mongodb-src-r2.0.6.orig/db/pdfile.cpp 2012-06-04 15:42:54.000000000 +0200
176 +++ mongodb-src-r2.0.6/db/pdfile.cpp 2012-07-11 14:38:50.252045472 +0200
177 @@ -2093,7 +2093,7 @@
178 uniqueReservedPath( ( preserveClonedFilesOnFailure || backupOriginalFiles ) ?
180 BOOST_CHECK_EXCEPTION( boost::filesystem::create_directory( reservedPath ) );
181 - string reservedPathString = reservedPath.native_directory_string();
182 + string reservedPathString = reservedPath.native();
186 diff -ur mongodb-src-r2.0.6.orig/dbtests/framework.cpp mongodb-src-r2.0.6/dbtests/framework.cpp
187 --- mongodb-src-r2.0.6.orig/dbtests/framework.cpp 2012-06-04 15:42:54.000000000 +0200
188 +++ mongodb-src-r2.0.6/dbtests/framework.cpp 2012-07-11 14:38:50.252045472 +0200
190 boost::filesystem::create_directory(p);
193 - string dbpathString = p.native_directory_string();
194 + string dbpathString = p.native();
195 dbpath = dbpathString.c_str();
197 cmdLine.prealloc = false;
198 diff -ur mongodb-src-r2.0.6.orig/shell/shell_utils.cpp mongodb-src-r2.0.6/shell/shell_utils.cpp
199 --- mongodb-src-r2.0.6.orig/shell/shell_utils.cpp 2012-06-04 15:42:54.000000000 +0200
200 +++ mongodb-src-r2.0.6/shell/shell_utils.cpp 2012-07-11 14:39:15.948711232 +0200
205 - argv_.push_back( programPath.native_file_string() );
206 + argv_.push_back( programPath.native() );
210 --- mongodb-src-r2.0.6/db/dur_journal.cpp~ 2012-06-04 15:42:54.000000000 +0200
211 +++ mongodb-src-r2.0.6/db/dur_journal.cpp 2012-07-11 14:43:04.345369843 +0200
213 for ( boost::filesystem::directory_iterator i( getJournalDir() );
214 i != boost::filesystem::directory_iterator();
216 - string fileName = boost::filesystem::path(*i).leaf();
217 + string fileName = boost::filesystem::path(*i).filename().string();
218 if( str::startsWith(fileName, "j._") )
222 for ( boost::filesystem::directory_iterator i( getJournalDir() );
223 i != boost::filesystem::directory_iterator();
225 - string fileName = boost::filesystem::path(*i).leaf();
226 + string fileName = boost::filesystem::path(*i).filename().string();
227 if( str::startsWith(fileName, "j._") ) {
229 removeOldJournalFile(*i);
230 --- mongodb-src-r2.0.6/db/dur_recover.cpp~ 2012-06-04 15:42:54.000000000 +0200
231 +++ mongodb-src-r2.0.6/db/dur_recover.cpp 2012-07-11 14:43:24.775369122 +0200
233 i != filesystem::directory_iterator();
235 filesystem::path filepath = *i;
236 - string fileName = filesystem::path(*i).leaf();
237 + string fileName = filesystem::path(*i).filename().string();
238 if( str::startsWith(fileName, "j._") ) {
239 unsigned u = str::toUnsigned( str::after(fileName, '_') );
242 if( i != m.begin() && m.count(i->first - 1) == 0 ) {
244 str::stream() << "unexpected file in journal directory " << dir.string()
245 - << " : " << filesystem::path(i->second).leaf() << " : can't find its preceeding file");
246 + << " : " << filesystem::path(i->second).filename().string() << " : can't find its preceeding file");
248 files.push_back(i->second);
250 --- mongodb-src-r2.0.6/db/instance.cpp~ 2012-07-11 14:39:59.022043046 +0200
251 +++ mongodb-src-r2.0.6/db/instance.cpp 2012-07-11 14:43:51.298701519 +0200
252 @@ -645,13 +645,13 @@
253 i != boost::filesystem::directory_iterator(); ++i ) {
254 if ( directoryperdb ) {
255 boost::filesystem::path p = *i;
256 - string dbName = p.leaf();
257 + string dbName = p.filename().string();
258 p /= ( dbName + ".ns" );
259 if ( MMF::exists( p ) )
260 names.push_back( dbName );
263 - string fileName = boost::filesystem::path(*i).leaf();
264 + string fileName = boost::filesystem::path(*i).filename().string();
265 if ( fileName.length() > 3 && fileName.substr( fileName.length() - 3, 3 ) == ".ns" )
266 names.push_back( fileName.substr( 0, fileName.length() - 3 ) );
268 --- mongodb-src-r2.0.6/db/pdfile.cpp~ 2012-07-11 14:39:59.022043046 +0200
269 +++ mongodb-src-r2.0.6/db/pdfile.cpp 2012-07-11 14:44:07.945367599 +0200
270 @@ -1987,7 +1987,7 @@
271 virtual bool apply( const Path &p ) {
272 if ( !boost::filesystem::exists( p ) )
274 - boostRenameWrapper( p, newPath_ / ( p.leaf() + ".bak" ) );
275 + boostRenameWrapper( p, newPath_ / ( p.filename().string() + ".bak" ) );
278 virtual const char * op() const {
279 @@ -2010,7 +2010,7 @@
280 virtual bool apply( const Path &p ) {
281 if ( !boost::filesystem::exists( p ) )
283 - boostRenameWrapper( p, newPath_ / p.leaf() );
284 + boostRenameWrapper( p, newPath_ / p.filename().string() );
287 virtual const char * op() const {
288 --- mongodb-src-r2.0.6/tools/tool.cpp~ 2012-06-04 15:42:54.000000000 +0200
289 +++ mongodb-src-r2.0.6/tools/tool.cpp 2012-07-11 14:51:25.822018820 +0200
290 @@ -113,11 +113,13 @@
291 // we want durability to be disabled.
294 +#if( BOOST_VERSION < 105000 )
295 #if( BOOST_VERSION >= 104500 )
296 boost::filesystem::path::default_name_check( boost::filesystem2::no_check );
298 boost::filesystem::path::default_name_check( boost::filesystem::no_check );
304 --- mongodb-src-r2.0.6/tools/restore.cpp~ 2012-06-04 15:42:54.000000000 +0200
305 +++ mongodb-src-r2.0.6/tools/restore.cpp 2012-07-11 14:53:11.865348411 +0200
307 log(2) << "drillDown: " << root.string() << endl;
309 // skip hidden files and directories
310 - if (root.leaf()[0] == '.' && root.leaf() != ".")
311 + if (root.filename().string()[0] == '.' && root.filename().string() != ".")
314 if ( is_directory( root ) ) {
315 @@ -161,10 +161,10 @@
318 // don't insert oplog
319 - if (top_level && !use_db && p.leaf() == "oplog.bson")
320 + if (top_level && !use_db && p.filename().string() == "oplog.bson")
323 - if ( p.leaf() == "system.indexes.bson" )
324 + if ( p.filename().string() == "system.indexes.bson" )
327 drillDown(p, use_db, use_coll);
330 log() << root.string() << endl;
332 - if ( root.leaf() == "system.profile.bson" ) {
333 + if ( root.filename().string() == "system.profile.bson" ) {
334 log() << "\t skipping" << endl;
341 - string l = root.leaf();
342 + string l = root.filename().string();
343 l = l.substr( 0 , l.find_last_of( "." ) );
347 out() << "\t going into namespace [" << ns << "]" << endl;
350 - if (root.leaf() != "system.users.bson" ) {
351 + if (root.filename().string() != "system.users.bson" ) {
352 out() << "\t dropping" << endl;
353 conn().dropCollection( ns );
357 _curdb = NamespaceString(_curns).db;
359 - if (_drop && root.leaf() == "system.users.bson") {
360 + if (_drop && root.filename().string() == "system.users.bson") {
361 // Delete any users that used to exist but weren't in the dump file
362 for (set<string>::iterator it = _users.begin(); it != _users.end(); ++it) {
363 BSONObj userMatch = BSON("user" << *it);