From 885b014c1daa6b055a7d2b435126b4263572b599 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 27 Feb 2020 11:54:06 +0100 Subject: [PATCH] reguire gnupg1 on f>=31; sense the system to use gpg1 when installed --- bootmanager.spec | 9 ++++++++- source/steps/InstallBootstrapFS.py | 10 +++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/bootmanager.spec b/bootmanager.spec index 89f5f8f..a383393 100644 --- a/bootmanager.spec +++ b/bootmanager.spec @@ -23,7 +23,14 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root # this is not true anymore and fedora23 won't let us build this as noarch anymore # BuildArch: noarch -Requires: tar, gnupg, sharutils, bzip2 +Requires: tar, sharutils, bzip2 +# see myplc/plc.d/gpg for more details on the gnupg / gpg topic +%if "%{distro}" == "Fedora" && %{distrorelease} >= 31 +Requires: gnupg1 +%else +Requires: gnupg +%endif + # need the apache user at install-time Requires: httpd diff --git a/source/steps/InstallBootstrapFS.py b/source/steps/InstallBootstrapFS.py index f06bc91..bea2afd 100644 --- a/source/steps/InstallBootstrapFS.py +++ b/source/steps/InstallBootstrapFS.py @@ -232,9 +232,13 @@ def Run(vars, upgrade, log): if (vars['ONE_PARTITION'] != '1'): # Import the GPG key into the RPM database so that RPMS can be verified utils.makedirs(SYSIMG_PATH + "/etc/pki/rpm-gpg") - utils.sysexec("gpg --homedir=/root --export --armor" - " --no-default-keyring --keyring {}/usr/boot/pubring.gpg" - " > {}/etc/pki/rpm-gpg/RPM-GPG-KEY-planetlab".format(SYSIMG_PATH, SYSIMG_PATH), log) + # see also myplc/plc.d/gpg + utils.sysexec( + "type -p gpg1 >& /dev/null && GPG=gpg1 || GPG=gpg; " + "$GPG --homedir=/root --export --armor" + " --no-default-keyring --keyring {}/usr/boot/pubring.gpg" + " > {}/etc/pki/rpm-gpg/RPM-GPG-KEY-planetlab" + .format(SYSIMG_PATH, SYSIMG_PATH), log, shell=True) utils.sysexec_chroot(SYSIMG_PATH, "rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-planetlab", log) # keep a log on the installed hdd -- 2.43.0