This commit is contained in:
@@ -164,6 +164,7 @@ ncrypt
|
|||||||
nlohmann
|
nlohmann
|
||||||
nlohmann_json
|
nlohmann_json
|
||||||
nmakeprg
|
nmakeprg
|
||||||
|
noappledouble
|
||||||
nohup
|
nohup
|
||||||
nominmax
|
nominmax
|
||||||
ntstatus
|
ntstatus
|
||||||
|
@@ -83,12 +83,14 @@ auto parse_option(std::vector<const char *> args,
|
|||||||
-> std::vector<std::string> {
|
-> std::vector<std::string> {
|
||||||
std::vector<std::string> ret;
|
std::vector<std::string> ret;
|
||||||
auto found{false};
|
auto found{false};
|
||||||
for (std::size_t i = 0U; not found && (i < args.size()); i++) {
|
for (std::size_t idx{0U}; not found && (idx < args.size()); idx++) {
|
||||||
if ((found = (option_name == args.at(i)))) {
|
found = option_name == args.at(idx);
|
||||||
if ((++i + count) <= args.size()) {
|
if (not found) {
|
||||||
while ((count--) != 0U) {
|
continue;
|
||||||
ret.emplace_back(args.at(i++));
|
}
|
||||||
}
|
if ((++idx + count) <= args.size()) {
|
||||||
|
while ((count--) != 0U) {
|
||||||
|
ret.emplace_back(args.at(idx++));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -148,7 +150,7 @@ auto parse_drive_options(std::vector<const char *> args,
|
|||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
std::vector<std::string> fuse_flags_list;
|
std::vector<std::string> fuse_flags_list;
|
||||||
for (std::size_t i = 1; i < drive_args.size(); i++) {
|
for (std::size_t i = 1; i < drive_args.size(); i++) {
|
||||||
if (drive_args.at(i).find("-o") == 0) {
|
if (drive_args.at(i).starts_with("-o")) {
|
||||||
std::string options;
|
std::string options;
|
||||||
if (drive_args[i].size() == 2) {
|
if (drive_args[i].size() == 2) {
|
||||||
if ((i + 1) < drive_args.size()) {
|
if ((i + 1) < drive_args.size()) {
|
||||||
@@ -160,12 +162,12 @@ auto parse_drive_options(std::vector<const char *> args,
|
|||||||
|
|
||||||
const auto fuse_option_list = utils::string::split(options, ',', true);
|
const auto fuse_option_list = utils::string::split(options, ',', true);
|
||||||
for (const auto &fuse_option : fuse_option_list) {
|
for (const auto &fuse_option : fuse_option_list) {
|
||||||
if (fuse_option.find("s3") == 0) {
|
if (fuse_option.starts_with("s3")) {
|
||||||
prov = provider_type::s3;
|
prov = provider_type::s3;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((fuse_option.find("dd") == 0) ||
|
if ((fuse_option.starts_with("dd")) ||
|
||||||
(fuse_option.find("data_directory") == 0)) {
|
(fuse_option.starts_with("data_directory"))) {
|
||||||
const auto data = utils::string::split(fuse_option, '=', true);
|
const auto data = utils::string::split(fuse_option, '=', true);
|
||||||
if (data.size() == 2U) {
|
if (data.size() == 2U) {
|
||||||
data_directory = data.at(1U);
|
data_directory = data.at(1U);
|
||||||
@@ -184,61 +186,59 @@ auto parse_drive_options(std::vector<const char *> args,
|
|||||||
|
|
||||||
{
|
{
|
||||||
std::vector<std::string> new_drive_args(drive_args);
|
std::vector<std::string> new_drive_args(drive_args);
|
||||||
for (std::size_t i = 1; i < new_drive_args.size(); i++) {
|
for (std::size_t idx{1}; idx < new_drive_args.size(); idx++) {
|
||||||
if (new_drive_args[i].find("-o") == 0) {
|
if (new_drive_args[idx].starts_with("-o")) {
|
||||||
if (new_drive_args[i].size() == 2) {
|
if (new_drive_args[idx].size() == 2) {
|
||||||
if ((i + 1) < drive_args.size()) {
|
if ((idx + 1) < drive_args.size()) {
|
||||||
utils::collection::remove_element(new_drive_args,
|
utils::collection::remove_element(new_drive_args,
|
||||||
new_drive_args[i]);
|
new_drive_args[idx]);
|
||||||
utils::collection::remove_element(new_drive_args,
|
utils::collection::remove_element(new_drive_args,
|
||||||
new_drive_args[i]);
|
new_drive_args[idx]);
|
||||||
i--;
|
idx--;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
utils::collection::remove_element(new_drive_args, new_drive_args[i]);
|
utils::collection::remove_element(new_drive_args, new_drive_args[idx]);
|
||||||
i--;
|
idx--;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if FUSE_USE_VERSION < 30
|
#if FUSE_USE_VERSION < 30
|
||||||
{
|
{
|
||||||
auto it = std::remove_if(
|
auto iter = std::remove_if(
|
||||||
fuse_flags_list.begin(), fuse_flags_list.end(),
|
fuse_flags_list.begin(), fuse_flags_list.end(),
|
||||||
[](const auto &opt) -> bool { return opt.find("hard_remove") == 0; });
|
[](auto &&opt) -> bool { return opt.find("hard_remove") == 0; });
|
||||||
if (it == fuse_flags_list.end()) {
|
if (iter == fuse_flags_list.end()) {
|
||||||
fuse_flags_list.emplace_back("hard_remove");
|
fuse_flags_list.emplace_back("hard_remove");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif // FUSE_USE_VERSION < 30
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
{
|
{
|
||||||
auto it = std::remove_if(
|
auto iter = std::remove_if(
|
||||||
fuse_flags_list.begin(), fuse_flags_list.end(),
|
fuse_flags_list.begin(), fuse_flags_list.end(),
|
||||||
[](const auto &opt) -> bool { return opt.find("volname") == 0; });
|
[](auto &&opt) -> bool { return opt.find("volname") == 0; });
|
||||||
if (it != fuse_flags_list.end()) {
|
if (iter != fuse_flags_list.end()) {
|
||||||
fuse_flags_list.erase(it, fuse_flags_list.end());
|
fuse_flags_list.erase(iter, fuse_flags_list.end());
|
||||||
}
|
}
|
||||||
fuse_flags_list.emplace_back("volname=Repertory" +
|
fuse_flags_list.emplace_back("volname=Repertory" +
|
||||||
app_config::get_provider_display_name(prov));
|
app_config::get_provider_display_name(prov));
|
||||||
|
|
||||||
it = std::remove_if(fuse_flags_list.begin(), fuse_flags_list.end(),
|
iter = std::remove_if(
|
||||||
[](const auto &opt) -> bool {
|
fuse_flags_list.begin(), fuse_flags_list.end(),
|
||||||
return opt.find("daemon_timeout") == 0;
|
[](auto &&opt) -> bool { return opt.find("daemon_timeout") == 0; });
|
||||||
});
|
if (iter != fuse_flags_list.end()) {
|
||||||
if (it != fuse_flags_list.end()) {
|
fuse_flags_list.erase(iter, fuse_flags_list.end());
|
||||||
fuse_flags_list.erase(it, fuse_flags_list.end());
|
|
||||||
}
|
}
|
||||||
fuse_flags_list.emplace_back("daemon_timeout=300");
|
fuse_flags_list.emplace_back("daemon_timeout=300");
|
||||||
|
|
||||||
it = std::remove_if(fuse_flags_list.begin(), fuse_flags_list.end(),
|
iter = std::remove_if(
|
||||||
[](const auto &opt) -> bool {
|
fuse_flags_list.begin(), fuse_flags_list.end(),
|
||||||
return opt.find("noappledouble") == 0;
|
[](auto &&opt) -> bool { return opt.find("noappledouble") == 0; });
|
||||||
});
|
if (iter == fuse_flags_list.end()) {
|
||||||
if (it == fuse_flags_list.end()) {
|
|
||||||
fuse_flags_list.emplace_back("noappledouble");
|
fuse_flags_list.emplace_back("noappledouble");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user