summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-11-15 17:12:07 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-11-16 15:19:07 +0100
commit4a7517b4c638118abcff6bc406171bf9566be2fc (patch)
tree1dadfb27379aad5003f621bc687799295ff3d6fc /src
parent4e32fa60312a1d6fcd08700e8fb37e4b1d0195a0 (diff)
downloadjustbuild-4a7517b4c638118abcff6bc406171bf9566be2fc.tar.gz
fetch-absent: Only allow option in native mode
Diffstat (limited to 'src')
-rw-r--r--src/other_tools/just_mr/main.cpp38
1 files changed, 31 insertions, 7 deletions
diff --git a/src/other_tools/just_mr/main.cpp b/src/other_tools/just_mr/main.cpp
index 7b7868d0..70d90eaf 100644
--- a/src/other_tools/just_mr/main.cpp
+++ b/src/other_tools/just_mr/main.cpp
@@ -760,6 +760,14 @@ auto main(int argc, char* argv[]) -> int {
// Run subcommands known to just and `do`
if (arguments.cmd == SubCommand::kJustDo or
arguments.cmd == SubCommand::kJustSubCmd) {
+ // check setup configuration arguments for validity
+ if (Compatibility::IsCompatible() and
+ arguments.common.fetch_absent) {
+ Logger::Log(LogLevel::Error,
+ "Fetching absent repositories only available in "
+ "native mode!");
+ return kExitConfigError;
+ }
return CallJust(config_file,
arguments.common,
arguments.setup,
@@ -780,6 +788,14 @@ auto main(int argc, char* argv[]) -> int {
// Run subcommand `setup` or `setup-env`
if (arguments.cmd == SubCommand::kSetup or
arguments.cmd == SubCommand::kSetupEnv) {
+ // check setup configuration arguments for validity
+ if (Compatibility::IsCompatible() and
+ arguments.common.fetch_absent) {
+ Logger::Log(LogLevel::Error,
+ "Fetching absent repositories only available in "
+ "native mode!");
+ return kExitConfigError;
+ }
auto mr_config_path = MultiRepoSetup(
config,
arguments.common,
@@ -806,13 +822,21 @@ auto main(int argc, char* argv[]) -> int {
// Run subcommand `fetch`
if (arguments.cmd == SubCommand::kFetch) {
// check fetch configuration arguments for validity
- if (arguments.common.remote_execution_address and
- arguments.fetch.backup_to_remote and
- Compatibility::IsCompatible()) {
- Logger::Log(LogLevel::Error,
- "Remote backup for fetched archives only available "
- "in native mode!");
- return kExitConfigError;
+ if (Compatibility::IsCompatible()) {
+ if (arguments.common.remote_execution_address and
+ arguments.fetch.backup_to_remote) {
+ Logger::Log(
+ LogLevel::Error,
+ "Remote backup for fetched archives only available "
+ "in native mode!");
+ return kExitConfigError;
+ }
+ if (arguments.common.fetch_absent) {
+ Logger::Log(LogLevel::Error,
+ "Fetching absent repositories only available "
+ "in native mode!");
+ return kExitConfigError;
+ }
}
return MultiRepoFetch(config,
arguments.common,