This fixes the build with boost 1.87.0b1 and still builds with 1.84.
directory.hpp and exception.hpp are no longer implicitly included, so
add those and convenience.hpp no longer exists.

One instance of is_regular() is replaced by is_regular_file() following
the deprecation notice and path.leaf() is replaced by what it aliases,
path.filename(). 

All rather straightforward, but could use a set of eyes and a test
by someone who uses this.

Index: Makefile
===================================================================
RCS file: /cvs/ports/databases/mongodb/44/Makefile,v
diff -u -p -r1.20 Makefile
--- Makefile    6 Aug 2024 09:00:14 -0000       1.20
+++ Makefile    21 Nov 2024 10:35:34 -0000
@@ -1,7 +1,7 @@
 PORTROACH =    limitw:1,even
 
 V =            4.4.29
-REVISION =     2
+REVISION =     3
 
 WANTLIB += ${COMPILER_LIBCXX}
 WANTLIB += boost_filesystem-mt boost_iostreams-mt boost_log-mt
Index: patches/patch-src_mongo_db_initialize_server_global_state_cpp
===================================================================
RCS file: patches/patch-src_mongo_db_initialize_server_global_state_cpp
diff -N patches/patch-src_mongo_db_initialize_server_global_state_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_mongo_db_initialize_server_global_state_cpp       21 Nov 
2024 08:53:18 -0000
@@ -0,0 +1,20 @@
+Index: src/mongo/db/initialize_server_global_state.cpp
+--- src/mongo/db/initialize_server_global_state.cpp.orig
++++ src/mongo/db/initialize_server_global_state.cpp
+@@ -35,6 +35,7 @@
+ #include "mongo/db/initialize_server_global_state_gen.h"
+ 
+ #include <boost/filesystem/operations.hpp>
++#include <boost/filesystem/exception.hpp>
+ #include <fmt/format.h>
+ #include <iostream>
+ #include <memory>
+@@ -346,7 +347,7 @@ MONGO_INITIALIZER_GENERAL(ServerLogRedirection,
+                                             << "\" should name a file, not a 
directory.");
+             }
+ 
+-            if (!serverGlobalParams.logAppend && 
boost::filesystem::is_regular(absoluteLogpath)) {
++            if (!serverGlobalParams.logAppend && 
boost::filesystem::is_regular_file(absoluteLogpath)) {
+                 std::string renameTarget = absoluteLogpath + "." + 
terseCurrentTime(false);
+                 boost::system::error_code ec;
+                 boost::filesystem::rename(absoluteLogpath, renameTarget, ec);
Index: patches/patch-src_mongo_db_startup_warnings_mongod_cpp
===================================================================
RCS file: patches/patch-src_mongo_db_startup_warnings_mongod_cpp
diff -N patches/patch-src_mongo_db_startup_warnings_mongod_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_mongo_db_startup_warnings_mongod_cpp      21 Nov 2024 
08:42:25 -0000
@@ -0,0 +1,11 @@
+Index: src/mongo/db/startup_warnings_mongod.cpp
+--- src/mongo/db/startup_warnings_mongod.cpp.orig
++++ src/mongo/db/startup_warnings_mongod.cpp
+@@ -34,6 +34,7 @@
+ #include "mongo/db/startup_warnings_mongod.h"
+ 
+ #include <boost/filesystem/operations.hpp>
++#include <boost/filesystem/exception.hpp>
+ #include <fstream>
+ #ifndef _WIN32
+ #include <sys/resource.h>
Index: patches/patch-src_mongo_dbtests_framework_options_cpp
===================================================================
RCS file: patches/patch-src_mongo_dbtests_framework_options_cpp
diff -N patches/patch-src_mongo_dbtests_framework_options_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_mongo_dbtests_framework_options_cpp       21 Nov 2024 
08:42:25 -0000
@@ -0,0 +1,11 @@
+Index: src/mongo/dbtests/framework_options.cpp
+--- src/mongo/dbtests/framework_options.cpp.orig
++++ src/mongo/dbtests/framework_options.cpp
+@@ -35,6 +35,7 @@
+ #include "mongo/dbtests/framework_options.h"
+ 
+ #include <boost/filesystem/operations.hpp>
++#include <boost/filesystem/exception.hpp>
+ #include <iostream>
+ 
+ #include "mongo/base/status.h"
Index: patches/patch-src_mongo_scripting_engine_cpp
===================================================================
RCS file: patches/patch-src_mongo_scripting_engine_cpp
diff -N patches/patch-src_mongo_scripting_engine_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_mongo_scripting_engine_cpp        21 Nov 2024 09:12:57 
-0000
@@ -0,0 +1,11 @@
+Index: src/mongo/scripting/engine.cpp
+--- src/mongo/scripting/engine.cpp.orig
++++ src/mongo/scripting/engine.cpp
+@@ -33,6 +33,7 @@
+ 
+ #include "mongo/scripting/engine.h"
+ 
++#include <boost/filesystem/directory.hpp>
+ #include <boost/filesystem/operations.hpp>
+ #include <cctype>
+ 
Index: patches/patch-src_mongo_shell_shell_utils_extended_cpp
===================================================================
RCS file: 
/cvs/ports/databases/mongodb/44/patches/patch-src_mongo_shell_shell_utils_extended_cpp,v
diff -u -p -r1.1 patch-src_mongo_shell_shell_utils_extended_cpp
--- patches/patch-src_mongo_shell_shell_utils_extended_cpp      25 Jun 2022 
17:11:40 -0000      1.1
+++ patches/patch-src_mongo_shell_shell_utils_extended_cpp      21 Nov 2024 
08:42:25 -0000
@@ -3,10 +3,11 @@ Fix build with Boost 1.79
 Index: src/mongo/shell/shell_utils_extended.cpp
 --- src/mongo/shell/shell_utils_extended.cpp.orig
 +++ src/mongo/shell/shell_utils_extended.cpp
-@@ -37,6 +37,7 @@
+@@ -37,6 +37,8 @@
  #endif
  
  #include <boost/filesystem.hpp>
++#include <boost/filesystem/exception.hpp>
 +#include <boost/filesystem/fstream.hpp>
  #include <fstream>
  
Index: patches/patch-src_mongo_shell_shell_utils_launcher_cpp
===================================================================
RCS file: patches/patch-src_mongo_shell_shell_utils_launcher_cpp
diff -N patches/patch-src_mongo_shell_shell_utils_launcher_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_mongo_shell_shell_utils_launcher_cpp      21 Nov 2024 
08:59:24 -0000
@@ -0,0 +1,36 @@
+Index: src/mongo/shell/shell_utils_launcher.cpp
+--- src/mongo/shell/shell_utils_launcher.cpp.orig
++++ src/mongo/shell/shell_utils_launcher.cpp
+@@ -907,26 +907,26 @@ void copyDir(const boost::filesystem::path& from, cons
+     boost::filesystem::directory_iterator i(from);
+     while (i != end) {
+         boost::filesystem::path p = *i;
+-        if (p.leaf() == "metrics.interim" || p.leaf() == 
"metrics.interim.temp") {
++        if (p.filename() == "metrics.interim" || p.filename() == 
"metrics.interim.temp") {
+             // Ignore any errors for metrics.interim* files as these may 
disappear during copy
+             boost::system::error_code ec;
+-            boost::filesystem::copy_file(p, to / p.leaf(), ec);
++            boost::filesystem::copy_file(p, to / p.filename(), ec);
+             if (ec) {
+                 LOGV2_INFO(22814,
+                            "Skipping copying of file from '{from}' to "
+                            "'{to}' due to: {error}",
+                            "Skipping copying of file due to error"
+                            "from"_attr = p.generic_string(),
+-                           "to"_attr = (to / p.leaf()).generic_string(),
++                           "to"_attr = (to / p.filename()).generic_string(),
+                            "error"_attr = ec.message());
+             }
+-        } else if (p.leaf() != "mongod.lock" && p.leaf() != 
"WiredTiger.lock") {
++        } else if (p.filename() != "mongod.lock" && p.filename() != 
"WiredTiger.lock") {
+             if (boost::filesystem::is_directory(p)) {
+-                boost::filesystem::path newDir = to / p.leaf();
++                boost::filesystem::path newDir = to / p.filename();
+                 boost::filesystem::create_directory(newDir);
+                 copyDir(p, newDir);
+             } else {
+-                boost::filesystem::copy_file(p, to / p.leaf());
++                boost::filesystem::copy_file(p, to / p.filename());
+             }
+         }
+         ++i;
Index: patches/patch-src_mongo_shell_shell_utils_launcher_h
===================================================================
RCS file: patches/patch-src_mongo_shell_shell_utils_launcher_h
diff -N patches/patch-src_mongo_shell_shell_utils_launcher_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_mongo_shell_shell_utils_launcher_h        21 Nov 2024 
09:04:34 -0000
@@ -0,0 +1,12 @@
+Index: src/mongo/shell/shell_utils_launcher.h
+--- src/mongo/shell/shell_utils_launcher.h.orig
++++ src/mongo/shell/shell_utils_launcher.h
+@@ -29,7 +29,7 @@
+ 
+ #pragma once
+ 
+-#include <boost/filesystem/convenience.hpp>
++#include <boost/filesystem/operations.hpp>
+ #include <map>
+ #include <sstream>
+ #include <string>
Index: patches/patch-src_mongo_util_processinfo_linux_cpp
===================================================================
RCS file: patches/patch-src_mongo_util_processinfo_linux_cpp
diff -N patches/patch-src_mongo_util_processinfo_linux_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_mongo_util_processinfo_linux_cpp  21 Nov 2024 08:42:25 
-0000
@@ -0,0 +1,11 @@
+Index: src/mongo/util/processinfo_linux.cpp
+--- src/mongo/util/processinfo_linux.cpp.orig
++++ src/mongo/util/processinfo_linux.cpp
+@@ -52,6 +52,7 @@
+ #endif
+ 
+ #include <boost/filesystem.hpp>
++#include <boost/filesystem/exception.hpp>
+ #include <boost/none.hpp>
+ #include <boost/optional.hpp>
+ #include <fmt/format.h>

Reply via email to