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
118 @@ -655,11 +655,13 @@
119 dbExecCommand = argv[0];
121 srand(curTimeMicros());
122 +#if( BOOST_VERSION < 105000 )
123 #if( BOOST_VERSION >= 104500 )
124 boost::filesystem::path::default_name_check( boost::filesystem2::no_check );
126 boost::filesystem::path::default_name_check( boost::filesystem::no_check );
131 unsigned x = 0x12345678;
133 if (params.count("shutdown")){
136 - string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).native_file_string();
137 + string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).native();
138 if ( !boost::filesystem::exists( name ) || boost::filesystem::file_size( name ) == 0 )
141 diff -ur mongodb-src-r2.0.6.orig/db/dur.cpp mongodb-src-r2.0.6/db/dur.cpp
142 --- mongodb-src-r2.0.6.orig/db/dur.cpp 2012-06-04 15:42:54.000000000 +0200
143 +++ mongodb-src-r2.0.6/db/dur.cpp 2012-07-11 14:38:50.248712139 +0200
146 bool samePartition = true;
148 - const string dbpathDir = boost::filesystem::path(dbpath).native_directory_string();
149 + const string dbpathDir = boost::filesystem::path(dbpath).native();
150 samePartition = onSamePartition(getJournalDir().string(), dbpathDir);
153 diff -ur mongodb-src-r2.0.6.orig/db/instance.cpp mongodb-src-r2.0.6/db/instance.cpp
154 --- mongodb-src-r2.0.6.orig/db/instance.cpp 2012-06-04 15:42:54.000000000 +0200
155 +++ mongodb-src-r2.0.6/db/instance.cpp 2012-07-11 14:39:15.948711232 +0200
159 void acquirePathLock(bool doingRepair) {
160 - string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).native_file_string();
161 + string name = ( boost::filesystem::path( dbpath ) / "mongod.lock" ).native();
163 bool oldFile = false;
165 diff -ur mongodb-src-r2.0.6.orig/db/pdfile.cpp mongodb-src-r2.0.6/db/pdfile.cpp
166 --- mongodb-src-r2.0.6.orig/db/pdfile.cpp 2012-06-04 15:42:54.000000000 +0200
167 +++ mongodb-src-r2.0.6/db/pdfile.cpp 2012-07-11 14:38:50.252045472 +0200
168 @@ -2093,7 +2093,7 @@
169 uniqueReservedPath( ( preserveClonedFilesOnFailure || backupOriginalFiles ) ?
171 BOOST_CHECK_EXCEPTION( boost::filesystem::create_directory( reservedPath ) );
172 - string reservedPathString = reservedPath.native_directory_string();
173 + string reservedPathString = reservedPath.native();
177 diff -ur mongodb-src-r2.0.6.orig/dbtests/framework.cpp mongodb-src-r2.0.6/dbtests/framework.cpp
178 --- mongodb-src-r2.0.6.orig/dbtests/framework.cpp 2012-06-04 15:42:54.000000000 +0200
179 +++ mongodb-src-r2.0.6/dbtests/framework.cpp 2012-07-11 14:38:50.252045472 +0200
181 boost::filesystem::create_directory(p);
184 - string dbpathString = p.native_directory_string();
185 + string dbpathString = p.native();
186 dbpath = dbpathString.c_str();
188 cmdLine.prealloc = false;
189 diff -ur mongodb-src-r2.0.6.orig/shell/shell_utils.cpp mongodb-src-r2.0.6/shell/shell_utils.cpp
190 --- mongodb-src-r2.0.6.orig/shell/shell_utils.cpp 2012-06-04 15:42:54.000000000 +0200
191 +++ mongodb-src-r2.0.6/shell/shell_utils.cpp 2012-07-11 14:39:15.948711232 +0200
196 - argv_.push_back( programPath.native_file_string() );
197 + argv_.push_back( programPath.native() );
201 --- mongodb-src-r2.0.6/db/dur_journal.cpp~ 2012-06-04 15:42:54.000000000 +0200
202 +++ mongodb-src-r2.0.6/db/dur_journal.cpp 2012-07-11 14:43:04.345369843 +0200
204 for ( boost::filesystem::directory_iterator i( getJournalDir() );
205 i != boost::filesystem::directory_iterator();
207 - string fileName = boost::filesystem::path(*i).leaf();
208 + string fileName = boost::filesystem::path(*i).filename().string();
209 if( str::startsWith(fileName, "j._") )
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._") ) {
220 removeOldJournalFile(*i);
221 --- mongodb-src-r2.0.6/db/dur_recover.cpp~ 2012-06-04 15:42:54.000000000 +0200
222 +++ mongodb-src-r2.0.6/db/dur_recover.cpp 2012-07-11 14:43:24.775369122 +0200
224 i != filesystem::directory_iterator();
226 filesystem::path filepath = *i;
227 - string fileName = filesystem::path(*i).leaf();
228 + string fileName = filesystem::path(*i).filename().string();
229 if( str::startsWith(fileName, "j._") ) {
230 unsigned u = str::toUnsigned( str::after(fileName, '_') );
233 if( i != m.begin() && m.count(i->first - 1) == 0 ) {
235 str::stream() << "unexpected file in journal directory " << dir.string()
236 - << " : " << filesystem::path(i->second).leaf() << " : can't find its preceeding file");
237 + << " : " << filesystem::path(i->second).filename().string() << " : can't find its preceeding file");
239 files.push_back(i->second);
241 --- mongodb-src-r2.0.6/db/instance.cpp~ 2012-07-11 14:39:59.022043046 +0200
242 +++ mongodb-src-r2.0.6/db/instance.cpp 2012-07-11 14:43:51.298701519 +0200
243 @@ -645,13 +645,13 @@
244 i != boost::filesystem::directory_iterator(); ++i ) {
245 if ( directoryperdb ) {
246 boost::filesystem::path p = *i;
247 - string dbName = p.leaf();
248 + string dbName = p.filename().string();
249 p /= ( dbName + ".ns" );
250 if ( MMF::exists( p ) )
251 names.push_back( dbName );
254 - string fileName = boost::filesystem::path(*i).leaf();
255 + string fileName = boost::filesystem::path(*i).filename().string();
256 if ( fileName.length() > 3 && fileName.substr( fileName.length() - 3, 3 ) == ".ns" )
257 names.push_back( fileName.substr( 0, fileName.length() - 3 ) );
259 --- mongodb-src-r2.0.6/db/pdfile.cpp~ 2012-07-11 14:39:59.022043046 +0200
260 +++ mongodb-src-r2.0.6/db/pdfile.cpp 2012-07-11 14:44:07.945367599 +0200
261 @@ -1987,7 +1987,7 @@
262 virtual bool apply( const Path &p ) {
263 if ( !boost::filesystem::exists( p ) )
265 - boostRenameWrapper( p, newPath_ / ( p.leaf() + ".bak" ) );
266 + boostRenameWrapper( p, newPath_ / ( p.filename().string() + ".bak" ) );
269 virtual const char * op() const {
270 @@ -2010,7 +2010,7 @@
271 virtual bool apply( const Path &p ) {
272 if ( !boost::filesystem::exists( p ) )
274 - boostRenameWrapper( p, newPath_ / p.leaf() );
275 + boostRenameWrapper( p, newPath_ / p.filename().string() );
278 virtual const char * op() const {
279 --- mongodb-src-r2.0.6/tools/tool.cpp~ 2012-06-04 15:42:54.000000000 +0200
280 +++ mongodb-src-r2.0.6/tools/tool.cpp 2012-07-11 14:51:25.822018820 +0200
281 @@ -113,11 +113,13 @@
282 // we want durability to be disabled.
285 +#if( BOOST_VERSION < 105000 )
286 #if( BOOST_VERSION >= 104500 )
287 boost::filesystem::path::default_name_check( boost::filesystem2::no_check );
289 boost::filesystem::path::default_name_check( boost::filesystem::no_check );
295 --- mongodb-src-r2.0.6/tools/restore.cpp~ 2012-06-04 15:42:54.000000000 +0200
296 +++ mongodb-src-r2.0.6/tools/restore.cpp 2012-07-11 14:53:11.865348411 +0200
298 log(2) << "drillDown: " << root.string() << endl;
300 // skip hidden files and directories
301 - if (root.leaf()[0] == '.' && root.leaf() != ".")
302 + if (root.filename().string()[0] == '.' && root.filename().string() != ".")
305 if ( is_directory( root ) ) {
306 @@ -161,10 +161,10 @@
309 // don't insert oplog
310 - if (top_level && !use_db && p.leaf() == "oplog.bson")
311 + if (top_level && !use_db && p.filename().string() == "oplog.bson")
314 - if ( p.leaf() == "system.indexes.bson" )
315 + if ( p.filename().string() == "system.indexes.bson" )
318 drillDown(p, use_db, use_coll);
321 log() << root.string() << endl;
323 - if ( root.leaf() == "system.profile.bson" ) {
324 + if ( root.filename().string() == "system.profile.bson" ) {
325 log() << "\t skipping" << endl;
332 - string l = root.leaf();
333 + string l = root.filename().string();
334 l = l.substr( 0 , l.find_last_of( "." ) );
338 out() << "\t going into namespace [" << ns << "]" << endl;
341 - if (root.leaf() != "system.users.bson" ) {
342 + if (root.filename().string() != "system.users.bson" ) {
343 out() << "\t dropping" << endl;
344 conn().dropCollection( ns );
348 _curdb = NamespaceString(_curns).db;
350 - if (_drop && root.leaf() == "system.users.bson") {
351 + if (_drop && root.filename().string() == "system.users.bson") {
352 // Delete any users that used to exist but weren't in the dump file
353 for (set<string>::iterator it = _users.begin(); it != _users.end(); ++it) {
354 BSONObj userMatch = BSON("user" << *it);