richardphibel / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone

Blame SOURCES/0007-Add-configuration-option-skip_if_unavailable-RhBug1689931.patch

9df603
From d4917c293fda8f533ef57130c1a46215901f92a4 Mon Sep 17 00:00:00 2001
9df603
From: Jaroslav Mracek <jmracek@redhat.com>
9df603
Date: Wed, 3 Apr 2019 12:25:17 +0200
9df603
Subject: [PATCH] Add configuration option skip_if_unavailable (RhBug:1689931)
9df603
9df603
---
9df603
 libdnf/conf/ConfigMain.cpp | 4 ++++
9df603
 libdnf/conf/ConfigMain.hpp | 1 +
9df603
 libdnf/conf/ConfigRepo.cpp | 4 ++--
9df603
 libdnf/conf/ConfigRepo.hpp | 2 +-
9df603
 4 files changed, 8 insertions(+), 3 deletions(-)
9df603
9df603
diff --git a/libdnf/conf/ConfigMain.cpp b/libdnf/conf/ConfigMain.cpp
9df603
index aff6b87..9016e6e 100644
9df603
--- a/libdnf/conf/ConfigMain.cpp
9df603
+++ b/libdnf/conf/ConfigMain.cpp
9df603
@@ -530,6 +530,9 @@ class ConfigMain::Impl {
9df603
 
9df603
     OptionNumber<std::uint32_t> deltarpm_percentage{75};
9df603
     OptionBinding deltaRpmPercentageBinding{owner, deltarpm_percentage, "deltarpm_percentage"};
9df603
+
9df603
+    OptionBool skip_if_unavailable{false};
9df603
+    OptionBinding skip_if_unavailableBinding{owner, skip_if_unavailable, "skip_if_unavailable"};
9df603
 };
9df603
 
9df603
 ConfigMain::ConfigMain() { pImpl = std::unique_ptr<Impl>(new Impl(*this)); }
9df603
@@ -631,5 +634,6 @@ OptionString & ConfigMain::sslclientcert() { return pImpl->sslclientcert; }
9df603
 OptionString & ConfigMain::sslclientkey() { return pImpl->sslclientkey; }
9df603
 OptionBool & ConfigMain::deltarpm() { return pImpl->deltarpm; }
9df603
 OptionNumber<std::uint32_t> & ConfigMain::deltarpm_percentage() { return pImpl->deltarpm_percentage; }
9df603
+OptionBool & ConfigMain::skip_if_unavailable() { return pImpl->skip_if_unavailable; }
9df603
 
9df603
 }
9df603
diff --git a/libdnf/conf/ConfigMain.hpp b/libdnf/conf/ConfigMain.hpp
9df603
index 2aef32a..6423644 100644
9df603
--- a/libdnf/conf/ConfigMain.hpp
9df603
+++ b/libdnf/conf/ConfigMain.hpp
9df603
@@ -147,6 +147,7 @@ public:
9df603
     OptionString & sslclientkey();
9df603
     OptionBool & deltarpm();
9df603
     OptionNumber<std::uint32_t> & deltarpm_percentage();
9df603
+    OptionBool & skip_if_unavailable();
9df603
 
9df603
 private:
9df603
     class Impl;
9df603
diff --git a/libdnf/conf/ConfigRepo.cpp b/libdnf/conf/ConfigRepo.cpp
9df603
index 754401e..17f8817 100644
9df603
--- a/libdnf/conf/ConfigRepo.cpp
9df603
+++ b/libdnf/conf/ConfigRepo.cpp
9df603
@@ -162,7 +162,7 @@ class ConfigRepo::Impl {
9df603
     OptionChild<OptionNumber<std::uint32_t> > deltarpm_percentage{masterConfig.deltarpm_percentage()};
9df603
     OptionBinding deltaRpmPercentageBinding{owner, deltarpm_percentage, "deltarpm_percentage"};
9df603
 
9df603
-    OptionBool skip_if_unavailable{false};
9df603
+    OptionChild<OptionBool> skip_if_unavailable{masterConfig.skip_if_unavailable()};
9df603
     OptionBinding skipIfUnavailableBinding{owner, skip_if_unavailable, "skip_if_unavailable"};
9df603
 
9df603
     OptionString enabled_metadata{""};
9df603
@@ -216,7 +216,7 @@ OptionChild<OptionString> & ConfigRepo::sslclientcert() { return pImpl->sslclien
9df603
 OptionChild<OptionString> & ConfigRepo::sslclientkey() { return pImpl->sslclientkey; }
9df603
 OptionChild<OptionBool> & ConfigRepo::deltarpm() { return pImpl->deltarpm; }
9df603
 OptionChild<OptionNumber<std::uint32_t> > & ConfigRepo::deltarpm_percentage() { return pImpl->deltarpm_percentage; }
9df603
-OptionBool & ConfigRepo::skip_if_unavailable() { return pImpl->skip_if_unavailable; }
9df603
+OptionChild<OptionBool> & ConfigRepo::skip_if_unavailable() { return pImpl->skip_if_unavailable; }
9df603
 OptionString & ConfigRepo::enabled_metadata() { return pImpl->enabled_metadata; }
9df603
 OptionEnum<std::string> & ConfigRepo::failovermethod() { return pImpl->failovermethod; }
9df603
 
9df603
diff --git a/libdnf/conf/ConfigRepo.hpp b/libdnf/conf/ConfigRepo.hpp
9df603
index 781a40f..0f0eda3 100644
9df603
--- a/libdnf/conf/ConfigRepo.hpp
9df603
+++ b/libdnf/conf/ConfigRepo.hpp
9df603
@@ -83,7 +83,7 @@ public:
9df603
     OptionChild<OptionString> & sslclientkey();
9df603
     OptionChild<OptionBool> & deltarpm();
9df603
     OptionChild<OptionNumber<std::uint32_t> > & deltarpm_percentage();
9df603
-    OptionBool & skip_if_unavailable();
9df603
+    OptionChild<OptionBool> & skip_if_unavailable();
9df603
     // option recognized by other tools, e.g. gnome-software, but unused in dnf
9df603
     OptionString & enabled_metadata();
9df603
     // yum compatibility options
9df603
--
9df603
libgit2 0.27.7
9df603