From patchwork Thu Feb 20 12:41:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 20322 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6064D27BBEA; Thu, 20 Feb 2020 12:43:10 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 2451D27BBE4 for ; Thu, 20 Feb 2020 12:43:10 +0000 (GMT) Received: from localhost ([::1]:40802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4lAb-0000yT-Kp for patchwork@mira.cbaines.net; Thu, 20 Feb 2020 07:43:09 -0500 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 X-Loop: help-debbugs@gnu.org Subject: [bug#39684] [PATCH] etc: Automatically download the pgp key Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 20 Feb 2020 12:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39684 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 39684@debbugs.gnu.org Received: via spool by 39684-submit@debbugs.gnu.org id=B39684.158220254120420 (code B ref 39684); Thu, 20 Feb 2020 12:43:01 +0000 Received: (at 39684) by debbugs.gnu.org; 20 Feb 2020 12:42:21 +0000 Received: from localhost ([127.0.0.1]:43955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4l9o-0005JH-SL for submit@debbugs.gnu.org; Thu, 20 Feb 2020 07:42:21 -0500 Received: from lepiller.eu ([89.234.186.109]:48354) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4l9n-0005J8-9X for 39684@debbugs.gnu.org; Thu, 20 Feb 2020 07:42:19 -0500 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 94a25da9 for <39684@debbugs.gnu.org>; Thu, 20 Feb 2020 12:42:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lepiller.eu; h=date:from :to:subject:message-id:in-reply-to:references:mime-version :content-type; s=dkim; bh=i3DWjYQfy3sDw7Przo7lxkOElm4=; b=NsPGWc jghnQqyfb5Qxl3w6a6pnoMBImEgukG/UJknYQwaBMJnCADA43yAt1AWnnbGZ9HFo XHIG5sxIGDcHahHDE+n0GoxHVI39dutq9hgmCnmYZ061W+mHu5izanv+TgJIGmsv l3BewP4EXlFgmvobjgIyIwow9/C/QmLi+yYlgX7spKmjMDZ53n4rIIIlp+hqKzeD MqfZ8fq5VW0fXRs816J0VcDB/jU1UeZneQVQFy/eWV/ocSm0WoByvuobMQLebvdy 2JhmF+GWjfL/4d43sbXCBiQC/fSnDBd8tionveQ++9Qgnv0SOtYCjkB5FbMz+r8J sznIgEo46t9JYFXQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 1215bdc1 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <39684@debbugs.gnu.org>; Thu, 20 Feb 2020 12:42:17 +0000 (UTC) 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> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Le Thu, 20 Feb 2020 02:22:20 +0100, Julien Lepiller a écrit : > Hi guix, > > 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. > > 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 > :) > > > Here is the 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