From patchwork Tue Apr 1 15:02:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 41130 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 EB60D27BBE2; Tue, 1 Apr 2025 16:04:48 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI, PDS_OTHER_BAD_TLD,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 39C3027BBEE for ; Tue, 1 Apr 2025 16:04:46 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tzdA2-00089c-TO; Tue, 01 Apr 2025 11:04:18 -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 ) id 1tzd9x-00087u-G5 for guix-patches@gnu.org; Tue, 01 Apr 2025 11:04:14 -0400 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 1tzd9x-00035m-1K; Tue, 01 Apr 2025 11:04:13 -0400 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=7XMI5drsteA7hQ1Jxg/umGkusBC47mbOclwLtcEHlM4=; b=TBVJurN0H2uMzAZB2Mn4pxnbcGkEoGByTAWckWUTHZpVAhSbS+NPkeSf4AF4jan1hCKH6xZZ8i+vBo/V9nne0jaulKnl0N9HCwtkBUD9Bbi74mFFFce+hTI7RaqCimbvkSkQ+7jb/GJTkxZBD9/BbLzHsHB1kZ7r7biAg4xs9MUqIxf3lc+YeROlK6I/ki2L/HLrLOX6wW+hCc3GAMcBdK19BdF0YUDtJW8Oxq9P1z8LJUzTD8HTuoZXMs5SQNdThpOs318oJxJjIIQzHux+mZAPKKCDiDYJkR/BuJuc89zFx1hGasPtMFHk/0FJIcCQH79eguGFWV6Nj97UKdo/VQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tzd9p-0004CV-3f; Tue, 01 Apr 2025 11:04:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77035] [PATCH v3 4/5] system & home: profile: Address issues reported by =?utf-8?b?4oCYc2hlbGxjaGVja+KAmS4=?= Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: hako@ultrarare.space, ludo@gnu.org, andrew@trop.in, janneke@gnu.org, tanguy@bioneland.org, guix-patches@gnu.org Resent-Date: Tue, 01 Apr 2025 15:04:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77035 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77035@debbugs.gnu.org Cc: Hilton Chain , Hilton Chain , Ludovic =?utf-8?q?Court=C3=A8s?= , Andrew Tropin , Janneke Nieuwenhuizen , Tanguy Le Carrour X-Debbugs-Original-Xcc: Hilton Chain , Ludovic =?utf-8?q?Court=C3=A8s?= , Andrew Tropin , Janneke Nieuwenhuizen , Tanguy Le Carrour Received: via spool by 77035-submit@debbugs.gnu.org id=B77035.174351984416131 (code B ref 77035); Tue, 01 Apr 2025 15:04:05 +0000 Received: (at 77035) by debbugs.gnu.org; 1 Apr 2025 15:04:04 +0000 Received: from localhost ([127.0.0.1]:50028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tzd9n-0004Bu-5j for submit@debbugs.gnu.org; Tue, 01 Apr 2025 11:04:03 -0400 Received: from mx.boiledscript.com ([88.99.243.112]:37150) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tzd9l-0004BK-3T for 77035@debbugs.gnu.org; Tue, 01 Apr 2025 11:04:02 -0400 From: Hilton Chain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=mail; t=1743519840; 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=7XMI5drsteA7hQ1Jxg/umGkusBC47mbOclwLtcEHlM4=; b=B0sZa+4mdZdWQZW8xsVwZAOOIlcNe5nxhffl474yqLHgQzpOhQwPuAghGIOJx2HR+wSIMM WITVqIyuuznH//6TVnFQoxs8RCXgBbV1Tq9FIjxTDiFstAQjEWAhIWtBIj9L0aPP8wTxDc 1jx4noWcWTJuE5qYduTQiyabknrCyhM1lx+BzCNegdIrvckFlzKe6btcOiGCBBX9VtsGSB 6lfwaNHLEUJHXo0NTuzoTe20Skc5SfV7gqGOvbXcx4zZ4LGCQVPLJBF/ZTiD3AaV6FbWdL pph1lcJqfiQUMgCItZ0JKvweqjOupSiuyZU95G03NzUVKUj9pti7GU56lnxlzA== Date: Tue, 1 Apr 2025 23:02:47 +0800 Message-ID: <10b0b9c1044b1ccc0954d902e9a4436e82a0a964.1743519525.git.hako@ultrarare.space> In-Reply-To: References: MIME-Version: 1.0 X-MS-Reactions: disallow 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 * 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 71464bb712..bbf2f2afd3 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 . # 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. @@ -1152,10 +1152,10 @@ (define* (operating-system-etc-service os) unset HOME_ENVIRONMENT # Prepend 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