Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 882515 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/mongo/db/initialize_server_global_state.cpp (-2 / +2 lines)
Lines 33-39 Link Here
33
#include "mongo/db/initialize_server_global_state.h"
33
#include "mongo/db/initialize_server_global_state.h"
34
#include "mongo/db/initialize_server_global_state_gen.h"
34
#include "mongo/db/initialize_server_global_state_gen.h"
35
35
36
#include <boost/filesystem/operations.hpp>
36
#include <boost/filesystem.hpp>
37
#include <fmt/format.h>
37
#include <fmt/format.h>
38
#include <iostream>
38
#include <iostream>
39
#include <memory>
39
#include <memory>
Lines 310-316 bool checkAndMoveLogFile(const std::string& absoluteLogpath) { Link Here
310
                                    << "\" should name a file, not a directory.");
310
                                    << "\" should name a file, not a directory.");
311
        }
311
        }
312
312
313
        if (!serverGlobalParams.logAppend && boost::filesystem::is_regular(absoluteLogpath)) {
313
        if (!serverGlobalParams.logAppend && boost::filesystem::is_regular_file(absoluteLogpath)) {
314
            std::string renameTarget = absoluteLogpath + "." + terseCurrentTimeForFilename();
314
            std::string renameTarget = absoluteLogpath + "." + terseCurrentTimeForFilename();
315
            boost::system::error_code ec;
315
            boost::system::error_code ec;
316
            boost::filesystem::rename(absoluteLogpath, renameTarget, ec);
316
            boost::filesystem::rename(absoluteLogpath, renameTarget, ec);
(-)a/src/mongo/db/startup_warnings_mongod.cpp (+1 lines)
Lines 33-38 Link Here
33
#include "mongo/db/startup_warnings_mongod.h"
33
#include "mongo/db/startup_warnings_mongod.h"
34
34
35
#include <boost/filesystem/operations.hpp>
35
#include <boost/filesystem/operations.hpp>
36
#include <boost/filesystem/exception.hpp>
36
#include <fstream>
37
#include <fstream>
37
#ifndef _WIN32
38
#ifndef _WIN32
38
#include <sys/resource.h>
39
#include <sys/resource.h>
(-)a/src/mongo/db/storage/storage_engine_lock_file_posix.cpp (-2 / +2 lines)
Lines 57-63 void flushMyDirectory(const boost::filesystem::path& file) { Link Here
57
    // if called without a fully qualified path it asserts; that makes mongoperf fail.
57
    // if called without a fully qualified path it asserts; that makes mongoperf fail.
58
    // so make a warning. need a better solution longer term.
58
    // so make a warning. need a better solution longer term.
59
    // massert(40389, str::stream() << "Couldn't find parent dir for file: " << file.string(),);
59
    // massert(40389, str::stream() << "Couldn't find parent dir for file: " << file.string(),);
60
    if (!file.has_branch_path()) {
60
    if (!file.has_parent_path()) {
61
        LOGV2(22274,
61
        LOGV2(22274,
62
              "warning flushMyDirectory couldn't find parent dir for file: {file}",
62
              "warning flushMyDirectory couldn't find parent dir for file: {file}",
63
              "flushMyDirectory couldn't find parent dir for file",
63
              "flushMyDirectory couldn't find parent dir for file",
Lines 66-72 void flushMyDirectory(const boost::filesystem::path& file) { Link Here
66
    }
66
    }
67
67
68
68
69
    boost::filesystem::path dir = file.branch_path();  // parent_path in new boosts
69
    boost::filesystem::path dir = file.parent_path();  // parent_path in new boosts
70
70
71
    LOGV2_DEBUG(22275, 1, "flushing directory {dir_string}", "dir_string"_attr = dir.string());
71
    LOGV2_DEBUG(22275, 1, "flushing directory {dir_string}", "dir_string"_attr = dir.string());
72
72
(-)a/src/mongo/db/storage/storage_engine_metadata.cpp (-2 / +2 lines)
Lines 222-228 void flushMyDirectory(const boost::filesystem::path& file) { Link Here
222
    // if called without a fully qualified path it asserts; that makes mongoperf fail.
222
    // if called without a fully qualified path it asserts; that makes mongoperf fail.
223
    // so make a warning. need a better solution longer term.
223
    // so make a warning. need a better solution longer term.
224
    // massert(13652, str::stream() << "Couldn't find parent dir for file: " << file.string(),);
224
    // massert(13652, str::stream() << "Couldn't find parent dir for file: " << file.string(),);
225
    if (!file.has_branch_path()) {
225
    if (!file.has_parent_path()) {
226
        LOGV2(22283,
226
        LOGV2(22283,
227
              "warning flushMyDirectory couldn't find parent dir for file: {file}",
227
              "warning flushMyDirectory couldn't find parent dir for file: {file}",
228
              "flushMyDirectory couldn't find parent dir for file",
228
              "flushMyDirectory couldn't find parent dir for file",
Lines 231-237 void flushMyDirectory(const boost::filesystem::path& file) { Link Here
231
    }
231
    }
232
232
233
233
234
    boost::filesystem::path dir = file.branch_path();  // parent_path in new boosts
234
    boost::filesystem::path dir = file.parent_path();  // parent_path in new boosts
235
235
236
    LOGV2_DEBUG(22284, 1, "flushing directory {dir_string}", "dir_string"_attr = dir.string());
236
    LOGV2_DEBUG(22284, 1, "flushing directory {dir_string}", "dir_string"_attr = dir.string());
237
237
(-)a/src/mongo/scripting/engine.cpp (+1 lines)
Lines 34-39 Link Here
34
34
35
#include <algorithm>
35
#include <algorithm>
36
#include <boost/filesystem/operations.hpp>
36
#include <boost/filesystem/operations.hpp>
37
#include <boost/filesystem/directory.hpp>
37
38
38
#include "mongo/base/string_data.h"
39
#include "mongo/base/string_data.h"
39
#include "mongo/client/dbclient_base.h"
40
#include "mongo/client/dbclient_base.h"
(-)a/src/mongo/shell/shell_utils_launcher.cpp (-6 / +7 lines)
Lines 36-41 Link Here
36
#include <boost/iostreams/stream_buffer.hpp>
36
#include <boost/iostreams/stream_buffer.hpp>
37
#include <boost/iostreams/tee.hpp>
37
#include <boost/iostreams/tee.hpp>
38
#include <csignal>
38
#include <csignal>
39
#include <boost/filesystem.hpp>
39
#include <fcntl.h>
40
#include <fcntl.h>
40
#include <fmt/format.h>
41
#include <fmt/format.h>
41
#include <fstream>
42
#include <fstream>
Lines 316-341 void copyDir(const boost::filesystem::path& from, const boost::filesystem::path& Link Here
316
    boost::filesystem::directory_iterator i(from);
317
    boost::filesystem::directory_iterator i(from);
317
    while (i != end) {
318
    while (i != end) {
318
        boost::filesystem::path p = *i;
319
        boost::filesystem::path p = *i;
319
        if (p.leaf() == "metrics.interim" || p.leaf() == "metrics.interim.temp") {
320
        if (p.filename() == "metrics.interim" || p.filename() == "metrics.interim.temp") {
320
            // Ignore any errors for metrics.interim* files as these may disappear during copy
321
            // Ignore any errors for metrics.interim* files as these may disappear during copy
321
            boost::system::error_code ec;
322
            boost::system::error_code ec;
322
            boost::filesystem::copy_file(p, to / p.leaf(), ec);
323
            boost::filesystem::copy_file(p, to / p.filename(), ec);
323
            if (ec) {
324
            if (ec) {
324
                LOGV2_INFO(22814,
325
                LOGV2_INFO(22814,
325
                           "Skipping copying of file from '{from}' to "
326
                           "Skipping copying of file from '{from}' to "
326
                           "'{to}' due to: {error}",
327
                           "'{to}' due to: {error}",
327
                           "Skipping copying of file due to error"
328
                           "Skipping copying of file due to error"
328
                           "from"_attr = p.generic_string(),
329
                           "from"_attr = p.generic_string(),
329
                           "to"_attr = (to / p.leaf()).generic_string(),
330
                           "to"_attr = (to / p.filename()).generic_string(),
330
                           "error"_attr = ec.message());
331
                           "error"_attr = ec.message());
331
            }
332
            }
332
        } else if (p.leaf() != "mongod.lock" && p.leaf() != "WiredTiger.lock") {
333
        } else if (p.filename() != "mongod.lock" && p.filename() != "WiredTiger.lock") {
333
            if (boost::filesystem::is_directory(p)) {
334
            if (boost::filesystem::is_directory(p)) {
334
                boost::filesystem::path newDir = to / p.leaf();
335
                boost::filesystem::path newDir = to / p.filename();
335
                boost::filesystem::create_directory(newDir);
336
                boost::filesystem::create_directory(newDir);
336
                copyDir(p, newDir);
337
                copyDir(p, newDir);
337
            } else {
338
            } else {
338
                boost::filesystem::copy_file(p, to / p.leaf());
339
                boost::filesystem::copy_file(p, to / p.filename());
339
            }
340
            }
340
        }
341
        }
341
        ++i;
342
        ++i;
(-)a/src/mongo/shell/shell_utils_launcher.h (-2 / +1 lines)
Lines 29-35 Link Here
29
29
30
#pragma once
30
#pragma once
31
31
32
#include <boost/filesystem/convenience.hpp>
32
#include <boost/filesystem/path.hpp>
33
#include <map>
33
#include <map>
34
#include <sstream>
34
#include <sstream>
35
#include <string>
35
#include <string>
36
- 

Return to bug 882515