William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 1 | From dc14022a99dc017c52c484efb32729729baf854c Mon Sep 17 00:00:00 2001 |
| 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
| 3 | Date: Tue, 4 May 2021 22:07:32 +0200 |
| 4 | Subject: [PATCH 2/2] dnf/rpm/miscutils.py: do not hardcode /usr/bin/rpmkeys |
| 5 | |
| 6 | Some build systems (e.g. Yocto) place a specially configured |
| 7 | rpmkeys executable elsewhere and set up PATH accordingly; |
| 8 | it's better to always take it from there. |
| 9 | |
| 10 | Upstream-Status: Submitted [https://github.com/rpm-software-management/dnf/pull/1763] |
| 11 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
| 12 | --- |
| 13 | dnf/rpm/miscutils.py | 8 +++----- |
| 14 | 1 file changed, 3 insertions(+), 5 deletions(-) |
| 15 | |
| 16 | diff --git a/dnf/rpm/miscutils.py b/dnf/rpm/miscutils.py |
| 17 | index 7e33d4c42..fcd956db9 100644 |
| 18 | --- a/dnf/rpm/miscutils.py |
| 19 | +++ b/dnf/rpm/miscutils.py |
| 20 | @@ -30,11 +30,9 @@ logger = logging.getLogger('dnf') |
| 21 | |
| 22 | |
| 23 | def _verifyPkgUsingRpmkeys(package, installroot): |
| 24 | - rpmkeys_binary = '/usr/bin/rpmkeys' |
| 25 | - if not os.path.isfile(rpmkeys_binary): |
| 26 | - rpmkeys_binary = which("rpmkeys") |
| 27 | - logger.info(_('Using rpmkeys executable from {path} to verify signature for package: {package}.').format( |
| 28 | - path=rpmkeys_binary, package=package)) |
| 29 | + rpmkeys_binary = which("rpmkeys") |
| 30 | + logger.info(_('Using rpmkeys executable from {path} to verify signature for package: {package}.').format( |
| 31 | + path=rpmkeys_binary, package=package)) |
| 32 | |
| 33 | if not os.path.isfile(rpmkeys_binary): |
| 34 | logger.critical(_('Cannot find rpmkeys executable to verify signatures.')) |
| 35 | -- |
| 36 | 2.31.1 |
| 37 | |