Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expired-pgp-keys: Drop checking for gpg command #2058

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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