From patchwork Thu Feb 6 04:24:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liam Hupfer X-Patchwork-Id: 38301 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 76DA827BBEA; Thu, 6 Feb 2025 04:26:40 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 04CB527BBE2 for ; Thu, 6 Feb 2025 04:26:40 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tftSt-00009k-94; Wed, 05 Feb 2025 23:26:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tftSo-00009H-QE for guix-patches@gnu.org; Wed, 05 Feb 2025 23:26:07 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tftSn-0000wF-FO; Wed, 05 Feb 2025 23:26:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=gD9taRrXx1IHdbkvXIeQgchX6Q4e86rvdFcrPhkskMw=; b=T5XuXKUi47WZLGxKClceFoX48upB0SdwwS9a0V9HO67dwHgYYTtHVMeJh/uwOTh45GoFORSOzDa5A4IL1+wDACP7Pn9qNY/gzMQUIEukQ5IkZVLZicPOhKparnhJ/EMVUqw8PH6U7A2txzUZjsj6JWjssvcdM7SZAk7TvkjWYrAIh/pLcMS7nfWk76FVajy/jytKECY7PrQkgS21FdBa4aA+PJea6hCrMA48Jhgi0PxhcM5+20E0U6qfoEGtr9YXWSyvksAzdHluxBgLiViJOq6jRUbYwZGvM3bpclm3cg38v7tmuAYSdmXcxAHdkrk+R1neuvWP62SxO9hQHhoLdQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tftSk-0002TO-7U; Wed, 05 Feb 2025 23:26:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76082] [PATCH 1/9] home: services: setup-environment: Use GUIX_PROFILE. Resent-From: Liam Hupfer Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, janneke@gnu.org, ludo@gnu.org, tanguy@bioneland.org, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Thu, 06 Feb 2025 04:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76082 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76082@debbugs.gnu.org Cc: Liam Hupfer , Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian X-Debbugs-Original-Xcc: Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian Received: via spool by 76082-submit@debbugs.gnu.org id=B76082.17388159349466 (code B ref 76082); Thu, 06 Feb 2025 04:26:02 +0000 Received: (at 76082) by debbugs.gnu.org; 6 Feb 2025 04:25:34 +0000 Received: from localhost ([127.0.0.1]:53600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tftSI-0002Sb-EL for submit@debbugs.gnu.org; Wed, 05 Feb 2025 23:25:34 -0500 Received: from out-171.mta0.migadu.com ([91.218.175.171]:61196) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tftSF-0002SJ-6r for 76082@debbugs.gnu.org; Wed, 05 Feb 2025 23:25:32 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpfr.net; s=key1; t=1738815922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gD9taRrXx1IHdbkvXIeQgchX6Q4e86rvdFcrPhkskMw=; b=p4RMizB7o5M60y9P19QV7Ddfhoy0KDPMixW01lVVV8rD3qoMMd//owwUixdH2qbFuD1oze bDhERCumGx6bChV0dPphpmzGYr0vk3RA4DHOBpKY6eBTeFm5+VnkL9UhDrvpbXs60yKhiS 87RPP1rpx1xZs7nnpAgUaCMibbfIRe0OYqs0Ew17Se1zujixG+sHop+heuWr39BBtE/bmu VJqC4A5uC1Ir2idQ8Jtfg3EfoquSOLfIufpIWPnZltm8g5Dx/YpqO+JOMJHVwVhdspCbfg jB/ZS7LcaW8fGmN4gKo+0eF+l/lfXiUxNfpAoMjoJKvIZZ5P3BlNCSSXWo3JsQ== From: Liam Hupfer Date: Wed, 5 Feb 2025 22:24:57 -0600 Message-ID: <2094e26655b1bdd87417b090ddda9761a0458d38.1738815703.git.liam@hpfr.net> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches setup-environment already defines this variable. Use it since it’s more concise. * gnu/home/services.scm (environment-variables->setup-environment-script): Use GUIX_PROFILE. Change-Id: Ib75d8df6294976f4e95cfa7d607dc0ba21ddd258 --- gnu/home/services.scm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) base-commit: 52c05f3b120e641c8bd2d68cfcf0d6af947de27b diff --git a/gnu/home/services.scm b/gnu/home/services.scm index 39c9033ad6..bbf2ba2404 100644 --- a/gnu/home/services.scm +++ b/gnu/home/services.scm @@ -277,28 +277,28 @@ (define (environment-variables->setup-environment-script vars) (display "\ HOME_ENVIRONMENT=$HOME/.guix-home GUIX_PROFILE=\"$HOME_ENVIRONMENT/profile\" -PROFILE_FILE=\"$HOME_ENVIRONMENT/profile/etc/profile\" +PROFILE_FILE=\"$GUIX_PROFILE/etc/profile\" [ -f $PROFILE_FILE ] && . $PROFILE_FILE case $XDG_DATA_DIRS in - *$HOME_ENVIRONMENT/profile/share*) ;; - *) export XDG_DATA_DIRS=$HOME_ENVIRONMENT/profile/share:$XDG_DATA_DIRS ;; + *$GUIX_PROFILE/share*) ;; + *) export XDG_DATA_DIRS=$GUIX_PROFILE/share:$XDG_DATA_DIRS ;; esac case $MANPATH in - *$HOME_ENVIRONMENT/profile/share/man*) ;; - *) export MANPATH=$HOME_ENVIRONMENT/profile/share/man:$MANPATH + *$GUIX_PROFILE/share/man*) ;; + *) export MANPATH=$GUIX_PROFILE/share/man:$MANPATH esac case $INFOPATH in - *$HOME_ENVIRONMENT/profile/share/info*) ;; - *) export INFOPATH=$HOME_ENVIRONMENT/profile/share/info:$INFOPATH ;; + *$GUIX_PROFILE/share/info*) ;; + *) export INFOPATH=$GUIX_PROFILE/share/info:$INFOPATH ;; esac case $XDG_CONFIG_DIRS in - *$HOME_ENVIRONMENT/profile/etc/xdg*) ;; - *) export XDG_CONFIG_DIRS=$HOME_ENVIRONMENT/profile/etc/xdg:$XDG_CONFIG_DIRS ;; + *$GUIX_PROFILE/etc/xdg*) ;; + *) export XDG_CONFIG_DIRS=$GUIX_PROFILE/etc/xdg:$XDG_CONFIG_DIRS ;; esac case $XCURSOR_PATH in - *$HOME_ENVIRONMENT/profile/share/icons*) ;; - *) export XCURSOR_PATH=$HOME_ENVIRONMENT/profile/share/icons:$XCURSOR_PATH ;; + *$GUIX_PROFILE/share/icons*) ;; + *) export XCURSOR_PATH=$GUIX_PROFILE/share/icons:$XCURSOR_PATH ;; esac " port) From patchwork Thu Feb 6 04:24:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liam Hupfer X-Patchwork-Id: 38306 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 D388227BBEA; Thu, 6 Feb 2025 04:27:48 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 68C2927BBE2 for ; Thu, 6 Feb 2025 04:27:48 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tftTs-0000Rn-As; Wed, 05 Feb 2025 23:27:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tftTn-0000P7-0t for guix-patches@gnu.org; Wed, 05 Feb 2025 23:27:07 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tftTl-00017t-DC; Wed, 05 Feb 2025 23:27:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=Dwiy5+CqTIh8K5J1sqV4Ik5ui8H+88jsUR933dn+I0k=; b=naxjR2jkGgjABQzCX1C/Q0M1H1PnKa34PrvhAzkIsG3m3XS4JNRfX4LS5ZAzwXcHmYc43tsdk1M8WO4vTgViJwe1yC4abm0c+i/qsOxx8hWgfM8oKML+saXZHdfaC/qdOft3hoGJZzOKn9QH8/weW2ST5lp901AjgA7U+wgcu+PqCQQM2FODqNrkDELc/c93rq1tjtjWbSGJKCUJ8oOxqbrYr3YQRzheqzYwHbKV2U8Fy1RhXYjuH4KmmrMgaJcHHgsmTJjZwLD267TaDDl6QMaAjfoPk+xG6R3NW0ECvH7fACoOm+Un4FeDX8GebLPyF9PPgBtQy/UFDyNoIbGPOg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tftTh-0002X0-Po; Wed, 05 Feb 2025 23:27:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76082] [PATCH 2/9] home: services: Unset variables after profile init. Resent-From: Liam Hupfer Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, janneke@gnu.org, ludo@gnu.org, tanguy@bioneland.org, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Thu, 06 Feb 2025 04:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76082 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76082@debbugs.gnu.org Cc: Liam Hupfer , Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian X-Debbugs-Original-Xcc: Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian Received: via spool by 76082-submit@debbugs.gnu.org id=B76082.17388159689548 (code B ref 76082); Thu, 06 Feb 2025 04:27:01 +0000 Received: (at 76082) by debbugs.gnu.org; 6 Feb 2025 04:26:08 +0000 Received: from localhost ([127.0.0.1]:53608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tftSp-0002Tv-Tx for submit@debbugs.gnu.org; Wed, 05 Feb 2025 23:26:08 -0500 Received: from out-174.mta0.migadu.com ([2001:41d0:1004:224b::ae]:28123) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tftSo-0002TC-3R for 76082@debbugs.gnu.org; Wed, 05 Feb 2025 23:26:06 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpfr.net; s=key1; t=1738815953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Dwiy5+CqTIh8K5J1sqV4Ik5ui8H+88jsUR933dn+I0k=; b=ObfvIDr4abTluIOr8/doI+/kkUU18Udz3nUKD5BqataIqIFx6kqfpa8lY5WPyVnEJHkspC fa+2QUiVNVCd9f8KKnuywAixKvrTYtXojis3gODcY5fdS718Q7MdvjO1FluDiqaPauKxob v8Miwv1TVAwLnPBzbtLKf2QbJFK96MwM9RfBtWREcU4B0gUmBrhaN9YRoBEpb8tx4TMWte MOeuwz6J0ysZkSgdevBsou/oXmRx2TsvnGwDPtHN/vD+//UaHva4KJpDTcyWNiWd9rsmKf fUHFg/7gBvdiY/qXm19IrtKayXK4TEavWS9Bc+xqb/ZCoBNFnJ7u8eq4trTbnw== From: Liam Hupfer Date: Wed, 5 Feb 2025 22:24:58 -0600 Message-ID: <25ffb457020cb7ad0bbc9b9ff62736ed01ff0002.1738815703.git.liam@hpfr.net> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches While they aren’t exported, these temporary variables show up in the resulting shell, cluttering tab completion and declare -p. * gnu/home/services.scm (environment-variables->setup-environment-script): Unset shell variables. * gnu/home/services/shells.scm (add-shell-profile-file): Likewise. Change-Id: Ibb634849d9f38c1a9a44c0d493e92231364de958 --- gnu/home/services.scm | 6 +++++- gnu/home/services/shells.scm | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gnu/home/services.scm b/gnu/home/services.scm index bbf2ba2404..165bc33b05 100644 --- a/gnu/home/services.scm +++ b/gnu/home/services.scm @@ -275,7 +275,8 @@ (define (environment-variables->setup-environment-script vars) (lambda (port) (set-port-encoding! port "UTF-8") (display "\ -HOME_ENVIRONMENT=$HOME/.guix-home +# NOTE: Set HOME_ENVIRONMENT before sourcing (home-shell-profile-service-type ensures +# ~/.profile does) GUIX_PROFILE=\"$HOME_ENVIRONMENT/profile\" PROFILE_FILE=\"$GUIX_PROFILE/etc/profile\" [ -f $PROFILE_FILE ] && . $PROFILE_FILE @@ -301,6 +302,9 @@ (define (environment-variables->setup-environment-script vars) *) export XCURSOR_PATH=$GUIX_PROFILE/share/icons:$XCURSOR_PATH ;; esac +# Keep the shell environment clean. +unset GUIX_PROFILE PROFILE_FILE + " port) (display #$(environment-variable-shell-definitions vars) diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm index ee6b09f17c..bab5730c3d 100644 --- a/gnu/home/services/shells.scm +++ b/gnu/home/services/shells.scm @@ -89,7 +89,8 @@ (define (add-shell-profile-file config) "\ HOME_ENVIRONMENT=$HOME/.guix-home . $HOME_ENVIRONMENT/setup-environment -$HOME_ENVIRONMENT/on-first-login\n" +$HOME_ENVIRONMENT/on-first-login +unset HOME_ENVIRONMENT\n" (serialize-configuration config (filter-configuration-fields From patchwork Thu Feb 6 04:24:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liam Hupfer X-Patchwork-Id: 38304 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 D398227BBEC; Thu, 6 Feb 2025 04:27:39 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 878AE27BBE2 for ; Thu, 6 Feb 2025 04:27:39 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tftTo-0000Po-Jd; Wed, 05 Feb 2025 23:27:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tftTm-0000Oo-KH for guix-patches@gnu.org; Wed, 05 Feb 2025 23:27:06 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tftTk-00017V-57; Wed, 05 Feb 2025 23:27:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=wpr6NW4QiGsCipzVYr2heGtKWx9jjpszb+m4KvOMUCs=; b=XmD8gVYcxVHxdaVenfCOXicSQv4dOzXulhOCK6pOQo67Y4W2Nbag/BkLwuDCFanHZrBrEQBWhRnJAEgdyhcu9ND8UagtuhoZ+lArKZfvblZb3v4k5mU7bZ5ag9J3F5Ka4vKjdFcgc2yQbEuXLI+FbmRDfISDCMrmwwDAx1oUCXwwwku3ViBmgAqLJHYPwZ0Xd8wz4dZvlGH8mnXrAnusSbKobZ+7x3eq3MLQGp1QrTjhkwi9Xskbx815L1v94INwxM/4g2KHYLvblmGZx0Z13XEQvoG6cD46efel4zLjVVxVziqoIqWFht2BzbwnJndKG/V9K/cS4egDiYnUTNMagA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tftTi-0002X6-7A; Wed, 05 Feb 2025 23:27:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76082] [PATCH 3/9] home: services: setup-environment: Set GUIX_LOCPATH. Resent-From: Liam Hupfer Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, janneke@gnu.org, ludo@gnu.org, tanguy@bioneland.org, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Thu, 06 Feb 2025 04:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76082 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76082@debbugs.gnu.org Cc: Liam Hupfer , Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian X-Debbugs-Original-Xcc: Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian Received: via spool by 76082-submit@debbugs.gnu.org id=B76082.17388159709563 (code B ref 76082); Thu, 06 Feb 2025 04:27:02 +0000 Received: (at 76082) by debbugs.gnu.org; 6 Feb 2025 04:26:10 +0000 Received: from localhost ([127.0.0.1]:53612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tftSs-0002UB-EE for submit@debbugs.gnu.org; Wed, 05 Feb 2025 23:26:10 -0500 Received: from out-183.mta0.migadu.com ([2001:41d0:1004:224b::b7]:49772) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tftSp-0002TK-SI for 76082@debbugs.gnu.org; Wed, 05 Feb 2025 23:26:09 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpfr.net; s=key1; t=1738815961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wpr6NW4QiGsCipzVYr2heGtKWx9jjpszb+m4KvOMUCs=; b=ODPar6Oy8ntuTsmJAidDAUl4p2HMiwttvSlQ5Vanoq5o8vzmVqrujrd3jI0ZGciMEUf2X5 AJdqlAo/fPM799VJieJa35+PqMk7ghfQYNuR+qQ4XQEfDt/vk7JejqHxqs/28iTwjKJe1t yaJypQc3xd1EotFqvq/qAFybGftAiyQB1l47dKh4qwIOugy9qsGecObsWpkPni1SID0cRN 4gDEcLz7D4gcXjUsYy1bJzBIrchdtTsTzu/e/PY+4dLyo4hfg6INifk53l67kTrHl/jeZW 5kaZgEvQSCG890PephDBgfM0doonhlHv36j351XIUPKQPma0LX0zCJPgd91MZQ== From: Liam Hupfer Date: Wed, 5 Feb 2025 22:24:59 -0600 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Locales installed via Guix Home should be exposed to Guix packages by default. * gnu/home/services.scm (environment-variables->setup-environment-script): Set GUIX_LOCPATH. Change-Id: Ic61f0832312479ba36f471d92a12e7b4e296389f --- gnu/home/services.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnu/home/services.scm b/gnu/home/services.scm index 165bc33b05..9f50635d5c 100644 --- a/gnu/home/services.scm +++ b/gnu/home/services.scm @@ -281,6 +281,10 @@ (define (environment-variables->setup-environment-script vars) PROFILE_FILE=\"$GUIX_PROFILE/etc/profile\" [ -f $PROFILE_FILE ] && . $PROFILE_FILE +case $GUIX_LOCPATH in + *$GUIX_PROFILE/lib/locale*) ;; + *) export GUIX_LOCPATH=$GUIX_PROFILE/lib/locale:$GUIX_LOCPATH ;; +esac case $XDG_DATA_DIRS in *$GUIX_PROFILE/share*) ;; *) export XDG_DATA_DIRS=$GUIX_PROFILE/share:$XDG_DATA_DIRS ;; From patchwork Thu Feb 6 04:25:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liam Hupfer X-Patchwork-Id: 38308 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 2CAC427BBE2; Thu, 6 Feb 2025 04:27:55 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D5B8327BBE2 for ; Thu, 6 Feb 2025 04:27:54 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tftTs-0000Rl-5V; Wed, 05 Feb 2025 23:27:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tftTm-0000Oq-LU for guix-patches@gnu.org; Wed, 05 Feb 2025 23:27:06 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tftTl-00017v-Lw; Wed, 05 Feb 2025 23:27:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=O9zkvneAmJ+V4qq5A+eouBKmG7vDmZNOVG1n/AZ5JMw=; b=t5I5X4JyBqc9/J2q3LOqlca9C+gUBgSOh2ihsSU1rgvocWU8m7jUGHwpMkwEgOl0DMhtXuxe91dLqRvEne7p9XbxA+cNh2PiZi42Sp8mZqguG1tp+/Sg5DFW8Jb4gPY7wxSpc4YVy3+8rhmDFPPlr96DYK09jPRc3/ufHyYmupaZklo74zLapKldn8tUi30hNJGkCknjrFOxcJN7vTGyLe318e3VfuRK4PWaSvj9bkTb7DA/bKMMzDypDpXD2SCFhQ3cDLT3PzkFxfxV0619N3wY1zsh+EtyM+lWA4KALuRbMw1XxN7durQT6Y14MTK1pqsdHFN9XbjESx+nzGhqMg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tftTi-0002XG-Kk; Wed, 05 Feb 2025 23:27:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76082] [PATCH 4/9] guix-install.sh: Remove system-level Guix Home initialization. Resent-From: Liam Hupfer Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, janneke@gnu.org, ludo@gnu.org, tanguy@bioneland.org, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Thu, 06 Feb 2025 04:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76082 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76082@debbugs.gnu.org Cc: Liam Hupfer , Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian X-Debbugs-Original-Xcc: Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian Received: via spool by 76082-submit@debbugs.gnu.org id=B76082.17388159799587 (code B ref 76082); Thu, 06 Feb 2025 04:27:02 +0000 Received: (at 76082) by debbugs.gnu.org; 6 Feb 2025 04:26:19 +0000 Received: from localhost ([127.0.0.1]:53616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tftT1-0002UY-1B for submit@debbugs.gnu.org; Wed, 05 Feb 2025 23:26:19 -0500 Received: from out-174.mta1.migadu.com ([95.215.58.174]:34530) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tftSx-0002U9-OX for 76082@debbugs.gnu.org; Wed, 05 Feb 2025 23:26:16 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpfr.net; s=key1; t=1738815968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O9zkvneAmJ+V4qq5A+eouBKmG7vDmZNOVG1n/AZ5JMw=; b=WcM9W82z+bHtU5v0iKfOBz7yofBVpU7KCYi6sZbpcdy1neWiMwJEfPzcXCowKghPhwg6HP idl2vG1JVbv6P4fy9wQE4U0c+zvYULA6vPfZqA4ktUDQTqkHuxVd1Maqlc3anqlmUGjZf4 +a4i3giUUh8mj9cNGDPh2IUPuBLEdwtSaIgWxkua3fz1jepoP5TT7HXLLaYWjzGqnyia/1 zN1ARPo7HXMdKF+NxgE16RPlLAUh9Xk2TbgDOWrG+FfC2FiiIYu9VtwkK6MrHgQZiVIZia tt9Oaw4McpKRg3flaoyuopDi0xP8ql7FvnHdigtXnl5YuQfl1CErR0wo9r9EPQ== From: Liam Hupfer Date: Wed, 5 Feb 2025 22:25:00 -0600 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Guix Home handles its own profile initialization in ~/.profile and documents shell setup accordingly. It does more than what is done here, including running an on-first-login script to start a user Shepherd instance. In general, changes and improvements to Guix Home initialization are unlikely to propagate to the foreign distro install script, since many Guix contributors only use Guix via Guix System and Guix Home does not depend on system-level initialization anyway. Avoid partially initializing Guix Home in /etc/profile.d to keep search path variables free of redundant entries. Instead, leave a comment directing users to the relevant manual section. * etc/guix-install.sh (sys_create_init_profile): Remove system-level Guix Home initialization. Change-Id: Ib78aa0382268a789298d4980ee394d99a602a5ca --- etc/guix-install.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 22d54c0c83..8dda149edf 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -665,10 +665,8 @@ GUIX_LOCPATH="$GUIX_PROFILE/lib/locale${GUIX_LOCPATH:+:}$GUIX_LOCPATH" # searches 'Info-default-directory-list'. export INFOPATH="$_GUIX_PROFILE/share/info:$GUIX_PROFILE/share/info:$INFOPATH" -GUIX_PROFILE="$HOME/.guix-home/profile" -[ -f "$GUIX_PROFILE/etc/profile" ] && . "$GUIX_PROFILE/etc/profile" -[ -L "$GUIX_PROFILE" ] && \ -GUIX_LOCPATH="$GUIX_PROFILE/lib/locale${GUIX_LOCPATH:+:}$GUIX_LOCPATH" +# NOTE: Guix Home handles its own profile initialization in ~/.profile. See +# info '(guix) Configuring the Shell'. export GUIX_LOCPATH From patchwork Thu Feb 6 04:25:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liam Hupfer X-Patchwork-Id: 38302 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 051D027BBE9; Thu, 6 Feb 2025 04:27:19 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 81F0A27BBE2 for ; Thu, 6 Feb 2025 04:27:17 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tftTp-0000Pu-Mw; Wed, 05 Feb 2025 23:27:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tftTn-0000P9-1K for guix-patches@gnu.org; Wed, 05 Feb 2025 23:27:07 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tftTk-00017Y-5U; Wed, 05 Feb 2025 23:27:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=VRwAYy6Q5fx0DBU7LA8wbxgxc9fhIesnYV/BG+h0dgw=; b=HT2/CJe+TFzqcpEPTivbhrkwFcZSceHbEYEQ5RO8EpGMJgg2TyJwrOOhP2e5JUBf38motGVtMAsHQqV7YJdCgVdMdgRpjrM8oTjL4RQ20WQxc3MEgWF3hxst3pJsSNDqNsARqEWfW7e42brCDU5dxu5ZSHQuIbDhPjBPpqqfB+oBpC4LBIj6qsLxb4kfCeZP89J2qQ2HMRgagtKxg2bMZ2kUfDJ86unbbXWq5WZ8ecn01OQhzE+k2/fPU/On2L24mu4iAnAOhAhD3lECl8qSMoKxwKa3lshE3QBEfblVnWMeZVGaHoAkS19TPDBjLw+nPYxfUGv6AiikSo3GP3X22g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tftTj-0002XP-42; Wed, 05 Feb 2025 23:27:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76082] [PATCH 5/9] guix-install.sh: Improve Guix profile sourcing. Resent-From: Liam Hupfer Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, janneke@gnu.org, ludo@gnu.org, tanguy@bioneland.org, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Thu, 06 Feb 2025 04:27:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76082 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76082@debbugs.gnu.org Cc: Liam Hupfer , Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian X-Debbugs-Original-Xcc: Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian Received: via spool by 76082-submit@debbugs.gnu.org id=B76082.17388159829604 (code B ref 76082); Thu, 06 Feb 2025 04:27:03 +0000 Received: (at 76082) by debbugs.gnu.org; 6 Feb 2025 04:26:22 +0000 Received: from localhost ([127.0.0.1]:53620 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tftT3-0002Uq-N0 for submit@debbugs.gnu.org; Wed, 05 Feb 2025 23:26:22 -0500 Received: from out-178.mta1.migadu.com ([2001:41d0:203:375::b2]:22176) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tftT1-0002UM-1P for 76082@debbugs.gnu.org; Wed, 05 Feb 2025 23:26:19 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpfr.net; s=key1; t=1738815972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VRwAYy6Q5fx0DBU7LA8wbxgxc9fhIesnYV/BG+h0dgw=; b=lbP8oxQGFcmA87wStqyeYNr9uGpNbitJzda8UEnkRKl19aVfGz/9drkTkFHX6ECQC3QaF/ T+5cdjGwcMxTExAo7OH/EK540UKSBSvtCuaRB8P+VXcllu9xLjT2475EoEhkMyKykxcJnS EKnWjRIAMoa/EUr/gDcKJO5jIpMvv02VFol00EL/qQrYpRwvVJu0C3kXN7IwdErPd3S/OY pG3IfKb+XXm3+ig70V4a9A3su95MIriLQqNqg9PS7Jhf/fbBD30fZUzDZv3F6lIgV3K+N9 gDt2F7+G6HzykvIx5/YtIYgw2W45tpxxYIhAEiYm/N717ymB9MKGt7+Ht1v+Bg== From: Liam Hupfer Date: Wed, 5 Feb 2025 22:25:01 -0600 Message-ID: <1c3233c704528b298ba3fb884bc8ab29b8b84001.1738815703.git.liam@hpfr.net> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Make both profiles use GUIX_PROFILE and reorder some code so each profile is handled in one contiguous block. The user’s profile now takes precedence over the ‘guix pull’ profile on INFOPATH. If the user already has an info reader in their Guix profile, don’t add a duplicate entry to INFOPATH. If the user doesn’t have an imperative ~/.guix-profile (i.e. they manage software with Guix Home and ‘guix shell’), don’t add an unnecessary entry to INFOPATH. Clean up after ourselves by unsetting the temporary GUIX_PROFILE variable, which only needs to be set when sourcing. * etc/guix-install.sh (sys_create_init_profile): Improve Guix profile sourcing. Change-Id: Ibceb354012d23d24deeb39b1ec02790873396a6b --- etc/guix-install.sh | 50 +++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 8dda149edf..9a1d898b4b 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -649,31 +649,41 @@ export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:-/etc/xdg}" export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" # no default for XDG_RUNTIME_DIR (depends on foreign distro for semantics) -# _GUIX_PROFILE: `guix pull` profile -_GUIX_PROFILE="$HOME/.config/guix/current" -export PATH="$_GUIX_PROFILE/bin${PATH:+:}$PATH" - -# GUIX_PROFILE: User's default profile and home profile +# `guix pull` profile +GUIX_PROFILE="$HOME/.config/guix/current" +export PATH="$GUIX_PROFILE/bin${PATH:+:}$PATH" +# Add to INFOPATH so the latest Guix documentation is available to info +# readers. When INFOPATH is unset, add a trailing colon so that Emacs searches +# 'Info-default-directory-list'. +export INFOPATH="$GUIX_PROFILE/share/info:$INFOPATH" +# Expose the latest Guix modules to Guile so guix shell and repls spawned by +# e.g. Geiser work out of the box. +export GUILE_LOAD_PATH="$GUIX_PROFILE/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH" +export GUILE_LOAD_COMPILED_PATH="$GUIX_PROFILE/lib/guile/3.0/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH" + +# User's default profile, if it exists GUIX_PROFILE="$HOME/.guix-profile" -[ -f "$GUIX_PROFILE/etc/profile" ] && . "$GUIX_PROFILE/etc/profile" -[ -L "$GUIX_PROFILE" ] && \ -GUIX_LOCPATH="$GUIX_PROFILE/lib/locale${GUIX_LOCPATH:+:}$GUIX_LOCPATH" - -# Export INFOPATH so that the updated info pages can be found -# and read by both /usr/bin/info and/or $GUIX_PROFILE/bin/info -# When INFOPATH is unset, add a trailing colon so that Emacs -# searches 'Info-default-directory-list'. -export INFOPATH="$_GUIX_PROFILE/share/info:$GUIX_PROFILE/share/info:$INFOPATH" +if [ -L "$GUIX_PROFILE" ]; then + . "$GUIX_PROFILE/etc/profile" + + # see info '(guix) Application Setup' + export GUIX_LOCPATH="$GUIX_PROFILE/lib/locale${GUIX_LOCPATH:+:}$GUIX_LOCPATH" + + # INFOPATH may be handled by $GUIX_PROFILE/etc/profile if the user installs + # an info reader via Guix. If the user doesn’t, explicitly add to INFOPATH + # so documentation for software from ‘guix install’ is available to the + # system info reader. + case $INFOPATH in + *$GUIX_PROFILE/share/info*) ;; + *) export INFOPATH="$GUIX_PROFILE/share/info:$INFOPATH" ;; + esac +fi # NOTE: Guix Home handles its own profile initialization in ~/.profile. See # info '(guix) Configuring the Shell'. -export GUIX_LOCPATH - -# Make Guix modules available -export GUILE_LOAD_PATH="$_GUIX_PROFILE/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH" -export GUILE_LOAD_COMPILED_PATH="$_GUIX_PROFILE/lib/guile/3.0/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH" - +# Clean up after ourselves. +unset GUIX_PROFILE EOF } From patchwork Thu Feb 6 04:25:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liam Hupfer X-Patchwork-Id: 38307 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 2CCF727BBEA; Thu, 6 Feb 2025 04:27:50 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D141F27BBE2 for ; Thu, 6 Feb 2025 04:27:49 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tftU2-0000VC-3K; Wed, 05 Feb 2025 23:27:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tftTn-0000P6-10 for guix-patches@gnu.org; Wed, 05 Feb 2025 23:27:07 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tftTk-00017g-OI; Wed, 05 Feb 2025 23:27:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=kypTrG0mBI960bpkZ3UA/8d0V1+bT2uT4LbEbHjs3mI=; b=CNxH4P68G2iokZAYvAzfLH9l5A9UvYxOFndO9TIntxZAeIVPE0zizrsBIpTLOb/mCb6ljZdB7o7zajTetC9M2queyFzyEgfKFHYlMg6Zf4+d1DkybXlZAri4WxoMro0EYKr5nitFveeUuDCryTarFNV91+kL95aVn6MxDMEjHZMdUcQCmk7kGQ5r4yZFN8L9Y4IlkaS8Ow0wwGaqD5R0Zg6/1yQ+ok8dmLMt3850jisnGyHr59Z+Ne4cZmvoIfi5TWsw19hanAi3hdyPvV7qPdPQbomQIAX6IKQYhrIkpVqrwwUzvrnkqURcM0gFiTk2cDw/ccXwouJL5kRDM15rSw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tftTj-0002XZ-M3; Wed, 05 Feb 2025 23:27:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76082] [PATCH 6/9] guix-install.sh: Add to MANPATH. Resent-From: Liam Hupfer Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, janneke@gnu.org, ludo@gnu.org, tanguy@bioneland.org, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Thu, 06 Feb 2025 04:27:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76082 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76082@debbugs.gnu.org Cc: Liam Hupfer , Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian X-Debbugs-Original-Xcc: Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian Received: via spool by 76082-submit@debbugs.gnu.org id=B76082.17388159899630 (code B ref 76082); Thu, 06 Feb 2025 04:27:03 +0000 Received: (at 76082) by debbugs.gnu.org; 6 Feb 2025 04:26:29 +0000 Received: from localhost ([127.0.0.1]:53624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tftTB-0002VC-5o for submit@debbugs.gnu.org; Wed, 05 Feb 2025 23:26:29 -0500 Received: from out-189.mta0.migadu.com ([91.218.175.189]:32232) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tftT8-0002Uo-Qh for 76082@debbugs.gnu.org; Wed, 05 Feb 2025 23:26:27 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpfr.net; s=key1; t=1738815975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kypTrG0mBI960bpkZ3UA/8d0V1+bT2uT4LbEbHjs3mI=; b=iF7xx7ah4xtdUMoFYTIo+cyrazqUp51JkA706dy01ZRkOUg5B5ss3CWKmu5Fy/HwDs/ojx 7RNLNy4rmhRROyZHkuHo+bsWEgJnFTkUyWT+H2F/ThYTOc8AV0A9IBfnf7C0efFxwisTmr TD7iTS0C8SOoRfk2IMQqrOQextqYKA7siK5lSRSUQev3Vodhiouo18oEcEC5S7t8yw3icK xZq3UvMlaYQ8fO0tuX6HJxHfyFS5WeAzVy/TWbShdgT+eIpnSArEXm4Fhz8r+gIfg4ofdv 2W+UJF1RnblG3VRolimpBKdXStpXh2e/yi2v9HmB5E/9Zrn8limP2sqwPhIlIQ== From: Liam Hupfer Date: Wed, 5 Feb 2025 22:25:02 -0600 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Guix and Guix-provided software also have man pages. If the user doesn’t install man-db via Guix, they should still be able to read Guix-provided man pages. * etc/guix-install.sh (sys_create_init_profile): Add to MANPATH. Change-Id: Ibceb354012d23d24deeb39b1ec02790873396a6b --- etc/guix-install.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 9a1d898b4b..ef338e89f7 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -652,10 +652,12 @@ export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" # `guix pull` profile GUIX_PROFILE="$HOME/.config/guix/current" export PATH="$GUIX_PROFILE/bin${PATH:+:}$PATH" -# Add to INFOPATH so the latest Guix documentation is available to info -# readers. When INFOPATH is unset, add a trailing colon so that Emacs searches -# 'Info-default-directory-list'. +# Add to INFOPATH and MANPATH so the latest Guix documentation is available to +# info and man readers. When INFOPATH is unset, add a trailing colon so Emacs +# searches 'Info-default-directory-list'. When MANPATH is unset, add a +# trailing colon so the system default search path is used. export INFOPATH="$GUIX_PROFILE/share/info:$INFOPATH" +export MANPATH="$GUIX_PROFILE/share/man:$MANPATH" # Expose the latest Guix modules to Guile so guix shell and repls spawned by # e.g. Geiser work out of the box. export GUILE_LOAD_PATH="$GUIX_PROFILE/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH" @@ -669,14 +671,18 @@ if [ -L "$GUIX_PROFILE" ]; then # see info '(guix) Application Setup' export GUIX_LOCPATH="$GUIX_PROFILE/lib/locale${GUIX_LOCPATH:+:}$GUIX_LOCPATH" - # INFOPATH may be handled by $GUIX_PROFILE/etc/profile if the user installs - # an info reader via Guix. If the user doesn’t, explicitly add to INFOPATH - # so documentation for software from ‘guix install’ is available to the - # system info reader. + # Documentation search paths may be handled by $GUIX_PROFILE/etc/profile if + # the user installs info and man readers via Guix. If the user doesn’t, + # explicitly add to them so documentation for software from ‘guix install’ + # is available to the system info and man readers. case $INFOPATH in *$GUIX_PROFILE/share/info*) ;; *) export INFOPATH="$GUIX_PROFILE/share/info:$INFOPATH" ;; esac + case $MANPATH in + *$GUIX_PROFILE/share/man*) ;; + *) export MANPATH="$GUIX_PROFILE/share/man:$MANPATH" + esac fi # NOTE: Guix Home handles its own profile initialization in ~/.profile. See From patchwork Thu Feb 6 04:25:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liam Hupfer X-Patchwork-Id: 38303 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 BC0BC27BBEA; Thu, 6 Feb 2025 04:27:25 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2D1D427BBE2 for ; Thu, 6 Feb 2025 04:27:25 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tftTz-0000SG-BE; Wed, 05 Feb 2025 23:27:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tftTm-0000Op-LH for guix-patches@gnu.org; Wed, 05 Feb 2025 23:27:06 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tftTk-00017d-BP; Wed, 05 Feb 2025 23:27:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=pXoYAJ2jkuSbXIr5MzMfJw48oFj2bqK+SfPywCZ580Q=; b=tEl6+PJ1atQTcjYUTeDELRVH6+04I5b2yvSgXGfh4imhNLI/ttBb+sLUO7js/709+wYXMoVrgElJq9n12v6RcA03nxR6l61AL7o7vo+OIS+x4XtiIgiveHgK+gn+pQf7n9G2j46NYpUDKPnfH7SL8+P3K2k34o5OfW6lLs265vN6X81in4mf9KA0VGfp9NAiGB4kPWoJAne/AtfkjzJaUlM+cGF8yPQV+pGqZoX5Rhwr44Y2qwFOzusrsBSkRPEE6n6SNwYejX9OpNC/28AVZJyBVELX/MQIpS9ctFNryQvVs70XeX3KO0SKoVsvdaZrjBunaDvjc7+9c8vi9pQMlQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tftTk-0002Xn-6P; Wed, 05 Feb 2025 23:27:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76082] [PATCH 7/9] guix-install.sh: Appease shellcheck. Resent-From: Liam Hupfer Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, janneke@gnu.org, ludo@gnu.org, tanguy@bioneland.org, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Thu, 06 Feb 2025 04:27:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76082 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76082@debbugs.gnu.org Cc: Liam Hupfer , Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian X-Debbugs-Original-Xcc: Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian Received: via spool by 76082-submit@debbugs.gnu.org id=B76082.17388159929645 (code B ref 76082); Thu, 06 Feb 2025 04:27:04 +0000 Received: (at 76082) by debbugs.gnu.org; 6 Feb 2025 04:26:32 +0000 Received: from localhost ([127.0.0.1]:53628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tftTD-0002VV-Rj for submit@debbugs.gnu.org; Wed, 05 Feb 2025 23:26:32 -0500 Received: from out-188.mta0.migadu.com ([2001:41d0:1004:224b::bc]:11198) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tftTC-0002Uz-4n for 76082@debbugs.gnu.org; Wed, 05 Feb 2025 23:26:30 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpfr.net; s=key1; t=1738815983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pXoYAJ2jkuSbXIr5MzMfJw48oFj2bqK+SfPywCZ580Q=; b=q68/6+saT8ez+8t8bWolrZjilPP1ob/XIzOM1KE7wtQ40Ztt4FaZtxCMRXPXPaCtVuUck5 EuTsi2qEoeo4mW9M8vxG9JSI6JnSnmTdk4QJgpCEG4Od6IkEtJEBApk4qSwdtSYmEvC4rQ 4tuY01bPViTs+WWKe83J2RzO/qGAexwhU5eI+Ga1wWcJpA3YKYIz9gVTOuUGQFNmABpDzg Vs2HpyLJWdFB2s1bspB8OnjuOuztA1367ilwboeT6QELSfLENc8lwAKxcWs+VsRQmR9rq6 Aey0CAfSsP5mmXBhs/cftGY0N2+bFM0E65sVWPaaeHsFouIFfBJJ+j1NCUzSXQ== From: Liam Hupfer Date: Wed, 5 Feb 2025 22:25:03 -0600 Message-ID: <470303f6526912c2f03a4661c0e4afa8aa538b4e.1738815703.git.liam@hpfr.net> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * etc/guix-install.sh: Appease shellcheck. Change-Id: I24f0d13bb254c08d4fe45f5aa3b74bbc6a9a9d88 --- etc/guix-install.sh | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index ef338e89f7..340c3a394f 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -51,8 +51,8 @@ # installation required the user to extract Guix packs under /gnu to # satisfy its dependencies. -if [ "x$BASH_VERSION" = "x" ] -then +# shellcheck disable=2268 # try to support vintage shells +if [ "x$BASH_VERSION" = "x" ]; then exec bash "$0" "$@" fi @@ -85,6 +85,7 @@ REQUIRE=( # Add variables using form FOO_INIT_REQUIRE when init system FOO dependencies # should be checked. +# shellcheck disable=2034 # interpolated by add_init_sys_require SYSV_INIT_REQUIRE=( "daemonize" ) @@ -159,7 +160,7 @@ chk_require() add_init_sys_require() { # Add the elements of FOO_INIT_SYS to REQUIRE local init_require="${INIT_SYS}_REQUIRE[@]" - if [[ ! -z "$init_require" ]]; then + if [[ -n "$init_require" ]]; then # Have to add piecemeal because ${!foo[@]} performs direct array key # expansion, not indirect plain array expansion. for r in "${!init_require}"; do @@ -398,7 +399,9 @@ sys_create_store() ~root/.config/guix/current GUIX_PROFILE=~root/.config/guix/current - # shellcheck disable=SC1090 + # The profile just prepends to search paths, which is not needed for + # effective linting. + # shellcheck disable=SC1091 source "${GUIX_PROFILE}/etc/profile" _msg "${PAS}activated root profile at ${GUIX_PROFILE}" } @@ -435,12 +438,12 @@ sys_create_build_user() for i in $(seq -w 1 10); do if id "guixbuilder${i}" &>/dev/null; then _msg "${INF}user is already in the system, reset" - usermod -g guixbuild -G guixbuild${KVMGROUP} \ + usermod -g guixbuild -G guixbuild"$KVMGROUP" \ -d /var/empty -s "$(which nologin)" \ -c "Guix build user $i" \ "guixbuilder${i}"; else - useradd -g guixbuild -G guixbuild${KVMGROUP} \ + useradd -g guixbuild -G guixbuild"$KVMGROUP" \ -d /var/empty -s "$(which nologin)" \ -c "Guix build user $i" --system \ "guixbuilder${i}"; @@ -453,7 +456,7 @@ sys_delete_build_user() { for i in $(seq -w 1 10); do if id -u "guixbuilder${i}" &>/dev/null; then - userdel -f guixbuilder${i} + userdel -f guixbuilder"$i" fi done @@ -559,7 +562,7 @@ sys_delete_guix_daemon() local local_bin local var_guix - _debug "--- [ $FUNCNAME ] ---" + _debug "--- [ ${FUNCNAME[0]} ] ---" info_path="/usr/local/share/info" local_bin="/usr/local/bin" @@ -703,7 +706,7 @@ sys_create_shell_completion() { # Just in case for dir_shell in $bash_completion $zsh_completion $fish_completion; do - [ -d "$dir_shell" ] || mkdir -p $dir_shell + [ -d "$dir_shell" ] || mkdir -p "$dir_shell" done; # Don't use globing here as we also need to delete the files when @@ -737,8 +740,10 @@ sys_customize_bashrc() for bashrc in /home/*/.bashrc /root/.bashrc; do test -f "$bashrc" || continue + # shellcheck disable=SC2016 # intended search for variable reference grep -Fq '$GUIX_ENVIRONMENT' "$bashrc" && continue cp "${bashrc}" "${bashrc}.bak" + # shellcheck disable=SC2016,SC2028 # intended literal shell output echo ' # Automatically added by the Guix install script. if [ -n "$GUIX_ENVIRONMENT" ]; then @@ -788,11 +793,7 @@ sys_delete_user_profiles() rm -rf ~root/.cache/guix _msg "${INF}removing .guix-profile, .cache/guix and .config/guix of all /home users" - for user in `ls -1 /home`; do - rm -f /home/$user/.guix-profile - rm -rf /home/$user/.cache/guix - rm -rf /home/$user/.config/guix - done + rm -rf /home/*/{.guix-profile,{.cache,.config}/guix} } welcome() @@ -940,7 +941,7 @@ main() if [ '--uninstall' = "${uninstall_flag}" ]; then main_uninstall else - echo "unsupported parameters: $@" + echo "unsupported parameters: $*" exit 1 fi fi From patchwork Thu Feb 6 04:25:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liam Hupfer X-Patchwork-Id: 38309 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 F28E027BBE2; Thu, 6 Feb 2025 04:27:55 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 18EB827BBEA for ; Thu, 6 Feb 2025 04:27:55 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tftU1-0000Uf-5X; Wed, 05 Feb 2025 23:27:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tftTp-0000Qg-JN for guix-patches@gnu.org; Wed, 05 Feb 2025 23:27:10 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tftTn-000193-Cd; Wed, 05 Feb 2025 23:27:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=7CTPVy6CW1o1JoPPQ2/JPV47f0kTyuwunrDqSGq91i8=; b=aa5oc95AvutrHCAi/XT/Z5VBZQqPggEaFGRmN5dcMaso6n8tLXhuxShFJBFiX/R6DaFDZItP/ptK3M4Ukmy1NBf5CyGEl8ktEGScg5vAV2i7J1tohEupw53RTAeVDoeJoy8Yyog/FEeGXx/wEIl6f9yt/sjPlVFbMY6JGTW7b32a1Cw8Uzv3zDZU6PeucOVxTKRIA87LbxE9qYmVf+6ALJcFwRIsfrvtscaNaGld4ZgMjsaUnh3ckf0+K8bbhe2CK95WORyibYfixTFqtg/pwh1Ir7IXPshbix3iI9yfXBn5JTMEoc5A5+soSF1i8+Lc9kl7HMFhThtwagNMeLVqBg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tftTk-0002Xw-Lp; Wed, 05 Feb 2025 23:27:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76082] [PATCH 8/9] guix-install.sh: Add msg helpers and use stderr consistently. Resent-From: Liam Hupfer Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, janneke@gnu.org, ludo@gnu.org, tanguy@bioneland.org, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Thu, 06 Feb 2025 04:27:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76082 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76082@debbugs.gnu.org Cc: Liam Hupfer , Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian X-Debbugs-Original-Xcc: Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian Received: via spool by 76082-submit@debbugs.gnu.org id=B76082.17388160029677 (code B ref 76082); Thu, 06 Feb 2025 04:27:04 +0000 Received: (at 76082) by debbugs.gnu.org; 6 Feb 2025 04:26:42 +0000 Received: from localhost ([127.0.0.1]:53634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tftTJ-0002Vn-BC for submit@debbugs.gnu.org; Wed, 05 Feb 2025 23:26:42 -0500 Received: from out-181.mta1.migadu.com ([2001:41d0:203:375::b5]:42811) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tftTF-0002V8-Pi for 76082@debbugs.gnu.org; Wed, 05 Feb 2025 23:26:35 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpfr.net; s=key1; t=1738815987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7CTPVy6CW1o1JoPPQ2/JPV47f0kTyuwunrDqSGq91i8=; b=rnQtlxxAQIlZEonaNpIttw2smkS7dDSC8IoLWzDKAvb6QOHHYpgy3Ay9tBoi3JCJZKJznQ YIZAB0x/1/CdAAznNtOSQt8NbNdS0a73zmplonp531tL3oG5EyLygbCzLg2Iuyq8bksvna qO8bOHRjPnOb3ba3MQfzkwF2V2ja7+ndH8pqMqmIB3DsYVjvkOplgo4ThTP5/pCOuOiwiW JowwZAKSYkru0LO7EHYsHb/DvwS475tZJkDf7mhmfTF9reqm210W7tKfEBh3pQv/WSM5Th IqDftTUnil0//kyeJ8+KCZqLaPuO8R+lKSH0EJzfCuUCtK2PPTM8F+ZaOL/YWQ== From: Liam Hupfer Date: Wed, 5 Feb 2025 22:25:04 -0600 Message-ID: <15ab3b91f03b6d46fc1014b073576a4006da3de3.1738815703.git.liam@hpfr.net> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Add helpers to avoid repeated manual concatenation. _err and _msg "$ERR are used interchangeably with their only difference being output stream; convert all errors to use _err. * etc/guix-install.sh: Add msg helpers and consolidate errors to stderr. Change-Id: I06e97ccc50d108ed9e279ae80c6b2386d7b8c36b --- etc/guix-install.sh | 149 ++++++++++++++++++++++++-------------------- 1 file changed, 82 insertions(+), 67 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 340c3a394f..7a731962b3 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -110,7 +110,7 @@ GPG_SIGNING_KEYS[127547]=27D586A4F8900854329FF09F1260E46482E63562 # maxim _err() { # All errors go to stderr. - printf "[%s]: %s\n" "$(date +%s.%3N)" "$1" + printf "[%s]: ${ERR}%s\n" "$(date +%s.%3N)" "$1" } _msg() @@ -118,6 +118,21 @@ _msg() printf "[%s]: %s\n" "$(date +%s.%3N)" "$1" } +_msg_pass() +{ + _msg "$PAS$1" +} + +_msg_warn() +{ + _msg "$WAR$1" +} + +_msg_info() +{ + _msg "$INF$1" +} + _debug() { if [ "${DEBUG}" = '1' ]; then @@ -127,7 +142,7 @@ _debug() die() { - _err "${ERR}$*" + _err "$*" exit 1 } @@ -154,7 +169,7 @@ chk_require() [ "${#warn}" -ne 0 ] && die "Missing commands: ${warn[*]}." - _msg "${PAS}verification of required commands completed" + _msg_pass "verification of required commands completed" } add_init_sys_require() @@ -195,7 +210,7 @@ Would you like me to fetch it for you?"; then fi # If we reach this point, the key is (still) missing. Report further # missing keys, if any, but then abort the installation. - _err "${ERR}Missing OpenPGP public key ($gpg_key_id). + _err "Missing OpenPGP public key ($gpg_key_id). Fetch it with this command: wget \"https://sv.gnu.org/people/viewgpg.php?user_id=$user_id\" -O - | \ @@ -227,24 +242,24 @@ chk_term() chk_init_sys() { # Return init system type name. if [[ $(/sbin/init --version 2>/dev/null) =~ upstart ]]; then - _msg "${INF}init system is: upstart" + _msg_info "init system is: upstart" INIT_SYS="upstart" return 0 elif [[ $(systemctl 2>/dev/null) =~ -\.mount ]]; then - _msg "${INF}init system is: systemd" + _msg_info "init system is: systemd" INIT_SYS="systemd" return 0 elif [[ -f /etc/init.d/cron && ! -h /etc/init.d/cron ]]; then - _msg "${INF}init system is: sysv-init" + _msg_info "init system is: sysv-init" INIT_SYS="sysv-init" return 0 elif [[ $(openrc --version 2>/dev/null) =~ \(OpenRC ]]; then - _msg "${INF}init system is: OpenRC" + _msg_info "init system is: OpenRC" INIT_SYS="openrc" return 0 else INIT_SYS="NA" - _err "${ERR}Init system could not be detected." + _err "Init system could not be detected." fi } @@ -291,12 +306,12 @@ chk_sys_nscd() { # Check if nscd is up and suggest to start it or install it if [ "$(type -P pidof)" ]; then if [ ! "$(pidof nscd)" ]; then - _msg "${WAR}We recommend installing and/or starting your distribution 'nscd' service" - _msg "${WAR}Please read 'info guix \"Application Setup\"' about \"Name Service Switch\"" + _msg_warn "We recommend installing and/or starting your distribution 'nscd' service" + _msg_warn "Please read 'info guix \"Application Setup\"' about \"Name Service Switch\"" fi else - _msg "${INF}We cannot determine if your distribution 'nscd' service is running" - _msg "${INF}Please read 'info guix \"Application Setup\"' about \"Name Service Switch\"" + _msg_info "We cannot determine if your distribution 'nscd' service is running" + _msg_info "Please read 'info guix \"Application Setup\"' about \"Name Service Switch\"" fi } @@ -334,7 +349,7 @@ guix_get_bin_list() default_ver="guix-binary-${latest_ver}.${ARCH_OS}" if [[ "${#bin_ver_ls}" -ne "0" ]]; then - _msg "${PAS}Release for your system: ${default_ver}" + _msg_pass "Release for your system: ${default_ver}" else die "Could not obtain list of Guix releases." fi @@ -352,21 +367,21 @@ guix_get_bin() _debug "--- [ ${FUNCNAME[0]} ] ---" - _msg "${INF}Downloading Guix release archive" + _msg_info "Downloading Guix release archive" wget --help | grep -q '\--show-progress' \ && wget_args=("--no-verbose" "--show-progress") if wget "${wget_args[@]}" -P "$dl_path" \ "${url}/${bin_ver}.tar.xz" "${url}/${bin_ver}.tar.xz.sig"; then - _msg "${PAS}download completed." + _msg_pass "download completed." else die "could not download ${url}/${bin_ver}.tar.xz." fi pushd "${dl_path}" >/dev/null if gpg --verify "${bin_ver}.tar.xz.sig" >/dev/null 2>&1; then - _msg "${PAS}Signature is valid." + _msg_pass "Signature is valid." popd >/dev/null else die "could not verify the signature." @@ -382,18 +397,18 @@ sys_create_store() if [[ -e /var/guix && -e /gnu ]]; then if [ -n "$GUIX_ALLOW_OVERWRITE" ]; then - _msg "${WAR}Overwriting existing installation!" + _msg_warn "Overwriting existing installation!" else die "A previous Guix installation was found. Refusing to overwrite." fi fi cd "$tmp_path" - _msg "${INF}Installing /var/guix and /gnu..." + _msg_info "Installing /var/guix and /gnu..." # Strip (skip) the leading ‘.’ component, which fails on read-only ‘/’. tar --extract --strip-components=1 --file "$pkg" -C / - _msg "${INF}Linking the root user's profile" + _msg_info "Linking the root user's profile" mkdir -p ~root/.config/guix ln -sf /var/guix/profiles/per-user/root/current-guix \ ~root/.config/guix/current @@ -403,18 +418,18 @@ sys_create_store() # effective linting. # shellcheck disable=SC1091 source "${GUIX_PROFILE}/etc/profile" - _msg "${PAS}activated root profile at ${GUIX_PROFILE}" + _msg_pass "activated root profile at ${GUIX_PROFILE}" } sys_delete_store() { - _msg "${INF}removing /var/guix" + _msg_info "removing /var/guix" rm -rf /var/guix - _msg "${INF}removing /gnu" + _msg_info "removing /gnu" rm -rf /gnu - _msg "${INF}removing ~root/.config/guix" + _msg_info "removing ~root/.config/guix" rm -rf ~root/.config/guix } @@ -424,20 +439,20 @@ sys_create_build_user() _debug "--- [ ${FUNCNAME[0]} ] ---" if getent group guixbuild > /dev/null; then - _msg "${INF}group guixbuild exists" + _msg_info "group guixbuild exists" else groupadd --system guixbuild - _msg "${PAS}group created" + _msg_pass "group created" fi if getent group kvm > /dev/null; then - _msg "${INF}group kvm exists and build users will be added to it" + _msg_info "group kvm exists and build users will be added to it" local KVMGROUP=,kvm fi for i in $(seq -w 1 10); do if id "guixbuilder${i}" &>/dev/null; then - _msg "${INF}user is already in the system, reset" + _msg_info "user is already in the system, reset" usermod -g guixbuild -G guixbuild"$KVMGROUP" \ -d /var/empty -s "$(which nologin)" \ -c "Guix build user $i" \ @@ -447,7 +462,7 @@ sys_create_build_user() -d /var/empty -s "$(which nologin)" \ -c "Guix build user $i" --system \ "guixbuilder${i}"; - _msg "${PAS}user added " + _msg_pass "user added " fi done } @@ -460,7 +475,7 @@ sys_delete_build_user() fi done - _msg "${INF}delete group guixbuild" + _msg_info "delete group guixbuild" if getent group guixbuild &>/dev/null; then groupdel -f guixbuild fi @@ -486,7 +501,7 @@ sys_enable_guix_daemon() /etc/init/ && configure_substitute_discovery /etc/init/guix-daemon.conf && start guix-daemon; } && - _msg "${PAS}enabled Guix daemon via upstart" + _msg_pass "enabled Guix daemon via upstart" ;; systemd) { install_unit() @@ -511,7 +526,7 @@ sys_enable_guix_daemon() systemctl daemon-reload && systemctl start guix-daemon; } && - _msg "${PAS}enabled Guix daemon via systemd" + _msg_pass "enabled Guix daemon via systemd" ;; sysv-init) { mkdir -p /etc/init.d; @@ -524,7 +539,7 @@ sys_enable_guix_daemon() update-rc.d guix-daemon defaults && update-rc.d guix-daemon enable && service guix-daemon start; } && - _msg "${PAS}enabled Guix daemon via sysv" + _msg_pass "enabled Guix daemon via sysv" ;; openrc) { mkdir -p /etc/init.d; @@ -536,15 +551,15 @@ sys_enable_guix_daemon() rc-update add guix-daemon default && rc-service guix-daemon start; } && - _msg "${PAS}enabled Guix daemon via OpenRC" + _msg_pass "enabled Guix daemon via OpenRC" ;; NA|*) - _msg "${ERR}unsupported init system; run the daemon manually:" + _err "unsupported init system; run the daemon manually:" echo " ~root/.config/guix/current/bin/guix-daemon --build-users-group=guixbuild" ;; esac - _msg "${INF}making the guix command available to other users" + _msg_info "making the guix command available to other users" [ -e "$local_bin" ] || mkdir -p "$local_bin" ln -sf "${var_guix}/bin/guix" "$local_bin" @@ -570,28 +585,28 @@ sys_delete_guix_daemon() case "$INIT_SYS" in upstart) - _msg "${INF}stopping guix-daemon" + _msg_info "stopping guix-daemon" stop guix-daemon - _msg "${INF}removing guix-daemon" + _msg_info "removing guix-daemon" rm /etc/init/guix-daemon.conf ;; systemd) if [ -f /etc/systemd/system/guix-daemon.service ]; then - _msg "${INF}disabling guix-daemon" + _msg_info "disabling guix-daemon" systemctl disable guix-daemon - _msg "${INF}stopping guix-daemon" + _msg_info "stopping guix-daemon" systemctl stop guix-daemon - _msg "${INF}removing guix-daemon" + _msg_info "removing guix-daemon" rm -f /etc/systemd/system/guix-daemon.service fi if [ -f /etc/systemd/system/gnu-store.mount ]; then - _msg "${INF}disabling gnu-store.mount" + _msg_info "disabling gnu-store.mount" systemctl disable gnu-store.mount - _msg "${INF}stopping gnu-store.mount" + _msg_info "stopping gnu-store.mount" systemctl stop gnu-store.mount - _msg "${INF}removing gnu-store.mount" + _msg_info "removing gnu-store.mount" rm -f /etc/systemd/system/gnu-store.mount fi systemctl daemon-reload @@ -603,16 +618,16 @@ sys_delete_guix_daemon() rm -rf /etc/init.d/guix-daemon ;; NA|*) - _msg "${ERR}unsupported init system; disable, stop and remove the daemon manually:" + _err "unsupported init system; disable, stop and remove the daemon manually:" echo " ~root/.config/guix/current/bin/guix-daemon --build-users-group=guixbuild" ;; esac - _msg "${INF}removing $local_bin/guix" + _msg_info "removing $local_bin/guix" rm -f "$local_bin"/guix - _msg "${INF}removing $info_path/guix*" + _msg_info "removing $info_path/guix*" rm -f "$info_path"/guix* } @@ -629,10 +644,10 @@ project's build farms?"; then local key=~root/.config/guix/current/share/guix/$host.pub [ -f "$key" ] \ && guix archive --authorize < "$key" \ - && _msg "${PAS}Authorized public key for $host" + && _msg_pass "Authorized public key for $host" done else - _msg "${INF}Skipped authorizing build farm public keys" + _msg_info "Skipped authorizing build farm public keys" fi } @@ -715,7 +730,7 @@ sys_create_shell_completion() ln -sf ${var_guix}/etc/bash_completion.d/guix-daemon "$bash_completion"; ln -sf ${var_guix}/share/zsh/site-functions/_guix "$zsh_completion"; ln -sf ${var_guix}/share/fish/vendor_completions.d/guix.fish "$fish_completion"; } && - _msg "${PAS}installed shell completion" + _msg_pass "installed shell completion" } sys_delete_shell_completion() @@ -726,7 +741,7 @@ sys_delete_shell_completion() zsh_completion=/usr/share/zsh/site-functions fish_completion=/usr/share/fish/vendor_completions.d - _msg "${INF}removing shell completion" + _msg_info "removing shell completion" rm -f "$bash_completion"/guix; rm -f "$bash_completion"/guix-daemon; @@ -753,7 +768,7 @@ if [ -n "$GUIX_ENVIRONMENT" ]; then fi ' >> "$bashrc" done - _msg "${PAS}Bash shell prompt successfully customized for Guix" + _msg_pass "Bash shell prompt successfully customized for Guix" } sys_maybe_setup_selinux() @@ -782,17 +797,17 @@ sys_maybe_setup_selinux() sys_delete_init_profile() { - _msg "${INF}removing /etc/profile.d/guix.sh" + _msg_info "removing /etc/profile.d/guix.sh" rm -f /etc/profile.d/guix.sh } sys_delete_user_profiles() { - _msg "${INF}removing ~root/.guix-profile" + _msg_info "removing ~root/.guix-profile" rm -f ~root/.guix-profile rm -rf ~root/.cache/guix - _msg "${INF}removing .guix-profile, .cache/guix and .config/guix of all /home users" + _msg_info "removing .guix-profile, .cache/guix and .config/guix of all /home users" rm -rf /home/*/{.guix-profile,{.cache,.config}/guix} } @@ -841,8 +856,8 @@ EOF if [ "$char" ]; then echo echo "...that ($char) was not a return!" - _msg "${WAR}Use newlines to automate installation, e.g.: yes '' | ${0##*/}" - _msg "${WAR}Any other method is unsupported and likely to break in future." + _msg_warn "Use newlines to automate installation, e.g.: yes '' | ${0##*/}" + _msg_warn "Any other method is unsupported and likely to break in future." fi } @@ -861,7 +876,7 @@ main_install() chk_sys_arch chk_sys_nscd - _msg "${INF}system is ${ARCH_OS}" + _msg_info "system is ${ARCH_OS}" umask 0022 tmp_path="$(mktemp -t -d guix.XXXXXX)" @@ -874,7 +889,7 @@ main_install() if ! [[ $GUIX_BINARY_FILE_NAME =~ $ARCH_OS ]]; then _err "$ARCH_OS not in ${GUIX_BINARY_FILE_NAME}; aborting" fi - _msg "${INF}Using manually provided binary ${GUIX_BINARY_FILE_NAME}" + _msg_info "Using manually provided binary ${GUIX_BINARY_FILE_NAME}" GUIX_BINARY_FILE_NAME=$(realpath "$GUIX_BINARY_FILE_NAME") fi @@ -887,14 +902,14 @@ main_install() sys_create_shell_completion sys_customize_bashrc - _msg "${INF}cleaning up ${tmp_path}" + _msg_info "cleaning up ${tmp_path}" rm -r "${tmp_path}" - _msg "${PAS}Guix has successfully been installed!" - _msg "${INF}Run 'info guix' to read the manual." + _msg_pass "Guix has successfully been installed!" + _msg_info "Run 'info guix' to read the manual." # Required to source /etc/profile in desktop environments. - _msg "${INF}Please log out and back in to complete the installation." + _msg_info "Please log out and back in to complete the installation." } main_uninstall() @@ -908,7 +923,7 @@ main_uninstall() chk_init_sys chk_sys_arch - _msg "${INF}system is ${ARCH_OS}" + _msg_info "system is ${ARCH_OS}" # stop the build, package system. sys_delete_guix_daemon @@ -922,12 +937,12 @@ main_uninstall() sys_delete_shell_completion # these directories are created on the fly during usage. - _msg "${INF}removing /etc/guix" + _msg_info "removing /etc/guix" rm -rf /etc/guix - _msg "${INF}removing /var/log/guix" + _msg_info "removing /var/log/guix" rm -rf /var/log/guix - _msg "${PAS}Guix has successfully been uninstalled!" + _msg_pass "Guix has successfully been uninstalled!" } main() From patchwork Thu Feb 6 04:25:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liam Hupfer X-Patchwork-Id: 38305 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 DB99427BBE2; Thu, 6 Feb 2025 04:27:40 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8AE8127BBE9 for ; Thu, 6 Feb 2025 04:27:39 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tftTo-0000Ps-Tk; Wed, 05 Feb 2025 23:27:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tftTm-0000Or-M8 for guix-patches@gnu.org; Wed, 05 Feb 2025 23:27:06 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tftTm-000181-8F; Wed, 05 Feb 2025 23:27:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=jf0lWL+Q51AXR8iJHOrYfOcwvNwOczb6iewcDMc3Z4Y=; b=BeREw3ZMOhFbx4rJmV95aOndiGz73dASTfTau5wdZyIl9U8KOsImTt14fo4xmGCbfg6we85uFu/Rbz5hh7Xh7yOaqYTxRgXPghnSf865qASoBJbUeO06YEY3sJaUASTn6hME+djNlH0ODPWNbWWnTDEMK0lJLCFlbrJ9VLUnrOh80CeKdspgZiWs7gJ18S93MHHpPi7V4crGP8J7exN+dBYuDCk1rQKvgWTTbJDxkZpHDQPLXPZjI29mOjYEEy9iVHrPz02StSBmfGIzJMCuDTLHGg5W31G9xIHU1PjdV9pNcntjdTei5Cy9Iu1DKQ4cVPw2qp51NinI3nuVf/Dvsw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tftTl-0002Y7-5j; Wed, 05 Feb 2025 23:27:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76082] [PATCH 9/9] guix-install.sh: Check for existing installation before downloading. Resent-From: Liam Hupfer Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, janneke@gnu.org, ludo@gnu.org, tanguy@bioneland.org, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Thu, 06 Feb 2025 04:27:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76082 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76082@debbugs.gnu.org Cc: Liam Hupfer , Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian X-Debbugs-Original-Xcc: Andrew Tropin , Janneke Nieuwenhuizen , Ludovic =?utf-8?q?Court=C3=A8s?= , Tanguy Le Carrour , Vagrant Cascadian Received: via spool by 76082-submit@debbugs.gnu.org id=B76082.17388160039685 (code B ref 76082); Thu, 06 Feb 2025 04:27:05 +0000 Received: (at 76082) by debbugs.gnu.org; 6 Feb 2025 04:26:43 +0000 Received: from localhost ([127.0.0.1]:53636 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tftTO-0002W7-Ga for submit@debbugs.gnu.org; Wed, 05 Feb 2025 23:26:42 -0500 Received: from out-189.mta1.migadu.com ([2001:41d0:203:375::bd]:42369) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tftTJ-0002VT-3L for 76082@debbugs.gnu.org; Wed, 05 Feb 2025 23:26:37 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpfr.net; s=key1; t=1738815990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jf0lWL+Q51AXR8iJHOrYfOcwvNwOczb6iewcDMc3Z4Y=; b=E9wvFNnBDvqzanmcZludj3IoklDNAanJY2na22pmwWWCOl05/01RZ4KlfqXECNcEDYJKWK 20T6fN5soppN9J+MJVJrmYutsrw055FiZFCxZCPL8O8uiQ8CwiXbjQdypJaXx50nfxPlkv By85HTHa+2dceCrVg8SWz9v9QwVuHpq74YL/N9vK1ssOvwpSRiQcrPhAUD1cYtfQxxYIxd f6XCZkJgNoROhIJQ57hV9iScEiwjrCqysyntpE2FzWbhg9ofEyusEFq6hBRI9EDQxu5pbf AvKRcv/9SoB8YlA21N3FPPkem97GvdUntycvtMlugCPUdXwRo5EawzQRtAlgjQ== From: Liam Hupfer Date: Wed, 5 Feb 2025 22:25:05 -0600 Message-ID: <3bdb2d798b0ef6ffbba1f20e7263e47be6e9b9e3.1738815703.git.liam@hpfr.net> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Previously, the check came after guix_get_bin. There’s no need to fetch the rather large release archive if there’s an existing installation, so check first. Refactor the check into a function similar to other preflight checks. * etc/guix-install.sh: Check for existing installation before downloading. Change-Id: I5506fb1cacdc88bd6355e8dfa1f690acf7886c1f --- etc/guix-install.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 7a731962b3..297a726ad6 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -315,6 +315,19 @@ chk_sys_nscd() fi } +chk_existing() +{ # Avoid clobbering existing installations. + _debug "--- [ ${FUNCNAME[0]} ] ---" + + if [[ -e /var/guix && -e /gnu ]]; then + if [ -n "$GUIX_ALLOW_OVERWRITE" ]; then + _msg_warn "Overwriting existing installation!" + else + die "A previous Guix installation was found. Refusing to overwrite." + fi + fi +} + # Configure substitute discovery according to user's preferences. # $1 is the installed service file to edit. configure_substitute_discovery() { @@ -393,16 +406,6 @@ sys_create_store() local pkg="$1" local tmp_path="$2" - _debug "--- [ ${FUNCNAME[0]} ] ---" - - if [[ -e /var/guix && -e /gnu ]]; then - if [ -n "$GUIX_ALLOW_OVERWRITE" ]; then - _msg_warn "Overwriting existing installation!" - else - die "A previous Guix installation was found. Refusing to overwrite." - fi - fi - cd "$tmp_path" _msg_info "Installing /var/guix and /gnu..." # Strip (skip) the leading ‘.’ component, which fails on read-only ‘/’. @@ -875,6 +878,7 @@ main_install() chk_gpg_keyring chk_sys_arch chk_sys_nscd + chk_existing _msg_info "system is ${ARCH_OS}"