From fad43085430ee2b0293ef5968ec011f1ac79b5f4 Mon Sep 17 00:00:00 2001 From: Marek Blaha Date: Wed, 4 Dec 2024 14:06:41 +0100 Subject: [PATCH] reposync: Do not allow --safe-write-path with multiple repos. --- dnf5-plugins/reposync_plugin/reposync.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dnf5-plugins/reposync_plugin/reposync.cpp b/dnf5-plugins/reposync_plugin/reposync.cpp index 21b7553fa..d5acf41cb 100644 --- a/dnf5-plugins/reposync_plugin/reposync.cpp +++ b/dnf5-plugins/reposync_plugin/reposync.cpp @@ -159,6 +159,11 @@ void ReposyncCommand::configure() { M_("Can't use --norepopath with multiple repositories enabled")); } + if (!safe_write_path_option->get_value().empty() && repos_query.size() > 1) { + throw libdnf5::cli::ArgumentParserConflictingArgumentsError( + M_("Can't use --safe-write-path with multiple repositories enabled")); + } + // Default destination for downloaded repos is the current directory context.get_base().get_config().get_destdir_option().set(libdnf5::Option::Priority::DEFAULT, ".");