diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/common/location.cpp | 6 | ||||
-rw-r--r-- | src/other_tools/just_mr/cli.hpp | 28 | ||||
-rw-r--r-- | src/other_tools/just_mr/fetch.cpp | 8 | ||||
-rw-r--r-- | src/other_tools/just_mr/main.cpp | 7 | ||||
-rw-r--r-- | src/other_tools/just_mr/rc.cpp | 3 | ||||
-rw-r--r-- | src/other_tools/ops_maps/critical_git_op_map.hpp | 4 | ||||
-rw-r--r-- | src/utils/cpp/tmp_dir.cpp | 7 |
7 files changed, 26 insertions, 37 deletions
diff --git a/src/buildtool/common/location.cpp b/src/buildtool/common/location.cpp index 597fc286..7f124566 100644 --- a/src/buildtool/common/location.cpp +++ b/src/buildtool/common/location.cpp @@ -48,8 +48,6 @@ auto ReadLocationObject(nlohmann::json const& location, root_path = FileSystemManager::GetCurrentDirectory().root_path(); } return std::optional<location_res_t>{ - std::make_pair(std::filesystem::weakly_canonical( - std::filesystem::absolute(root_path / path)), - std::filesystem::weakly_canonical( - std::filesystem::absolute(root_path / base)))}; + std::make_pair(std::filesystem::weakly_canonical(root_path / path), + std::filesystem::weakly_canonical(root_path / base))}; } diff --git a/src/other_tools/just_mr/cli.hpp b/src/other_tools/just_mr/cli.hpp index 96760b0d..de1ac9d0 100644 --- a/src/other_tools/just_mr/cli.hpp +++ b/src/other_tools/just_mr/cli.hpp @@ -152,8 +152,8 @@ static inline void SetupMultiRepoCommonArguments( app->add_option_function<std::string>( "-C, --repository-config", [clargs](auto const& repository_config_raw) { - clargs->repository_config = std::filesystem::weakly_canonical( - std::filesystem::absolute(repository_config_raw)); + clargs->repository_config = + std::filesystem::weakly_canonical(repository_config_raw); }, "Repository-description file to use.") ->type_name("FILE"); @@ -161,8 +161,7 @@ static inline void SetupMultiRepoCommonArguments( "--absent", [clargs](auto const& file_raw) { clargs->absent_repository_file = - std::filesystem::weakly_canonical( - std::filesystem::absolute(file_raw)); + std::filesystem::weakly_canonical(file_raw); }, "File specifying the repositories to consider absent (overrides the " "pragma in the config file).") @@ -170,8 +169,8 @@ static inline void SetupMultiRepoCommonArguments( app->add_option_function<std::string>( "--local-build-root", [clargs](auto const& local_build_root_raw) { - clargs->just_mr_paths->root = std::filesystem::weakly_canonical( - std::filesystem::absolute(local_build_root_raw)); + clargs->just_mr_paths->root = + std::filesystem::weakly_canonical(local_build_root_raw); }, "Root for CAS, repository space, etc.") ->type_name("PATH"); @@ -179,8 +178,7 @@ static inline void SetupMultiRepoCommonArguments( "--checkout-locations", [clargs](auto const& checkout_locations_raw) { clargs->checkout_locations_file = - std::filesystem::weakly_canonical( - std::filesystem::absolute(checkout_locations_raw)); + std::filesystem::weakly_canonical(checkout_locations_raw); }, "Specification file for checkout locations.") ->type_name("CHECKOUT_LOCATIONS"); @@ -198,8 +196,7 @@ static inline void SetupMultiRepoCommonArguments( "--distdir", [clargs](auto const& distdir_raw) { clargs->explicit_distdirs.emplace_back( - std::filesystem::weakly_canonical(std::filesystem::absolute( - std::filesystem::path(distdir_raw)))); + std::filesystem::weakly_canonical(distdir_raw)); }, "Directory to look for distfiles before fetching.") ->type_name("PATH") @@ -212,8 +209,8 @@ static inline void SetupMultiRepoCommonArguments( app->add_option_function<std::string>( "--fetch-cacert", [clargs](auto const& cacert_raw) { - clargs->ca_info->ca_bundle = std::filesystem::weakly_canonical( - std::filesystem::absolute(cacert_raw)); + clargs->ca_info->ca_bundle = + std::filesystem::weakly_canonical(cacert_raw); }, "CA certificate bundle to use for SSL verification when fetching " "archives from remote.") @@ -230,8 +227,7 @@ static inline void SetupMultiRepoCommonArguments( app->add_option_function<std::string>( "--rc", [clargs](auto const& rc_path_raw) { - clargs->rc_path = std::filesystem::weakly_canonical( - std::filesystem::absolute(rc_path_raw)); + clargs->rc_path = std::filesystem::weakly_canonical(rc_path_raw); }, "Use just-mrrc file from custom path.") ->type_name("RCFILE"); @@ -335,8 +331,8 @@ static inline void SetupMultiRepoFetchArguments( app->add_option_function<std::string>( "-o", [clargs](auto const& fetch_dir_raw) { - clargs->fetch_dir = std::filesystem::weakly_canonical( - std::filesystem::absolute(fetch_dir_raw)); + clargs->fetch_dir = + std::filesystem::weakly_canonical(fetch_dir_raw); }, "Directory to write distfiles when fetching.") ->type_name("PATH"); diff --git a/src/other_tools/just_mr/fetch.cpp b/src/other_tools/just_mr/fetch.cpp index 0dd3a155..3585d2f3 100644 --- a/src/other_tools/just_mr/fetch.cpp +++ b/src/other_tools/just_mr/fetch.cpp @@ -86,8 +86,7 @@ auto MultiRepoFetch(std::shared_ptr<Configuration> const& config, if (not fetch_dir) { for (auto const& d : common_args.just_mr_paths->distdirs) { if (FileSystemManager::IsDirectory(d)) { - fetch_dir = std::filesystem::weakly_canonical( - std::filesystem::absolute(d)); + fetch_dir = std::filesystem::weakly_canonical(d); break; } } @@ -147,9 +146,8 @@ auto MultiRepoFetch(std::shared_ptr<Configuration> const& config, std::filesystem::path(repo_path->String()); if (not repo_path_as_path.is_absolute()) { repo_path_as_path = std::filesystem::weakly_canonical( - std::filesystem::absolute( - common_args.just_mr_paths->setup_root / - repo_path_as_path)); + common_args.just_mr_paths->setup_root / + repo_path_as_path); } // only warn if repo workspace differs to invocation workspace if (not is_subpath( diff --git a/src/other_tools/just_mr/main.cpp b/src/other_tools/just_mr/main.cpp index 963d4f97..f1836d23 100644 --- a/src/other_tools/just_mr/main.cpp +++ b/src/other_tools/just_mr/main.cpp @@ -285,15 +285,14 @@ auto main(int argc, char* argv[]) -> int { if (not arguments.common.just_mr_paths->root) { forward_build_root = false; arguments.common.just_mr_paths->root = - std::filesystem::weakly_canonical( - std::filesystem::absolute(kDefaultBuildRoot)); + std::filesystem::weakly_canonical(kDefaultBuildRoot); } if (not arguments.common.checkout_locations_file and FileSystemManager::IsFile(std::filesystem::weakly_canonical( - std::filesystem::absolute(kDefaultCheckoutLocationsFile)))) { + kDefaultCheckoutLocationsFile))) { arguments.common.checkout_locations_file = std::filesystem::weakly_canonical( - std::filesystem::absolute(kDefaultCheckoutLocationsFile)); + kDefaultCheckoutLocationsFile); } if (arguments.common.just_mr_paths->distdirs.empty()) { arguments.common.just_mr_paths->distdirs.emplace_back( diff --git a/src/other_tools/just_mr/rc.cpp b/src/other_tools/just_mr/rc.cpp index 67ef3e24..bcb217cf 100644 --- a/src/other_tools/just_mr/rc.cpp +++ b/src/other_tools/just_mr/rc.cpp @@ -103,8 +103,7 @@ namespace { // set default if rcpath not given if (not clargs->common.norc) { if (not rc_path) { - rc_path = std::filesystem::weakly_canonical( - std::filesystem::absolute(kDefaultRCPath)); + rc_path = std::filesystem::weakly_canonical(kDefaultRCPath); } else { if (not FileSystemManager::IsFile(*rc_path)) { diff --git a/src/other_tools/ops_maps/critical_git_op_map.hpp b/src/other_tools/ops_maps/critical_git_op_map.hpp index 3e5a07ee..1494e3b3 100644 --- a/src/other_tools/ops_maps/critical_git_op_map.hpp +++ b/src/other_tools/ops_maps/critical_git_op_map.hpp @@ -74,8 +74,8 @@ class CriticalGitOpGuard { std::scoped_lock<std::mutex> const lock(critical_key_mutex_); // try emplace a new value - auto const canonical_path = std::filesystem::weakly_canonical( - std::filesystem::absolute(new_key.params.target_path)); + auto const canonical_path = + std::filesystem::weakly_canonical(new_key.params.target_path); auto result = curr_critical_key_.try_emplace(canonical_path, new_key); // If the insertion happens, there are no keys to wait for. std::nullopt // is returned. diff --git a/src/utils/cpp/tmp_dir.cpp b/src/utils/cpp/tmp_dir.cpp index 9a38aca2..2a43cacd 100644 --- a/src/utils/cpp/tmp_dir.cpp +++ b/src/utils/cpp/tmp_dir.cpp @@ -49,8 +49,8 @@ auto TmpDir::CreateFile(TmpDir::Ptr const& parent, } try { - auto file_path = std::filesystem::weakly_canonical( - std::filesystem::absolute(temp_dir->GetPath() / file_name)); + auto file_path = + std::filesystem::weakly_canonical(temp_dir->GetPath() / file_name); if (not FileSystemManager::CreateFile(file_path)) { return nullptr; } @@ -75,8 +75,7 @@ auto TmpDir::CreateImpl(TmpDir::Ptr parent, std::string file_path; try { - file_path = std::filesystem::weakly_canonical( - std::filesystem::absolute(path / kDirTemplate)); + file_path = std::filesystem::weakly_canonical(path / kDirTemplate); // Create a temporary directory: if (mkdtemp(file_path.data()) == nullptr) { return nullptr; |