From unknown Sun Aug 10 10:54:22 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58345] [PATCH 0/3] Customize PS1 on foreign distributions Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Oct 2022 05:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58345 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58345@debbugs.gnu.org Cc: Maxim Cournoyer X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16651204716697 (code B ref -1); Fri, 07 Oct 2022 05:28:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Oct 2022 05:27:51 +0000 Received: from localhost ([127.0.0.1]:34015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogftn-0001jx-6Y for submit@debbugs.gnu.org; Fri, 07 Oct 2022 01:27:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:36596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogftl-0001jp-5o for submit@debbugs.gnu.org; Fri, 07 Oct 2022 01:27:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogftk-0002JW-TW for guix-patches@gnu.org; Fri, 07 Oct 2022 01:27:48 -0400 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:35408) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ogftj-0000UN-Gd for guix-patches@gnu.org; Fri, 07 Oct 2022 01:27:48 -0400 Received: by mail-qk1-x734.google.com with SMTP id q1so1007591qkm.2 for ; Thu, 06 Oct 2022 22:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=354TWF+/akU14W/40axi+iFF5rPpEpVhGMjyGhA/fAo=; b=lv24hoEolpDLOh8AQKcI57pfgrEL7v2QhYmZPUOsxhkeudEKWtSNNOstBwZ6+dHpgx Hg/BJTnSpZgYabxWipbMXKiNb5jxi1J0tcQ+wZpET4a9TKciCm5Gi49fKRFqW9xABNJO L9DutsPg4zugi41q2NIrSZo4PmmaQtG0MMvNp6A4cf1Gc0uZdzGvmmrbnDusp6v3Hbgf 97lZ4R09T52ixdiBcI0PYKfUP/YxuwwDoKdjqWbC82wg0Agv2VgKr9VeMg0dBVWPLTA3 WNSt4hjS5S4b67FOOWX++t4u7NohhBOdy2RcKYoAFeyjk9ePT0iOvnnmTSYDsSeV6Dzp HsaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=354TWF+/akU14W/40axi+iFF5rPpEpVhGMjyGhA/fAo=; b=7USdFdydZOvxdNcLbAdfKUVW08nKHbmO7A/GLqoxEnBbSiHVosDCIOm8fpEbdFz+3t yMusmbnkkJd11U4BV5HvMqiDk/e2tVdn6oauF1610/l98nC0/xFMZN0SVqFWRBcRJpaS VHvczgOk+Yc0uC1zFYSNewqnv0YkmmYPP/tRNPYBbly6nOhopjN5LJG+zu8ZIB1QQZr1 +CMucnmp5B7WLOwAkq1dvih4WBBV7X1JcG5BBA6wZSCvnQyQbqtwrjF3YUQXbROFQoIu PVTF4I/I9Vt451rZG85w3AysCJDTL9DLOHz+daofetkgvtjBtu39NyM0AjOATs0W/z94 UDNw== X-Gm-Message-State: ACrzQf0nsVQZFwXkc0l0MLGBRlexaz4WI6CVfQW/35ptxrmOxwmK94kx qgmy4pn0dRY6EdmjxG5Pw6wvd0JFEj0= X-Google-Smtp-Source: AMsMyM6Bybzx8ziehzGK4H0uD/lTjFFb9gMprjJI9qfbXQvIC79dfc2+xdw5v13RDnW/pDuir9PAMA== X-Received: by 2002:a05:620a:28ce:b0:6cf:933c:40d3 with SMTP id l14-20020a05620a28ce00b006cf933c40d3mr2573057qkp.258.1665120465819; Thu, 06 Oct 2022 22:27:45 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1005]) by smtp.gmail.com with ESMTPSA id y23-20020a376417000000b006bb49cfe147sm1078294qkb.84.2022.10.06.22.27.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Oct 2022 22:27:45 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 7 Oct 2022 01:27:38 -0400 Message-Id: <20221007052738.20637-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::734; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x734.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi! The following fixes a usability issue, which is that users entering 'guix shell' or 'guix environment' would not have any visual feedback in the prompt about where they are. I've tested it on three different foreign distributions, and it worked well on all of them. Thanks, Maxim Cournoyer (3): guix-install.sh: Improve prompt_yes_no procedure. guix-install.sh: Introduce 'die' utility function. guix-install.sh: Add Bash prompt customization option. etc/guix-install.sh | 69 +++++++++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 21 deletions(-) -- 2.37.3 From unknown Sun Aug 10 10:54:22 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58345] [PATCH 2/3] guix-install.sh: Introduce 'die' utility function. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Oct 2022 05:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58345 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58345@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58345-submit@debbugs.gnu.org id=B58345.16651207357546 (code B ref 58345); Fri, 07 Oct 2022 05:33:01 +0000 Received: (at 58345) by debbugs.gnu.org; 7 Oct 2022 05:32:15 +0000 Received: from localhost ([127.0.0.1]:34022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogfy2-0001xe-Pv for submit@debbugs.gnu.org; Fri, 07 Oct 2022 01:32:15 -0400 Received: from mail-qt1-f173.google.com ([209.85.160.173]:42939) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogfy0-0001xJ-Kf for 58345@debbugs.gnu.org; Fri, 07 Oct 2022 01:32:13 -0400 Received: by mail-qt1-f173.google.com with SMTP id w28so294708qtv.9 for <58345@debbugs.gnu.org>; Thu, 06 Oct 2022 22:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/4gYhSSvxypjpII3diEaFAK8wifRCAsT//Bt3d9tWtw=; b=o2qTVqKOx3YUa3iMScFG0mmgogYQC9oJnm9P0OIi3lYKbaqZmXOnVnZQhv5X1fT645 7KXmg0kIonfpw9kSXVPLXW0W2YVyUWsV9+VF7AfhMFZWx8aLd3vn6VKKb3tMRNE50oLG aodQiBn97DRVwmlJLZAIRdWNNmwTg4XTej5BCEN+vmvwInHGb1JH2IN9q8FBIkJ4JXDR YrmsJ1NM/XnL2VqEAarc+ceO+8zJ5X4ynJCJnUes5oIlfJlcIdXER+U85dgiXvpI2dhT g5zxbuJwQ9X6QA4JkltQl5G23YP67Nc3h9wcqlw8g17ud1A9ycoL4qo2QZAeKbKhf17n uO8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/4gYhSSvxypjpII3diEaFAK8wifRCAsT//Bt3d9tWtw=; b=542E/5gLsPtOZnvdyZeFGV7nih2nUQkpnNu3AMPM/Cp9E2O8nG2/zeP+0rfjI/ZnFP emP6SwLr6+DgAkD3KiHNIWw28mt0Kqpuyja1SdVkk67Xm8zee8PThVSwjvnKVcsJhYDb yjUP/UFLDZcjDp0njiGewzancDu0bhDIUKwJ/1qWoeytJpKg8d/dhGDYyj33lJzqVyUq y6FD+7V5V04C1tLcBIpwkPwFKviDUoHjnDJJm9UxJnc43V3r6rWy1UHbnJrUTS6dCWg5 4+txBKYTKWyBAp0YmcGyONRKhg6+1uciSRY59U3cRBASKtXtLFMNx1dpgicRLOIGtQRn NFKQ== X-Gm-Message-State: ACrzQf2XLP3VB5S/m0UJZ4pPHTLMXzaU2hYxpMLqJ7BwqqZk7ayHoUrS e5DhsZA2etdUTgl9YvmLHRWdnuiCJEc= X-Google-Smtp-Source: AMsMyM6LBewZEfqWNFP9o3RHo3z7Ed3uKzc6i0KTEOC80D/f2fb7Lv/GPuVNBkfoIIieQUSR/HJU7A== X-Received: by 2002:a05:622a:2c8:b0:391:b8ab:c281 with SMTP id a8-20020a05622a02c800b00391b8abc281mr3086306qtx.188.1665120727012; Thu, 06 Oct 2022 22:32:07 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1005]) by smtp.gmail.com with ESMTPSA id ff13-20020a05622a4d8d00b0035d420c4ba7sm1367801qtb.54.2022.10.06.22.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Oct 2022 22:32:06 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 7 Oct 2022 01:31:59 -0400 Message-Id: <20221007053200.21177-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221007053200.21177-1-maxim.cournoyer@gmail.com> References: <20221007053200.21177-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * etc/guix-install.sh (die): New function. (chk_sys_arch): Use it. (guix_get_bin_list, guix_get_bin, sys_create_store): Likewise. --- etc/guix-install.sh | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 8c05d19657..6bf70b7941 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -99,6 +99,11 @@ _flush() done } +die() +{ + _err "${ERR}$*" +} + # Return true if user answered yes, false otherwise. It defaults to "yes" # when a single newline character is input. # $1: The prompt question. @@ -230,8 +235,7 @@ chk_sys_arch() local arch=powerpc64le ;; *) - _err "${ERR}Unsupported CPU type: ${arch}" - exit 1 + die "Unsupported CPU type: ${arch}" esac case "$os" in @@ -239,8 +243,7 @@ chk_sys_arch() local os=linux ;; *) - _err "${ERR}Your operation system (${os}) is not supported." - exit 1 + die "Your operation system (${os}) is not supported." esac ARCH_OS="${arch}-${os}" @@ -295,8 +298,7 @@ guix_get_bin_list() if [[ "${#bin_ver_ls}" -ne "0" ]]; then _msg "${PAS}Release for your system: ${default_ver}" else - _err "${ERR}Could not obtain list of Guix releases." - exit 1 + die "Could not obtain list of Guix releases." fi # Use default to download according to the list and local ARCH_OS. @@ -321,8 +323,7 @@ guix_get_bin() "${url}/${bin_ver}.tar.xz" "${url}/${bin_ver}.tar.xz.sig"; then _msg "${PAS}download completed." else - _err "${ERR}could not download ${url}/${bin_ver}.tar.xz." - exit 1 + die "could not download ${url}/${bin_ver}.tar.xz." fi pushd "${dl_path}" >/dev/null @@ -330,8 +331,7 @@ guix_get_bin() _msg "${PAS}Signature is valid." popd >/dev/null else - _err "${ERR}could not verify the signature." - exit 1 + die "could not verify the signature." fi } @@ -343,8 +343,7 @@ sys_create_store() _debug "--- [ ${FUNCNAME[0]} ] ---" if [[ -e "/var/guix" || -e "/gnu" ]]; then - _err "${ERR}A previous Guix installation was found. Refusing to overwrite." - exit 1 + die "A previous Guix installation was found. Refusing to overwrite." fi cd "$tmp_path" -- 2.37.3 From unknown Sun Aug 10 10:54:22 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58345] [PATCH 1/3] guix-install.sh: Improve prompt_yes_no procedure. References: <20221007052738.20637-1-maxim.cournoyer@gmail.com> In-Reply-To: <20221007052738.20637-1-maxim.cournoyer@gmail.com> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Oct 2022 05:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58345 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58345@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58345-submit@debbugs.gnu.org id=B58345.16651207407566 (code B ref 58345); Fri, 07 Oct 2022 05:33:02 +0000 Received: (at 58345) by debbugs.gnu.org; 7 Oct 2022 05:32:20 +0000 Received: from localhost ([127.0.0.1]:34025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogfy4-0001xs-60 for submit@debbugs.gnu.org; Fri, 07 Oct 2022 01:32:19 -0400 Received: from mail-qt1-f179.google.com ([209.85.160.179]:37570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogfxy-0001xG-31 for 58345@debbugs.gnu.org; Fri, 07 Oct 2022 01:32:13 -0400 Received: by mail-qt1-f179.google.com with SMTP id l27so2269573qtv.4 for <58345@debbugs.gnu.org>; Thu, 06 Oct 2022 22:32:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=rWhULu6LKnURKBcVWW85jL0NDjjMvJLC8Ae3SIK7RQ8=; b=KSkB+OyjXSQg6Y7XDc5QiORLa7rUGO8PYC9DR8z8Hq5f6iBkdMcX6z6lOd3b1+qOMn YcrtcbpB7KIQx0aPe924V5WtVm3IwHLYigA45Z8S1bTz9RBw4YdJlY+lFULINoDuB8N2 PtlOEAXjVR5HJsJIcuhURyEaKjn57fMO+aPA0dsSA7Yls3fAIiC5wz4DmQzRaM3pSgiV zhSvG54gyhBt5xFKLDI51vasly4jYpFAZnPEXAJM7QOh7TvCPAvuuHv1rW6d9YbxfNy1 uAmtbHlZD2hh230H1RzI1bAA8wEvJG9GINcw66xM3rSzz6o5iube5wBlXlb6uDUm6ORR 34kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rWhULu6LKnURKBcVWW85jL0NDjjMvJLC8Ae3SIK7RQ8=; b=nnK18Mv6YpOv+ZtrS3kScn9h7uLfmsI+hm2Z3AVuf8/vsVKZDPXdJo+LBjkRQLJ0Df YtBNOKsiVBawCki8WDfk1KmDqakCW3EAWYVwFsKx9Imq7BOUG+9EeKrYZhai193Z/Qyh ZccN1KRYU1+s9rzuEhTT4CwAajJrjcqZfHgv9Vod8/Z2HBNa5TaMdQCeeOwj0cM7ay6w wcnVfn0UZkCxLKq08yU4m1MYLTpZhXqFeg7+zIhq29G4ZP/cPiKxOMHh/IxuRTBKBBtb 1WGUXLFEAeQ8ZfOtPXJnr7/rZvQCTINjiCicaX0sl8eQoFx7x0lJ30SjLzNeLOezUmKO kJHg== X-Gm-Message-State: ACrzQf1W64SxF+1e0aOPZuseBCxpoI1HjQcQBhruAMfJYSn6fizrDl05 rbGnZeFf9sRmv2cuP2CstTV909O/NiE= X-Google-Smtp-Source: AMsMyM69M5Irde1k0F8QQZGgKhxa+HH6Qd57P9ZaJL9lr2hX2EABJXLB2wkKucmabduN2Ml8VZ/QIw== X-Received: by 2002:a05:622a:1181:b0:35b:b57d:fb14 with SMTP id m1-20020a05622a118100b0035bb57dfb14mr2974524qtk.605.1665120724402; Thu, 06 Oct 2022 22:32:04 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1005]) by smtp.gmail.com with ESMTPSA id ff13-20020a05622a4d8d00b0035d420c4ba7sm1367801qtb.54.2022.10.06.22.32.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Oct 2022 22:32:03 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 7 Oct 2022 01:31:58 -0400 Message-Id: <20221007053200.21177-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * etc/guix-install.sh (_flush): New function. (prompt_yes_no): Clear input, then only read the first character, silently. Add the [Yes/no] string to the message. When a newline is entered by the user, treat it as the default value, which is "yes". (chk_gpg_keyring): Remove "(yes/no)" from the prompt message. (configure_substitute_discovery): Likewise. (sys_authorize_build_farms): Likewise. --- etc/guix-install.sh | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 300681e111..8c05d19657 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -9,7 +9,7 @@ # Copyright © 2020 Daniel Brooks # Copyright © 2021 Jakub Kądziołka # Copyright © 2021 Chris Marusich -# Copyright © 2021 Maxim Cournoyer +# Copyright © 2021, 2022 Maxim Cournoyer # # This file is part of GNU Guix. # @@ -92,15 +92,25 @@ _debug() fi } -# Return true if user answered yes, false otherwise. +_flush() +{ + while read -t0; do + read -N1 + done +} + +# Return true if user answered yes, false otherwise. It defaults to "yes" +# when a single newline character is input. # $1: The prompt question. prompt_yes_no() { while true; do - read -rp "$1 " yn + _flush + read -N1 -rsp "$1 [Y/n]" yn case $yn in - [Yy]*) return 0;; - [Nn]*) return 1;; - *) _msg "Please answer yes or no." + $'\n') echo && return 0;; + [Yy]*) echo && return 0;; + [Nn]*) echo && return 1;; + *) echo && _msg "Please answer yes or no." esac done } @@ -137,7 +147,7 @@ chk_gpg_keyring() if ! gpg --dry-run --list-keys "$gpg_key_id" >/dev/null 2>&1; then if prompt_yes_no "${INF}The following OpenPGP public key is \ required to verify the Guix binary signature: $gpg_key_id. -Would you like me to fetch it for you? (yes/no)"; then +Would you like me to fetch it for you?"; then wget "https://sv.gnu.org/people/viewgpg.php?user_id=$user_id" \ --no-verbose -O- | gpg --import - else @@ -254,7 +264,7 @@ chk_sys_nscd() configure_substitute_discovery() { if grep -q -- '--discover=no' "$1" && \ prompt_yes_no "Would you like the Guix daemon to automatically \ -discover substitute servers on the local network? (yes/no)"; then +discover substitute servers on the local network?"; then sed -i 's/--discover=no/--discover=yes/' "$1" fi } @@ -490,7 +500,7 @@ sys_enable_guix_daemon() sys_authorize_build_farms() { # authorize the public key of the build farm if prompt_yes_no "Permit downloading pre-built package binaries from the \ -project's build farm? (yes/no)"; then +project's build farm?"; then guix archive --authorize \ < ~root/.config/guix/current/share/guix/ci.guix.gnu.org.pub \ && _msg "${PAS}Authorized public key for ci.guix.gnu.org" -- 2.37.3 From unknown Sun Aug 10 10:54:22 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58345] [PATCH 3/3] guix-install.sh: Add Bash prompt customization option. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Oct 2022 05:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58345 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58345@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58345-submit@debbugs.gnu.org id=B58345.16651207407572 (code B ref 58345); Fri, 07 Oct 2022 05:33:02 +0000 Received: (at 58345) by debbugs.gnu.org; 7 Oct 2022 05:32:20 +0000 Received: from localhost ([127.0.0.1]:34027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogfy8-0001xz-0Z for submit@debbugs.gnu.org; Fri, 07 Oct 2022 01:32:20 -0400 Received: from mail-qt1-f181.google.com ([209.85.160.181]:42948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogfy3-0001xP-HQ for 58345@debbugs.gnu.org; Fri, 07 Oct 2022 01:32:15 -0400 Received: by mail-qt1-f181.google.com with SMTP id w28so294737qtv.9 for <58345@debbugs.gnu.org>; Thu, 06 Oct 2022 22:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GXYGEE/LAq25O6/U8RO/+TCp1qXafjutwUabAClZ0ec=; b=bWpwcJyaeQXwReUuYWNQKjL0eK/nzj4UtS0tN1gSxtemd3htt5ynlJ1lem25R4UphX ecxljdf3cs6q50k+ufW4bLy3rebDMrIjqq0KKwablGGRbKd0NRam2ZoKVZiU1LxBAT2V kIXTANxum4EES7MErtodUX0YXmdUFKIEUm5c7FXS8Ab1hIkmySUNEbsW4sZFWleJ3LkG /JRdvnfCCxyjTaRKB0+ozFXYaThxEiCbhtzuak/P/Xiout3st7EohGYj7Tzx/4d4ct1r /g7ZQfOHuaWmisM3fhBJJDqy/xI01m8yjJOeFdLSVFO2y/Tn5oqzgjR1DyfCZmBAAa8j yPug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GXYGEE/LAq25O6/U8RO/+TCp1qXafjutwUabAClZ0ec=; b=njfPe8jX+ftMW03UG5KqEctbz7NfQekNmmE6t2/v5WJojiQ/8F9jwRBsqHQN46IegK l5WhA+dxBcHGU5/8tYq2pZ1pQjHw79/6NylMjeUE93GALYnx4gmWiQ2N2q0ijM+7gzSr u1ZXsmRGoQ+KSYx0swdEMcTVklxsQCKV8FLNqSq6MEXrm4Ph5mAt/2ZML+H4M51klyjH EdEdTmuPsDAdll0gXr3nmWDQzHkg/3aE6tW1ggaff5VX9f5x7qhi7igwaPTTswszipUV L3p69gbrvQmdRLvu71b/IrfwRzKeiG1bTWr9aq7ojOwGj54/QslNnW/c3UM5Xb0ZtEiN i/lA== X-Gm-Message-State: ACrzQf2tWOFjUKU8RFPn1ng8GXp6mJYT0ZBVyfIzpYeQTpsfAiNaCv/l GS3cVHO8whNUL1jdFTBXq4a1Ap5+7oQ= X-Google-Smtp-Source: AMsMyM7pRYG2yIDGKxajsnVM18XCo8xDrQuxjj4VhM9BTSrP7fUiUg6B0msUPnKaJ9yfnxAalBn2gw== X-Received: by 2002:ac8:5745:0:b0:35c:9f9b:9d56 with SMTP id 5-20020ac85745000000b0035c9f9b9d56mr3008906qtx.103.1665120729975; Thu, 06 Oct 2022 22:32:09 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1005]) by smtp.gmail.com with ESMTPSA id ff13-20020a05622a4d8d00b0035d420c4ba7sm1367801qtb.54.2022.10.06.22.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Oct 2022 22:32:09 -0700 (PDT) From: Maxim Cournoyer Date: Fri, 7 Oct 2022 01:32:00 -0400 Message-Id: <20221007053200.21177-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221007053200.21177-1-maxim.cournoyer@gmail.com> References: <20221007053200.21177-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * etc/guix-install.sh (sys_customize_bashrc): New function. (main): Use it. --- etc/guix-install.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 6bf70b7941..2b304d1bdc 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -566,6 +566,23 @@ sys_create_shell_completion() _msg "${PAS}installed shell completion" } +sys_customize_bashrc() +{ + prompt_yes_no "Customize users Bash shell prompt for Guix?" || return + for bashrc in /home/*/.bashrc /root/.bashrc; do + test -f "$bashrc" || continue + grep -Fq '$GUIX_ENVIRONMENT' "$bashrc" && continue + cp "${bashrc}" "${bashrc}.bak" + echo ' +if [ -n "$GUIX_ENVIRONMENT" ]; then + if [[ $PS1 =~ (.*)"\\$" ]]; then + PS1="${BASH_REMATCH[1]} [env]\\\$ " + fi +fi +' >> "$bashrc" + done + _msg "${PAS}Bash shell prompt successfully customized for Guix" +} welcome() { @@ -635,6 +652,7 @@ main() sys_authorize_build_farms sys_create_init_profile sys_create_shell_completion + sys_customize_bashrc _msg "${INF}cleaning up ${tmp_path}" rm -r "${tmp_path}" -- 2.37.3 From unknown Sun Aug 10 10:54:22 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58345] [PATCH 3/3] guix-install.sh: Add Bash prompt customization option. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Oct 2022 08:35:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58345 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer , 58345@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58345-submit@debbugs.gnu.org id=B58345.166513169625167 (code B ref 58345); Fri, 07 Oct 2022 08:35:03 +0000 Received: (at 58345) by debbugs.gnu.org; 7 Oct 2022 08:34:56 +0000 Received: from localhost ([127.0.0.1]:34290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogiop-0006Xm-Ez for submit@debbugs.gnu.org; Fri, 07 Oct 2022 04:34:55 -0400 Received: from mail-wr1-f43.google.com ([209.85.221.43]:35625) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogiok-0006XO-UB for 58345@debbugs.gnu.org; Fri, 07 Oct 2022 04:34:53 -0400 Received: by mail-wr1-f43.google.com with SMTP id u10so6186905wrq.2 for <58345@debbugs.gnu.org>; Fri, 07 Oct 2022 01:34:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=xlBE2sUINYRmyO29mdT+YH5bHrFMg3YCMCLET3SWigo=; b=jGKXHAki/t3kgYHX7EWfhoydsgFrDNtiJTTZGV+zs+Vhr8M5r7cdeA/YzafHuhe5h5 kEcKbZfYTBm9Nlo6znvFsS8IJLQuOQlE2cji3lgt7uJWQksok1x8OVZvuUdn748qHleb +Eq6B1avbr7oHaqYWLJiaOKffiwuuyZnYvTgkvU7BH62XOJKJ7q4UYtLRZ9XuESgHw94 KJppnFfx1+ptWzTHSmvIScnND2UoXQ4RV9+HCNGnSNyMHshe2T6QMxrayTkyUNfBMo9i 6lQTIk4xQWDl5FP8nArrI6iBxnUzOj1pjwvbVfUZhkSShtaRqw9WeIqlImsMMnkTDtcm eceg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xlBE2sUINYRmyO29mdT+YH5bHrFMg3YCMCLET3SWigo=; b=WO+qzaomMhmyACMDeT+KQXFwM6WC6ZwsPCJCVrira7IuKsrsKQMCop2M5g88jkaQij NItlKiGNqhouvRMktwmHobAAXqqNmgMSoLpmGxjv7UH5DBh0hWeKnGCnqJdU/bXOuS9S 7CAifKBGbaryNm8vD2TF6zIFIqltrik5VAZNhGPehe598vGRJlMxb4SoaHjcly+oV1gl KfU8NBeu6kue69Blfs2u9s1DfB58AfA0vIAfYff2vb6yVfgd5hn2xR3YxLYa5fYlmOjt TXl01SwONzUAYqEHRpULCpEmEFWiNf3uH3sqUHAB73sHrLw3fMQ69RdsiP3qm4LAaSEq jUog== X-Gm-Message-State: ACrzQf1LTjT/k4W/iLMhsBGXMCx2MPn7aIqM718ziDtZTnW9qGGkp98I G0WpM+VjCdibMn/0FTcx/TLnr4TuE4Y= X-Google-Smtp-Source: AMsMyM71UAv5OP9II3gfdr4+1sP/5PaEQn/eCKOmDzYDCFSczgwUJKMvUEQEfXO2C1TT7OE56AY57w== X-Received: by 2002:adf:d1cb:0:b0:22a:eae5:5c45 with SMTP id b11-20020adfd1cb000000b0022aeae55c45mr2423963wrd.255.1665131685264; Fri, 07 Oct 2022 01:34:45 -0700 (PDT) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id i30-20020a1c541e000000b003b486027c8asm7189367wmb.20.2022.10.07.01.34.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 01:34:44 -0700 (PDT) From: zimoun In-Reply-To: <20221007053200.21177-3-maxim.cournoyer@gmail.com> References: <20221007053200.21177-1-maxim.cournoyer@gmail.com> <20221007053200.21177-3-maxim.cournoyer@gmail.com> Date: Fri, 07 Oct 2022 10:34:30 +0200 Message-ID: <87pmf4t4kp.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Maxim, On ven., 07 oct. 2022 at 01:32, Maxim Cournoyer wrote: > * etc/guix-install.sh (sys_customize_bashrc): New function. > (main): Use it. Nice idea! > +sys_customize_bashrc() > +{ > + prompt_yes_no "Customize users Bash shell prompt for Guix?" || return > + for bashrc in /home/*/.bashrc /root/.bashrc; do > + test -f "$bashrc" || continue > + grep -Fq '$GUIX_ENVIRONMENT' "$bashrc" && continue > + cp "${bashrc}" "${bashrc}.bak" > + echo ' Maybe comment, something like: # Automatically added by Guix install script > +if [ -n "$GUIX_ENVIRONMENT" ]; then > + if [[ $PS1 =~ (.*)"\\$" ]]; then > + PS1="${BASH_REMATCH[1]} [env]\\\$ " > + fi > +fi > +' >> "$bashrc" > + done > + _msg "${PAS}Bash shell prompt successfully customized for Guix" > +} LGTM! Cheers, simon From unknown Sun Aug 10 10:54:22 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58345] [PATCH 2/3] guix-install.sh: Introduce 'die' utility function. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Oct 2022 08:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58345 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer , 58345@debbugs.gnu.org Cc: Maxim Cournoyer Received: via spool by 58345-submit@debbugs.gnu.org id=B58345.166513170825227 (code B ref 58345); Fri, 07 Oct 2022 08:36:02 +0000 Received: (at 58345) by debbugs.gnu.org; 7 Oct 2022 08:35:08 +0000 Received: from localhost ([127.0.0.1]:34295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogip0-0006Yo-Tj for submit@debbugs.gnu.org; Fri, 07 Oct 2022 04:35:08 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:41586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogioj-0006XM-Qb for 58345@debbugs.gnu.org; Fri, 07 Oct 2022 04:35:05 -0400 Received: by mail-wr1-f47.google.com with SMTP id bu30so6158303wrb.8 for <58345@debbugs.gnu.org>; Fri, 07 Oct 2022 01:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=7UxJAuSDvvQJ8SF5yloXk6yJ1/PsQDYjEgTqRsk7QlA=; b=Q6LO3h5ecZptD+WMFJmUTviHAvBeuSw3p04EeeNAXvBBDsnZiRXb+pn79y6nUAezAp gY6GZarELnM2V7quU71q7cS+L8A6QUTbAutAXTe4TWFW58TqqPm3CaZ4YxC52wwsUWLY TirlM7W4L931wVir9h7grVADnfU4snTpPfckakWM+l+9YhKU3w2sVFHvMgNuSmU0EtBR Kn3KfRvft2jrlislM9GMrx1dLrmlW2a1/G7pSfZv9zXRFl/B9I4jzxeIWgL4f8ldDmgK l0CLmKigwZ2rtObWIQgwSkNkZniEl6Q8sx/PA99CYpkakW1untUQGbRmWEFyFCTLh7mR gY8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=7UxJAuSDvvQJ8SF5yloXk6yJ1/PsQDYjEgTqRsk7QlA=; b=NbPSA0WFY5LctS+BaaPcsis+Gdjx6fmIuoC89+oS36PdZVijxyRuBIoQoOU1hRaoFN qvzTGnMDBmpjqNzzRfS/OtaglicfJSZER2p+QWqdQ9cQwzwCHmCvlE5uSNl+4CECUG+4 86QCqS3zPY6eLqYPrwg8GgzcIvdwUxvvPWTpVb6fjJWN6JhoBQxW8xAUPq5pgzSzZvuj E7uADuWznDvtTYRRdSY3kGTVD2liGBFJEZsGx614betSvym1OlxlcjMYoUCNs3xmvCBH bBo5rUMrbSqas1fHQZwjN6nQR2N/r/vZ7Oh0rbdOJ8X1R1mXPk7fQsr1tuOIUav/zjRD 6BAQ== X-Gm-Message-State: ACrzQf1S6AHA5iBtNBDnap8BTOEvKNTPVjI1mmuqyzULCcDQfj+BfYb/ wznUpdNOtIgrOU8+sBi1tZwmGqOKqSE= X-Google-Smtp-Source: AMsMyM4T38mwVRC2Zdvmbba0IFzvLb9x8aEvEstZu8oXZPDRErXfEJO2gL8mxBYVEPp3qZqVUSi4zg== X-Received: by 2002:a05:6000:52:b0:22e:5894:e212 with SMTP id k18-20020a056000005200b0022e5894e212mr2351494wrx.266.1665131684182; Fri, 07 Oct 2022 01:34:44 -0700 (PDT) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id a8-20020a1cf008000000b003a6a3595edasm1555226wmb.27.2022.10.07.01.34.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 01:34:43 -0700 (PDT) From: zimoun In-Reply-To: <20221007053200.21177-2-maxim.cournoyer@gmail.com> References: <20221007053200.21177-1-maxim.cournoyer@gmail.com> <20221007053200.21177-2-maxim.cournoyer@gmail.com> Date: Fri, 07 Oct 2022 10:30:47 +0200 Message-ID: <87v8owt4qw.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Maxim, On ven., 07 oct. 2022 at 01:31, Maxim Cournoyer = wrote: > +die() > +{ > + _err "${ERR}$*" > +} > + [...] > - _err "${ERR}Unsupported CPU type: ${arch}" > - exit 1 > + die "Unsupported CPU type: ${arch}" This new script using =E2=80=99die=E2=80=99, does it exit correctly and ret= urn an appropriated exit code on failure? Cheers, simon From unknown Sun Aug 10 10:54:22 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58345] [PATCH 2/3] guix-install.sh: Introduce 'die' utility function. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Oct 2022 12:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58345 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: 58345@debbugs.gnu.org Received: via spool by 58345-submit@debbugs.gnu.org id=B58345.166514539117444 (code B ref 58345); Fri, 07 Oct 2022 12:24:02 +0000 Received: (at 58345) by debbugs.gnu.org; 7 Oct 2022 12:23:11 +0000 Received: from localhost ([127.0.0.1]:34677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogmNi-0004XI-V1 for submit@debbugs.gnu.org; Fri, 07 Oct 2022 08:23:11 -0400 Received: from mail-qt1-f178.google.com ([209.85.160.178]:47032) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogmNh-0004X5-Cb for 58345@debbugs.gnu.org; Fri, 07 Oct 2022 08:23:09 -0400 Received: by mail-qt1-f178.google.com with SMTP id hh9so2638982qtb.13 for <58345@debbugs.gnu.org>; Fri, 07 Oct 2022 05:23:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=JgWRf5W6azpLPYkF4uUqdMN7uRuzvHmqaEqCsaCK3I0=; b=RwziynJuZE+tXCq4Aas2nYcrn98PtlYYKiLrukyLyNeIOPptZauohRk2wywTBkBfeV tKZg+Sr+aEu33pFW4frmowIELs3cpIvPktfEkksAl0eop6B7dloIFEYSpO5LEnPGDvs0 t/hvLuUtPfcg245giFj2kTOJPkNiWahec5udqCZGOSTNxckyu2kVda6lREJOO/eK09yo LwFkYE2uY3bpL/y5EiRwrMx3X5eVQIcMZhdlmqBvQliJf+yKDIVd9xrHDueLb/uSoia2 oy0YqW7lq0dwMCzN/1XRXRELiHLd9QvQnNqPe8TATEXjfqtukw47axvg6cJE9FkKG1oE IlMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=JgWRf5W6azpLPYkF4uUqdMN7uRuzvHmqaEqCsaCK3I0=; b=h9mKJ3apxaokjShhhx3m/G0uNMXVRuLSuCvbMImBLOaa8vxqchYSEwzWS9gLkYR14a Jo0inugJ3K3p7HhrYaiMaYu3E5RnoVr0A+wwjEBsnsae0a2QzmLQTqUBbQIhQzjsoqKC 8/XNyrEwMXV1MnogUM/1UyFes6RDPwGfA/wxilDXK2a39b0CHOJdhhqiBe2aY4YUZf6J LEftU/qA0hpTtWWnwEamCIxofaSWThaJ5o1bQJung9f0IGrmO9NSzuAlnBUaaXzw+eZD FjIFjVlz6cHoRyM7OSZvajNJD943vrxmphUMdGjedPqOGKRCQ4GuAPTGthWBcKjSWYqb j2EA== X-Gm-Message-State: ACrzQf1ez92IkD25mrR2FDnNbRV/4fN4e8s6v6lDixa4L7KWvgdhTfHZ rZwrtCxOi66nlxsrOTGmK8cr0bt4R9E= X-Google-Smtp-Source: AMsMyM4ty53DIJ5TO1OB3Lg9+FQTc/1qcjNJZYyjqfZbnQCjA9a7+ehIQA01x9LEoA2hqx95SzhlEg== X-Received: by 2002:a05:622a:1190:b0:397:43cd:4ee with SMTP id m16-20020a05622a119000b0039743cd04eemr125846qtk.605.1665145383648; Fri, 07 Oct 2022 05:23:03 -0700 (PDT) Received: from hurd ([2607:fad8:4:3::1005]) by smtp.gmail.com with ESMTPSA id v13-20020a05622a188d00b0035a6b89412bsm2036631qtc.46.2022.10.07.05.23.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 05:23:03 -0700 (PDT) From: Maxim Cournoyer References: <20221007053200.21177-1-maxim.cournoyer@gmail.com> <20221007053200.21177-2-maxim.cournoyer@gmail.com> <87v8owt4qw.fsf@gmail.com> Date: Fri, 07 Oct 2022 08:23:02 -0400 In-Reply-To: <87v8owt4qw.fsf@gmail.com> (zimoun's message of "Fri, 07 Oct 2022 10:30:47 +0200") Message-ID: <875ygv7rh5.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, zimoun writes: > Hi Maxim, > > On ven., 07 oct. 2022 at 01:31, Maxim Cournoyer wrote: > >> +die() >> +{ >> + _err "${ERR}$*" >> +} >> + > > [...] > >> - _err "${ERR}Unsupported CPU type: ${arch}" >> - exit 1 >> + die "Unsupported CPU type: ${arch}" > > This new script using =E2=80=99die=E2=80=99, does it exit correctly and r= eturn an > appropriated exit code on failure? Good catch, I had forgotten to include "exit 1" after the _err call in die(). Fixed! --=20 Thanks, Maxim From unknown Sun Aug 10 10:54:22 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Maxim Cournoyer Subject: bug#58345: closed (Re: [bug#58345] [PATCH 3/3] guix-install.sh: Add Bash prompt customization option.) Message-ID: References: <871qrj7r7b.fsf@gmail.com> <20221007052738.20637-1-maxim.cournoyer@gmail.com> X-Gnu-PR-Message: they-closed 58345 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 58345@debbugs.gnu.org Date: Fri, 07 Oct 2022 12:30:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1665145802-18115-1" This is a multi-part message in MIME format... ------------=_1665145802-18115-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #58345: [PATCH 0/3] Customize PS1 on foreign distributions which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 58345@debbugs.gnu.org. --=20 58345: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D58345 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1665145802-18115-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 58345-done) by debbugs.gnu.org; 7 Oct 2022 12:29:05 +0000 Received: from localhost ([127.0.0.1]:34700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogmTR-0004gd-Gd for submit@debbugs.gnu.org; Fri, 07 Oct 2022 08:29:05 -0400 Received: from mail-qk1-f171.google.com ([209.85.222.171]:36767) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogmTP-0004g1-Td for 58345-done@debbugs.gnu.org; Fri, 07 Oct 2022 08:29:04 -0400 Received: by mail-qk1-f171.google.com with SMTP id i3so2755379qkl.3 for <58345-done@debbugs.gnu.org>; Fri, 07 Oct 2022 05:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=YSmrIG6VHeHPgiB/OARdYonWWgYXBdtkJ/GCEVB+JZk=; b=noPA5irP6/9q/RTGv9rbfiVSVsibOBpYrKYhUiEYEln83TdFYMM+5XrnWgF17iinHO 2JlEcUJAUrDmYSrnS0mrzNwlhZi3GtL+SunGNa3IE4ukw6DQHbPrNt40gA8qUwercUL5 9yNKanwwE9B8UCVToRCpMEnG+vFyZrYX+8hCweMjfjvBOR3nUzCXbTytiCOjUbqe2rKF jgg9W/DUw+rr9SDAOFn43EJPRDlC4bgo6+eoq+wSBtgHRVMPxy8PtoTMyWPkjxGYEIx4 W6v9wve83Y5AhYv553RYi3HVjUSALA4W5oG8nj4oXrDusoewzvQEjCDz7T5sAT+Cu3X7 87wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YSmrIG6VHeHPgiB/OARdYonWWgYXBdtkJ/GCEVB+JZk=; b=xbw2mGFsri8jbjksXXMxy3e0M/DkQFIa88+hiQ2uo/SYc90b0T3lyBgwhSgNR6kZ2p wS/7GlT1J07Y/gk0Gj6ZVdWMlxJ9QCvEfoifzeBzSGwJObY7N4lUg7wutOHy3lO8AocP wd75+7euaKRymdtlin4Q9AzbOTM967cKKVb91DRSYfqQgZPzT+7cNZuTqYfWjo1o2hkV avBsbtaoR5Xdo0RM19g0K+tSUeI6FcE9Nl6GvIeeOzJRc8AKEH20gaXkSLUc3SxT/LyH SQmFnkhen9VPKbqAgYRSdQs/f79aNgOQNpUKzMsKwQSTdnPY2tMwAaRGDnWs/axcYVRy AaOA== X-Gm-Message-State: ACrzQf3H9Q2epNTnXZafQWeSpHffjJ7dSufHdqustQ4DyaupJZlKjdqZ ZE4L+g1RNdxj26B8da6dyez/i12Td6NfOQ== X-Google-Smtp-Source: AMsMyM5rYo+WO2iUHHATn/3DTalCIB2IKumSIJVSAtZazdu9MI1Kq7HKGx5U/EA1yr21SSv7o6/23g== X-Received: by 2002:a37:9485:0:b0:6e2:b793:c469 with SMTP id w127-20020a379485000000b006e2b793c469mr3429034qkd.654.1665145738135; Fri, 07 Oct 2022 05:28:58 -0700 (PDT) Received: from hurd ([2607:fad8:4:3::1005]) by smtp.gmail.com with ESMTPSA id c7-20020ac85a87000000b00304fe5247bfsm2096714qtc.36.2022.10.07.05.28.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 05:28:57 -0700 (PDT) From: Maxim Cournoyer To: zimoun Subject: Re: [bug#58345] [PATCH 3/3] guix-install.sh: Add Bash prompt customization option. References: <20221007053200.21177-1-maxim.cournoyer@gmail.com> <20221007053200.21177-3-maxim.cournoyer@gmail.com> <87pmf4t4kp.fsf@gmail.com> Date: Fri, 07 Oct 2022 08:28:56 -0400 In-Reply-To: <87pmf4t4kp.fsf@gmail.com> (zimoun's message of "Fri, 07 Oct 2022 10:34:30 +0200") Message-ID: <871qrj7r7b.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58345-done Cc: 58345-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, zimoun writes: > Hi Maxim, > > On ven., 07 oct. 2022 at 01:32, Maxim Cournoyer wrote: >> * etc/guix-install.sh (sys_customize_bashrc): New function. >> (main): Use it. > > Nice idea! > >> +sys_customize_bashrc() >> +{ >> + prompt_yes_no "Customize users Bash shell prompt for Guix?" || return >> + for bashrc in /home/*/.bashrc /root/.bashrc; do >> + test -f "$bashrc" || continue >> + grep -Fq '$GUIX_ENVIRONMENT' "$bashrc" && continue >> + cp "${bashrc}" "${bashrc}.bak" >> + echo ' > > Maybe comment, something like: > > # Automatically added by Guix install script >> +if [ -n "$GUIX_ENVIRONMENT" ]; then >> + if [[ $PS1 =~ (.*)"\\$" ]]; then >> + PS1="${BASH_REMATCH[1]} [env]\\\$ " >> + fi >> +fi >> +' >> "$bashrc" >> + done >> + _msg "${PAS}Bash shell prompt successfully customized for Guix" >> +} Good idea! Applied, like: @@ -575,6 +575,7 @@ sys_customize_bashrc() grep -Fq '$GUIX_ENVIRONMENT' "$bashrc" && continue cp "${bashrc}" "${bashrc}.bak" echo ' +# Automatically added by the Guix install script. if [ -n "$GUIX_ENVIRONMENT" ]; then if [[ $PS1 =~ (.*)"\\$" ]]; then PS1="${BASH_REMATCH[1]} [env]\\\$ " > > LGTM! Alright, the series have been pushed to master, and the script available at https://guix.gnu.org/install.sh should soon reflect the changes. Thanks for reviewing! -- Maxim ------------=_1665145802-18115-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 7 Oct 2022 05:27:51 +0000 Received: from localhost ([127.0.0.1]:34015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogftn-0001jx-6Y for submit@debbugs.gnu.org; Fri, 07 Oct 2022 01:27:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:36596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogftl-0001jp-5o for submit@debbugs.gnu.org; Fri, 07 Oct 2022 01:27:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogftk-0002JW-TW for guix-patches@gnu.org; Fri, 07 Oct 2022 01:27:48 -0400 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:35408) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ogftj-0000UN-Gd for guix-patches@gnu.org; Fri, 07 Oct 2022 01:27:48 -0400 Received: by mail-qk1-x734.google.com with SMTP id q1so1007591qkm.2 for ; Thu, 06 Oct 2022 22:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=354TWF+/akU14W/40axi+iFF5rPpEpVhGMjyGhA/fAo=; b=lv24hoEolpDLOh8AQKcI57pfgrEL7v2QhYmZPUOsxhkeudEKWtSNNOstBwZ6+dHpgx Hg/BJTnSpZgYabxWipbMXKiNb5jxi1J0tcQ+wZpET4a9TKciCm5Gi49fKRFqW9xABNJO L9DutsPg4zugi41q2NIrSZo4PmmaQtG0MMvNp6A4cf1Gc0uZdzGvmmrbnDusp6v3Hbgf 97lZ4R09T52ixdiBcI0PYKfUP/YxuwwDoKdjqWbC82wg0Agv2VgKr9VeMg0dBVWPLTA3 WNSt4hjS5S4b67FOOWX++t4u7NohhBOdy2RcKYoAFeyjk9ePT0iOvnnmTSYDsSeV6Dzp HsaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=354TWF+/akU14W/40axi+iFF5rPpEpVhGMjyGhA/fAo=; b=7USdFdydZOvxdNcLbAdfKUVW08nKHbmO7A/GLqoxEnBbSiHVosDCIOm8fpEbdFz+3t yMusmbnkkJd11U4BV5HvMqiDk/e2tVdn6oauF1610/l98nC0/xFMZN0SVqFWRBcRJpaS VHvczgOk+Yc0uC1zFYSNewqnv0YkmmYPP/tRNPYBbly6nOhopjN5LJG+zu8ZIB1QQZr1 +CMucnmp5B7WLOwAkq1dvih4WBBV7X1JcG5BBA6wZSCvnQyQbqtwrjF3YUQXbROFQoIu PVTF4I/I9Vt451rZG85w3AysCJDTL9DLOHz+daofetkgvtjBtu39NyM0AjOATs0W/z94 UDNw== X-Gm-Message-State: ACrzQf0nsVQZFwXkc0l0MLGBRlexaz4WI6CVfQW/35ptxrmOxwmK94kx qgmy4pn0dRY6EdmjxG5Pw6wvd0JFEj0= X-Google-Smtp-Source: AMsMyM6Bybzx8ziehzGK4H0uD/lTjFFb9gMprjJI9qfbXQvIC79dfc2+xdw5v13RDnW/pDuir9PAMA== X-Received: by 2002:a05:620a:28ce:b0:6cf:933c:40d3 with SMTP id l14-20020a05620a28ce00b006cf933c40d3mr2573057qkp.258.1665120465819; Thu, 06 Oct 2022 22:27:45 -0700 (PDT) Received: from localhost.localdomain ([2607:fad8:4:3::1005]) by smtp.gmail.com with ESMTPSA id y23-20020a376417000000b006bb49cfe147sm1078294qkb.84.2022.10.06.22.27.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Oct 2022 22:27:45 -0700 (PDT) From: Maxim Cournoyer To: guix-patches@gnu.org Subject: [PATCH 0/3] Customize PS1 on foreign distributions Date: Fri, 7 Oct 2022 01:27:38 -0400 Message-Id: <20221007052738.20637-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::734; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x734.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi! The following fixes a usability issue, which is that users entering 'guix shell' or 'guix environment' would not have any visual feedback in the prompt about where they are. I've tested it on three different foreign distributions, and it worked well on all of them. Thanks, Maxim Cournoyer (3): guix-install.sh: Improve prompt_yes_no procedure. guix-install.sh: Introduce 'die' utility function. guix-install.sh: Add Bash prompt customization option. etc/guix-install.sh | 69 +++++++++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 21 deletions(-) -- 2.37.3 ------------=_1665145802-18115-1--