Hilton Chain <hako@HIDDEN>
to control <at> debbugs.gnu.org.
Full text available.
Received: (at submit) by debbugs.gnu.org; 4 Apr 2025 03:23:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 03 23:23:56 2025
Received: from localhost ([127.0.0.1]:36544 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1u0Xeu-0002b9-2H
for submit <at> debbugs.gnu.org; Thu, 03 Apr 2025 23:23:56 -0400
Received: from lists.gnu.org ([2001:470:142::17]:32936)
by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.84_2) (envelope-from <hako@HIDDEN>)
id 1u0Xeq-0002aC-Vu
for submit <at> debbugs.gnu.org; Thu, 03 Apr 2025 23:23:53 -0400
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 <hako@HIDDEN>)
id 1u0Xel-0006tG-Kv
for guix-patches@HIDDEN; Thu, 03 Apr 2025 23:23:47 -0400
Received: from mx.boiledscript.com ([88.99.243.112])
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <hako@HIDDEN>)
id 1u0Xej-0002iM-G1
for guix-patches@HIDDEN; Thu, 03 Apr 2025 23:23:47 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
s=mail; t=1743737023;
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=KBfXMoYrTKnp336HbrqSH0vt0n8oYOd2N4/8TUJiN80=;
b=IszScpr73bD4wpjVvkyg6KHPU/4C1qRTQ8DjZCLjcpPanC85qTkl6MTile69BwReBhsStJ
0prmOASNBht41IVtlBv2UGajLmxbuWMNsrwxHDmyDq6F1hyoB8voF8kSXLYVgb9jIrnaFP
6lTG049g7yXKpQdMpBCXKaRQcy16ORjPZyhIDTwfSSHJz/6TOB7Pc2EAgnao4fGIxEvWOp
cSyn/sC4tsgTIiAiMflulCybHOVVsVQh6nthgmWwLuO28L8seJ8SSRq+B54Jbf/fkwd8+k
OhH3poPuVb8LLhH20GlhW3fDrJ47Mts63zHPQwIMRmcgxFasR7K53t6TTcLztg==
To: guix-patches@HIDDEN
Subject: [PATCH v4 4/6] =?UTF-8?q?system=20&=20home:=20profile:=20Address?=
=?UTF-8?q?=20issues=20reported=20by=20=E2=80=98shellcheck=E2=80=99.?=
Date: Fri, 4 Apr 2025 11:23:01 +0800
Message-ID: <949ac4740c8aa6e91b4b1a3c724d9394c2335127.1743736516.git.hako@HIDDEN>
In-Reply-To: <cover.1743736516.git.hako@HIDDEN>
References: <cover.1743736516.git.hako@HIDDEN>
MIME-Version: 1.0
X-MS-Reactions: disallow
Content-Type: text/plain; charset=UTF-8
X-Debbugs-Cc: Andrew Tropin <andrew@HIDDEN>, Hilton Chain <hako@HIDDEN>, Janneke Nieuwenhuizen <janneke@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Tanguy Le Carrour <tanguy@HIDDEN>
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=88.99.243.112; envelope-from=hako@HIDDEN;
helo=mx.boiledscript.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,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: Hilton Chain <hako@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)
* gnu/system.scm (operating-system-etc-service)[profile]: Address issues
reported by ‘shellcheck’.
* gnu/home/services.scm (environment-variables->setup-environment-script):
Likewise.
* gnu/home/services/shells.scm (add-shell-profile-file): Likewise.
Change-Id: I4e230fd239b8a8450da6ee0c2e58746c9cc38785
---
gnu/home/services.scm | 16 ++++++++++------
gnu/home/services/shells.scm | 4 ++--
gnu/system.scm | 10 +++++-----
3 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index 6be1a49a90..769bc1c033 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -287,27 +287,31 @@ (define (environment-variables->setup-environment-script vars)
case $GUIX_LOCPATH in
*$GUIX_PROFILE/lib/locale*) ;;
- *) export GUIX_LOCPATH=$GUIX_PROFILE/lib/locale:$GUIX_LOCPATH ;;
+ *) export GUIX_LOCPATH=\"$GUIX_PROFILE/lib/locale${GUIX_LOCPATH:+:}$GUIX_LOCPATH\" ;;
esac
case $XDG_DATA_DIRS in
*$GUIX_PROFILE/share*) ;;
- *) export XDG_DATA_DIRS=$GUIX_PROFILE/share:$XDG_DATA_DIRS ;;
+ *) export XDG_DATA_DIRS=\"$GUIX_PROFILE/share${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS\" ;;
esac
+# When MANPATH is unset, add a trailing colon so the system default search path
+# is used.
case $MANPATH in
*$GUIX_PROFILE/share/man*) ;;
- *) export MANPATH=$GUIX_PROFILE/share/man:$MANPATH
+ *) export MANPATH=\"$GUIX_PROFILE/share/man:$MANPATH\" ;;
esac
+# When INFOPATH is unset, add a trailing colon so Emacs searches
+# 'Info-default-directory-list'.
case $INFOPATH in
*$GUIX_PROFILE/share/info*) ;;
- *) export INFOPATH=$GUIX_PROFILE/share/info:$INFOPATH ;;
+ *) export INFOPATH=\"$GUIX_PROFILE/share/info:$INFOPATH\" ;;
esac
case $XDG_CONFIG_DIRS in
*$GUIX_PROFILE/etc/xdg*) ;;
- *) export XDG_CONFIG_DIRS=$GUIX_PROFILE/etc/xdg:$XDG_CONFIG_DIRS ;;
+ *) export XDG_CONFIG_DIRS=\"$GUIX_PROFILE/etc/xdg${XDG_CONFIG_DIRS:+:}$XDG_CONFIG_DIRS\" ;;
esac
case $XCURSOR_PATH in
*$GUIX_PROFILE/share/icons*) ;;
- *) export XCURSOR_PATH=$GUIX_PROFILE/share/icons:$XCURSOR_PATH ;;
+ *) export XCURSOR_PATH=\"$GUIX_PROFILE/share/icons${XCURSOR_PATH:+:}$XCURSOR_PATH\" ;;
esac
# Keep the shell environment clean.
diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index 35c0c52a8e..97c9331e18 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -87,13 +87,13 @@ (define (add-shell-profile-file config)
,(mixed-text-file
"shell-profile"
"\
-HOME_ENVIRONMENT=$HOME/.guix-home
+HOME_ENVIRONMENT=\"$HOME/.guix-home\"
# Skip if already sourced.
case $INFOPATH in
*$HOME_ENVIRONMENT/profile/share/info*) ;;
*) . \"$HOME_ENVIRONMENT/setup-environment\" ;;
esac
-$HOME_ENVIRONMENT/on-first-login
+\"$HOME_ENVIRONMENT/on-first-login\"
unset HOME_ENVIRONMENT\n"
(serialize-configuration
config
diff --git a/gnu/system.scm b/gnu/system.scm
index b67d26b648..cf93ea0fcb 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1071,11 +1071,11 @@ (define* (operating-system-etc-service os)
# loaded when someone logs in via SSH. See <http://bugs.gnu.org/22175>.
# We need 'PATH' to be defined here, for 'cat' and 'cut'. Do this before
# reading the user's 'etc/profile' to allow variables to be overridden.
-if [ -f /etc/environment -a -n \"$SSH_CLIENT\" \\
- -a -z \"$LINUX_MODULE_DIRECTORY\" ]
+if [ -f /etc/environment ] && [ -n \"$SSH_CLIENT\" ] &&
+ [ -z \"$LINUX_MODULE_DIRECTORY\" ]
then
. /etc/environment
- export `/run/current-system/profile/bin/cut -d= -f1 < /etc/environment`
+ export \"$(/run/current-system/profile/bin/cut -d= -f1 < /etc/environment)\"
fi
# Set up environment for all default profiles.
@@ -1154,10 +1154,10 @@ (define* (operating-system-etc-service os)
unset HOME_ENVIRONMENT
# Prepend search paths not in a profile.
-export PATH=/run/privileged/bin:$PATH
+export PATH=\"/run/privileged/bin:$PATH\"
export XCURSOR_PATH=\"$HOME/.icons:$XCURSOR_PATH\"
-if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ]
+if [ -n \"$BASH_VERSION\" ] && [ -f /etc/bashrc ]
then
# Load Bash-specific initialization code.
. /etc/bashrc
--
2.49.0
Hilton Chain <hako@HIDDEN>:andrew@HIDDEN, hako@HIDDEN, janneke@HIDDEN, ludo@HIDDEN, tanguy@HIDDEN, guix-patches@HIDDEN.
Full text available.andrew@HIDDEN, hako@HIDDEN, janneke@HIDDEN, ludo@HIDDEN, tanguy@HIDDEN, guix-patches@HIDDEN:bug#77524; Package guix-patches.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.