From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:51765) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4lAV-0000y6-5A for guix-patches@gnu.org; Thu, 20 Feb 2020 07:43:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4lAT-00053q-SU for guix-patches@gnu.org; Thu, 20 Feb 2020 07:43:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:37982) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j4lAT-00053m-O3 for guix-patches@gnu.org; Thu, 20 Feb 2020 07:43:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j4lAT-0005K9-MP for guix-patches@gnu.org; Thu, 20 Feb 2020 07:43:01 -0500 Subject: [bug#39684] [PATCH] etc: Automatically download the pgp key Resent-Message-ID: Date: Thu, 20 Feb 2020 13:41:59 +0100 From: Julien Lepiller Message-ID: <20200220134159.70db5633@tachikoma.lepiller.eu> In-Reply-To: <20200220022220.04906816@tachikoma.lepiller.eu> References: <20200220022220.04906816@tachikoma.lepiller.eu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/ZWAsLknt6mph9=h1O7tLXpW" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 39684@debbugs.gnu.org --MP_/ZWAsLknt6mph9=h1O7tLXpW Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Thu, 20 Feb 2020 02:22:20 +0100, Julien Lepiller a =C3=A9crit : > Hi guix, >=20 > this patch should improve the way the gpg key is fetched. Instead of > asking the user to copy the command, when the user passes > --allow-import-gpg, the script will import the gpg key by itself. >=20 > The rationale behind this is a user complaining a few weeks ago on the > Fediverse that the installation video didn't work. In fact, they > didn't understand the gpg command and failed to import the key; > mentionning --allow-import-gpg in the video should help in that case > :) >=20 >=20 >=20 Here is the patch :) --MP_/ZWAsLknt6mph9=h1O7tLXpW Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-etc-Add-an-allow-import-gpg-option-to-the-installer-.patch >From aebea6bcfa615bc644c9afa1120eeb34f0956c5a Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 20 Feb 2020 02:14:39 +0100 Subject: [PATCH] etc: Add an `allow-import-gpg' option to the installer script. * etc/guix-install.sh: Add an `allow-import-gpg' option to support fetching the OpenPGP public key automatically. --- etc/guix-install.sh | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index bfd3842933..d96c5838b8 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -57,6 +57,7 @@ INF="[ INFO ] " DEBUG=0 GNU_URL="https://ftp.gnu.org/gnu/guix/" OPENPGP_SIGNING_KEY_ID="3CE464558A84FDC69DB40CFB090B11993D9AEBB5" +GPG_IMPORT=0 # This script needs to know where root's home directory is. However, we # cannot simply use the HOME environment variable, since there is no guarantee @@ -109,9 +110,14 @@ chk_gpg_keyring() # Without --dry-run this command will create a ~/.gnupg owned by root on # systems where gpg has never been used, causing errors and confusion. gpg --dry-run --list-keys ${OPENPGP_SIGNING_KEY_ID} >/dev/null 2>&1 || ( - _err "${ERR}Missing OpenPGP public key. Fetch it with this command:" - echo " wget https://sv.gnu.org/people/viewgpg.php?user_id=15145 -qO - | gpg --import -" - exit 1 + if [ "${GPG_IMPORT}" = "1" ]; then + wget https://sv.gnu.org/people/viewgpg.php?user_id=15145 -qO - | gpg --import - + else + _err "${ERR}Missing OpenPGP public key. Fetch it with this command:" + echo " wget https://sv.gnu.org/people/viewgpg.php?user_id=15145 -qO - | gpg --import -" + _err "or run this script with the --allow-import-gpg option" + exit 1 + fi ) } @@ -484,4 +490,18 @@ main() _msg "${INF}Run 'info guix' to read the manual." } +# Reading options +while [[ $# -gt 0 ]]; do + case "$1" in + --allow-import-gpg) + GPG_IMPORT=1 + shift + ;; + *) + _err "Unknown option $1" + exit 1 + ;; + esac +done + main "$@" -- 2.24.0 --MP_/ZWAsLknt6mph9=h1O7tLXpW--