summaryrefslogtreecommitdiff
path: root/src/other_tools/just_mr/main.cpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2023-09-20 10:49:03 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2023-09-20 18:43:39 +0200
commit5fbba3abfa6e725b47a170b0c4f7ce5f8c2671e7 (patch)
tree77d3afb331013f83769d7b3007f722af821acd3e /src/other_tools/just_mr/main.cpp
parent70aef852705090b48ded2842269daa7884fa54fd (diff)
downloadjustbuild-5fbba3abfa6e725b47a170b0c4f7ce5f8c2671e7.tar.gz
just-mr: add option to override the absent pragma
Using absent repositories depends on a just-serve endpoint. As such, it is not a datum of the project, but one of the available infrastructure. As the latter can change independently of the project, it is desriable to have the option to specify those pieces of information in separate files.
Diffstat (limited to 'src/other_tools/just_mr/main.cpp')
-rw-r--r--src/other_tools/just_mr/main.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/other_tools/just_mr/main.cpp b/src/other_tools/just_mr/main.cpp
index 85105e50..1e8905d6 100644
--- a/src/other_tools/just_mr/main.cpp
+++ b/src/other_tools/just_mr/main.cpp
@@ -590,6 +590,21 @@ void SetupLogging(MultiRepoLogArguments const& clargs) {
}
}
}
+ // read path to absent repository specification if not already provided by
+ // the user
+ if (not clargs->common.absent_repository_file) {
+ auto absent_order = rc_config["absent"];
+ if (absent_order.IsNotNull() and absent_order->IsList()) {
+ for (auto const& entry : absent_order->List()) {
+ auto path = ReadLocation(
+ entry, clargs->common.just_mr_paths->workspace_root);
+ if (path and FileSystemManager::IsFile(path->first)) {
+ clargs->common.absent_repository_file = path->first;
+ break;
+ }
+ }
+ }
+ }
// read config lookup order
auto config_lookup_order = rc_config["config lookup order"];
if (config_lookup_order.IsNotNull()) {
@@ -744,7 +759,8 @@ auto main(int argc, char* argv[]) -> int {
}
// The remaining options all need the config file
- auto config = JustMR::Utils::ReadConfiguration(config_file);
+ auto config = JustMR::Utils::ReadConfiguration(
+ config_file, arguments.common.absent_repository_file);
// Run subcommand `setup` or `setup-env`
if (arguments.cmd == SubCommand::kSetup or