From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id mJhgHlnJY2fT2QAA62LTzQ:P1 (envelope-from ) for ; Thu, 19 Dec 2024 07:20:57 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id mJhgHlnJY2fT2QAA62LTzQ (envelope-from ) for ; Thu, 19 Dec 2024 08:20:57 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=OmrM0etQ; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=Qu72SP48; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734592857; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=EVW8jbb9u5L41BdaLi+PKnhfahNg1LxL8P7iP7Kkj84=; b=ZDA400cv92t69Xc2LtnBQIewTwUIJ5g/KfWfBNOC3vtik3de3neLLOAtlq9Jkc2GecdKzo yzsXgTu/5m1KA+dSZm4K0QLreWHaj8k7wIrjlwEHYoMhsQFDYFYEMlSFqERRjOtJzzxx8y MhjgiKHwucyaCV1Yj9zgC7Lbc27eNn2dajxTqKGYdcU+Lzj90BrEvV9OsppZSJ0fP0RFH0 +j187ZMmy6LgGQZjQpsDZ+pIOVBin/7XvincMgpQHAM3AUkfCcoqw8C9HrOyDRvLtQEgAE k4DJDU7u0M6crPRPFv5EZor/WRe1LD6q/CY9Wz3hezd06zHzG7VvrEu9luqNDA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=OmrM0etQ; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=Qu72SP48; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734592857; a=rsa-sha256; cv=none; b=LWOfcIOSWiuV5D+NhK0w18H9BX6K9gNL0tk5DDgIb5QSIEygTS5bHwYRIFd/JLNfAuPRgL bR6yfDIs9hkYSvJ5Urfw2OQevqC3e+ajIWkkytHOmfBeZetpj3KbKK7CUb6EY4IzLHmJPW qe9VprPh6kpNkaPgvzP+Q3Mq+ZKvplhvVnOKZYVNAtMkjTYT/E2c36SKLdBReXCEiaM+e7 m4zVFnWY9oPv/G2QwHXTHmZ1K/ajiltY5Ho4zEneLmOlXLtmJUOMD9syDGszRcamO75B0d KTSsjA0gPFgCPH+WufwDd15P/pOIJsF6Yo4WkAVL4SN/eE40qfUuMMuH3rY6Bw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2DE281C8E for ; Thu, 19 Dec 2024 08:20:57 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOApN-0004br-KS; Thu, 19 Dec 2024 02:20:09 -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 1tOApK-0004Yb-Py for guix-patches@gnu.org; Thu, 19 Dec 2024 02:20: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 1tOApK-000221-Gu; Thu, 19 Dec 2024 02:20: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=EVW8jbb9u5L41BdaLi+PKnhfahNg1LxL8P7iP7Kkj84=; b=OmrM0etQG91s11VP5ga2nFa7d9XOcF+tUpqAbf4dX37HJIIKw8kzSIhp21/ZuruMLIvMUtxza4UUFV413fcP87+lDSIs3+hF9ly3wKX+wSyFucvyFl+tX1+WNOZwPBsOKIr4k8U8pI59e5bcMaoWUPCTAE69BlZEQghVJJe1KfNoGp0GGCO/rEMh1mGcdvgyS2jDQBk7dlWQdxzz9sNy6uXRvEgODGG0RxXWJkvNFJziWe5L+kiR11CEZaJP/yw6ZrbR/RsV0UIj7cJomGr0wwYl8rKXW/NC2Yb7cjXR870ZS5tsrWbTItggxq4sqscs+tupH51blKjG9nJbWemaWQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tOApK-0006u4-9m; Thu, 19 Dec 2024 02:20:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74962] [PATCH 3/3] etc/guix-install.sh: Fix quoting and other issues. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: janneke@gnu.org, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, guix-patches@gnu.org Resent-Date: Thu, 19 Dec 2024 07:20:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74962 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74962@debbugs.gnu.org Cc: Maxim Cournoyer , Janneke Nieuwenhuizen , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe X-Debbugs-Original-Xcc: Janneke Nieuwenhuizen , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe Received: via spool by 74962-submit@debbugs.gnu.org id=B74962.173459279026433 (code B ref 74962); Thu, 19 Dec 2024 07:20:06 +0000 Received: (at 74962) by debbugs.gnu.org; 19 Dec 2024 07:19:50 +0000 Received: from localhost ([127.0.0.1]:37223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOAp3-0006sG-TE for submit@debbugs.gnu.org; Thu, 19 Dec 2024 02:19:50 -0500 Received: from mail-pg1-f175.google.com ([209.85.215.175]:56619) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOAoy-0006rj-A6 for 74962@debbugs.gnu.org; Thu, 19 Dec 2024 02:19:44 -0500 Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-801986033f9so234609a12.1 for <74962@debbugs.gnu.org>; Wed, 18 Dec 2024 23:19:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734592718; x=1735197518; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EVW8jbb9u5L41BdaLi+PKnhfahNg1LxL8P7iP7Kkj84=; b=Qu72SP486PJO67woubxRJx5V4ox83T0B6+QF6aTKqSwyKMLydT7IJJhPgpBpjJxQUd wKE9DWiPZkzKw/9Qywn5C+z6q1W4/f9VP1p9VjTv/nO2c2TuGj9bAhe7/hkY78J7WTtb UCq8mRTedZzwXMbI3+HQRtdaLnaheTbJEOpnXqh2O61NCSG/LCE59L4wsId7g0zAVe+T DidyfQwKzz/PW3tAWXIz0xesXjifGDmkoD68R6KUZ1flA6av7Yn80B/Pg3tBdNV51wLH OHos8WWoVMJ9ZTBjk/7SZOousbtfN7X4xWfezqPiwRynBM2Hda+5gVEpIIw6uMeEqHV3 lQig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734592718; x=1735197518; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EVW8jbb9u5L41BdaLi+PKnhfahNg1LxL8P7iP7Kkj84=; b=ra7+j2rtL0itOqyMZ/nRW31PX9Th6141z+TbxJFa6YzgSyH0rEvuPO11ZbtkDJEuiW WvfFRJoUaty5m6DMF1E4IRF0ZPxlONwJpmofHws+eZS1UYZib1fQQc1S0drJEEJhrjsF Bs1m6ZBdejn0CN+IAcLItlpxAE+qiLugmFyjBs2hot4f5SOUV9QI+3ON27wrzEadcGLa tpNTPFvKwPl1r4Xboe0n5KjmZFYjNvOUYRb9A33nt1JMDU2ehDIIBDRsbluuI2RuFWKI 8viQ4J33gRtWIRsVC+yJvGx6sWOKqWT9BNWqbS9ertFksR/gd7PdyGq8y1zLH1W7e0pA gTrQ== X-Gm-Message-State: AOJu0Yy1LYQK8Mw6fYMBMPD+i+Htvk5yUwEqcJm0r9GEx//enfyIVFtV Bzf58cvtU/N9h7EqwNT6MaygTyVxGEKwd94vzDTQTY4q5wyOWeto3JHErHpMxKw= X-Gm-Gg: ASbGncv5NMyL3IINga9be+j7wVvKBwSxWyUXQqcu/ZCOuYYnnX8Yqobj09sYczvAAK6 /UXebCNfRYheZnMBnu7v9UnU2khYTxhEPHkeoLzjUNu9KnqY5dkXBXwM60VFyf/VuwUVxMK28V1 UckBySnWeCU2qwOE8bBmUyhyBpcz7jRlwLFbk7KmcrlN8CcSdLk60JwY/dQyrIL5e0NzNGzXC9r wgif4lm3wJ3O4ST1phGZ9JJ0xaVelM8Vw2XutsfT73f8zvLV9Zv7B23DDalaKUHR6bl9R5xuCk= X-Google-Smtp-Source: AGHT+IFkVLbnZzePwr5CuTueTqr+1vP7tjpHYyGWK/XOVrsEQMgxOd7ZAwgSgDXz1mgegwUc2D1Now== X-Received: by 2002:a17:90b:5484:b0:2ea:853b:2761 with SMTP id 98e67ed59e1d1-2f2e93865f6mr8941972a91.37.1734592718135; Wed, 18 Dec 2024 23:18:38 -0800 (PST) Received: from localhost.localdomain ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ed8304absm2833241a91.24.2024.12.18.23.18.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 23:18:37 -0800 (PST) From: Maxim Cournoyer Date: Thu, 19 Dec 2024 16:17:52 +0900 Message-ID: <6b04713cc24b58ab4bbf4ac4060e4d57f7c8e1b3.1734592672.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: 1.47 X-Spam-Score: 1.47 X-Migadu-Queue-Id: 2DE281C8E X-TUID: tDZN92J7Dli1 This change fixes most issues reported by the 'shellcheck' command. * etc/guix-install.sh (add_init_sys_require): Use -n instead of ! -z. (sys_create_build_user): Quote variable expansion. (sys_delete_build_user): Likewise. (sys_create_shell_completion): Likewise. (sys_delete_user_profiles): Likewise. (main): Replace $@ with $* inside string. Change-Id: Ia88509b461b3844f2dd5abf9fb21a5b2bbb8a1e1 --- etc/guix-install.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 481eb6f12a..2ab443d97b 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -151,7 +151,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 @@ -427,12 +427,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}"; @@ -445,7 +445,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 @@ -681,7 +681,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; ln -sf ${var_guix}/etc/bash_completion.d/* "$bash_completion"; @@ -747,10 +747,10 @@ 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 + for user in /home/*; do + rm -f "/home/$user/.guix-profile" + rm -rf "/home/$user/.cache/guix" + rm -rf "/home/$user/.config/guix" done } @@ -898,7 +898,7 @@ main() if [ '--uninstall' = "${uninstall_flag}" ]; then main_uninstall else - echo "unsupported parameters: $@" + echo "unsupported parameters: $*" exit 1 fi fi -- 2.46.0