From b97cc617bad234335e336d9e509630fe145d60ba Mon Sep 17 00:00:00 2001 From: Jan Kolarik Date: Wed, 12 Feb 2025 11:08:28 +0000 Subject: [PATCH] expired-pgp-keys: Drop checking for gpg command The gpg provider is now a hard dependency in the spec file. --- .../expired-pgp-keys/expired-pgp-keys.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/libdnf5-plugins/expired-pgp-keys/expired-pgp-keys.cpp b/libdnf5-plugins/expired-pgp-keys/expired-pgp-keys.cpp index 8874d9c37..c47de5f41 100644 --- a/libdnf5-plugins/expired-pgp-keys/expired-pgp-keys.cpp +++ b/libdnf5-plugins/expired-pgp-keys/expired-pgp-keys.cpp @@ -92,17 +92,6 @@ class ExpiryInfoMessage : public libdnf5::Message { int64_t expiration_timestamp; }; -/// Check that GPG is installed to enable querying expired keys later. -static bool is_gpg_installed() { - auto ts = rpmtsCreate(); - rpmdbMatchIterator mi; - mi = rpmtsInitIterator(ts, RPMDBI_PROVIDENAME, "gpg", 0); - bool found = rpmdbNextIterator(mi) != NULL; - rpmdbFreeIterator(mi); - rpmtsFree(ts); - return found; -} - /// Check if the transaction contains any inbound actions. /// This determines if new software is to be installed, which might require downloading a new PGP signing key. static bool any_inbound_action(const libdnf5::base::Transaction & transaction) { @@ -171,12 +160,7 @@ void ExpiredPgpKeys::process_expired_pgp_keys(const libdnf5::base::Transaction & auto & logger = *get_base().get_logger(); const auto & config = get_base().get_config(); - if (!config.get_gpgcheck_option().get_value()) { - return; - } - - if (!is_gpg_installed()) { - logger.error("Expired PGP Keys Plugin: GPG is not installed on the system. Aborting..."); + if (!config.get_pkg_gpgcheck_option().get_value()) { return; }