Skip to content

Commit

Permalink
expired-pgp-keys: Drop checking for gpg command
Browse files Browse the repository at this point in the history
The gpg provider is now a hard dependency in the spec file.
  • Loading branch information
jan-kolarik committed Feb 12, 2025
1 parent 7458068 commit b97cc61
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions libdnf5-plugins/expired-pgp-keys/expired-pgp-keys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit b97cc61

Please sign in to comment.