From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0EqvHEAXmmPD4QAAbAwnHQ (envelope-from ) for ; Wed, 14 Dec 2022 19:34:40 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id qDOtHEAXmmOAfQEA9RJhRA (envelope-from ) for ; Wed, 14 Dec 2022 19:34:40 +0100 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 32A9B3FC6E for ; Wed, 14 Dec 2022 19:34:40 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5WZv-0006jh-OU; Wed, 14 Dec 2022 13:34:03 -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 1p5WZu-0006jK-TR for guix-patches@gnu.org; Wed, 14 Dec 2022 13:34:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5WZu-0000BD-Kf for guix-patches@gnu.org; Wed, 14 Dec 2022 13:34:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p5WZu-0006KQ-4f for guix-patches@gnu.org; Wed, 14 Dec 2022 13:34:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60069] [PATCH 2/2] guix-install.sh: Directly exit in case of errors in chk_require. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 14 Dec 2022 18:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60069 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Tobias Geerinckx-Rice Cc: 60069@debbugs.gnu.org Received: via spool by 60069-submit@debbugs.gnu.org id=B60069.167104281724315 (code B ref 60069); Wed, 14 Dec 2022 18:34:02 +0000 Received: (at 60069) by debbugs.gnu.org; 14 Dec 2022 18:33:37 +0000 Received: from localhost ([127.0.0.1]:40869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5WZU-0006K7-Ic for submit@debbugs.gnu.org; Wed, 14 Dec 2022 13:33:36 -0500 Received: from mail-qt1-f179.google.com ([209.85.160.179]:42944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5WZS-0006Jz-81 for 60069@debbugs.gnu.org; Wed, 14 Dec 2022 13:33:35 -0500 Received: by mail-qt1-f179.google.com with SMTP id i20so3172514qtw.9 for <60069@debbugs.gnu.org>; Wed, 14 Dec 2022 10:33:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=4MIQSjdRVCh/DcdPNSMD97BB2BNrPahVHI27ObVR+b0=; b=PQwOqnWIZ7c1pxsQlu8S1m0Pexy4aq7F6ad8EUOFTrVWsr64dBGbGcj+Rs1Aism/3k akUSNZlR42r4lZm9fNLcb0RLeIQezZ30L1aooTnBGGuGecnBEsgGnypIEU7O+4ElBrUw M1WPHp5OcJi96ZBC1TQofRUqr8RL+yZBXXRdH45dnZEQY5SZz9UvVP/W5OCIavkVsdJW peLvGZO+BJicBl40/jcMn1y+cNHxTZB0lFg07lwP6/yawDYkkF3x3nKJyjjs4om/V534 sZLp6D628/UXbI2T/C0/NpmOSne4Ql3z4kacLmZ2IHtmdRx70zbwWCmcZi+NIpfIVZlv oLNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=4MIQSjdRVCh/DcdPNSMD97BB2BNrPahVHI27ObVR+b0=; b=WNJ+N2B8COctMuyzwpCciOnW5vEQQuhFtRGbIz0uR2wfcVnhhZue4fxXl3QOMz1zEr iPIAzA4LGPfl+qxh9GhCt8yUH3ZfNElSq7tMyI09Xblo5tA2ctSxBXXpUhCi20tgXjxB GNNdZPBTS8dZOKiBGNYqz1FgnrVMJZNHMCwSexb3zsqyuC+4bhfkjhNO7IiS8clL0F8q dqpZsWDJIE4MCIr9AgUFJd21G3/khynGRWYRQo9/Lp2XIHZY7z6axMSDxbGEK249Lt5t ExNIJWD/E4PLFUl3vt2MyI4jE3XbWRo/BlxgX0GgeimaonbzFZvvEgQDnIQkCiqYTJ4g AIRA== X-Gm-Message-State: ANoB5pn7mkramZvLk5YRGfdMInc0kDrMCd9ymB4yQFqMnGCxqyM1JtYV Dv9vF3BdhAmLAutbl7kR1VVklEj1hc9S4A== X-Google-Smtp-Source: AA0mqf7eoIkHH6hdwRlsHAdUaKcRDbT0Q5Q3zBz2DaBai+2bi6h0U7epX2rtca/p0paZzqCrCdNwpQ== X-Received: by 2002:a05:622a:1a1a:b0:3a8:cf9:d33d with SMTP id f26-20020a05622a1a1a00b003a80cf9d33dmr34325900qtb.4.1671042808555; Wed, 14 Dec 2022 10:33:28 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1006]) by smtp.gmail.com with ESMTPSA id m5-20020ac84445000000b003a68f5d98c1sm2060006qtn.93.2022.12.14.10.33.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 10:33:28 -0800 (PST) From: Maxim Cournoyer References: <20221214155603.29381-1-maxim.cournoyer@gmail.com> <20221214155603.29381-2-maxim.cournoyer@gmail.com> <871qp2c54w.fsf@nckx> <875yed4zp5.fsf@gmail.com> Date: Wed, 14 Dec 2022 13:33:26 -0500 In-Reply-To: <875yed4zp5.fsf@gmail.com> (Maxim Cournoyer's message of "Wed, 14 Dec 2022 13:17:42 -0500") Message-ID: <87sfhh3keh.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671042880; h=from:from:sender:sender: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: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=4MIQSjdRVCh/DcdPNSMD97BB2BNrPahVHI27ObVR+b0=; b=gwh0WUBD08PvooLGCD6hCe9vMyo1enrS2mNY5VbYGw8sWM+IeyLajPC8wO05/+gUQKfzod IQ/0oSLaxutQ+Q9/cgsAW7Q5M9d8hkCsGsV/z5I7D9elE41nZC8eyviSZVFMTTxLBVq8D7 j87SPfvHXkTmGRf+5dapTV40P+gYDpT4hloNZlUOiIyaEIJDjpeoLNJahCEoPDvT5eYfud gwgecHBR3SUo2P4zj7uVXEHdgVQ1dMg2ci6eudRd41QoNaGuFJAUxYsmsdF+jp5nlKJHap ob6iWBzFADVXDeCoSj87SP4bda4O1VAn2YznIJoCDAQfnhf/g9tAnBiaOjmwSg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=PQwOqnWI; 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)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671042880; a=rsa-sha256; cv=none; b=UAlkVKPbvyyV4qvSqmH7nxr03BPtCPMAKuDaf33DLsevQPflMkr9OXqPKkOdriRHsMoN9v VXWcD9eJyWIu32+EQ0nVwB/lZ5ntj5ApyHBhrYI64WRIltR7jlPYEdyAEwlsjFkPYzT+9V QZTmGygN/WkRSIFAFrDeLynWGK2El86EkqMEpkaz0izQqU9Bk41vzxyoHBUfK5BBxTBrLJ 05jB95FgoKyxruapFaLN/VrC2hWlYMKfFmfoJrzgjCJxHCr/HfOL9gF7MTOZe30pgsH0Z1 mgGgneNd7jIPYJrylOafWL1sCVhs+7dlRS3PnqsL44qlq5KECNbcBf8Tyg9vCQ== X-Migadu-Spam-Score: -1.87 X-Spam-Score: -1.87 X-Migadu-Queue-Id: 32A9B3FC6E X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=PQwOqnWI; 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)" header.from=gmail.com (policy=none) X-TUID: YrgW8V4SRREa Hi, Maxim Cournoyer writes: > Hi Tobias, > > Tobias Geerinckx-Rice writes: > >> Maxim Cournoyer =E5=86=99=E9=81=93=EF=BC=9A >>> - [ "${#warn}" -ne 0 ] && >>> - { _err "${ERR}Missing commands: ${warn[*]}."; >>> - return 1; } >>> - + [ "${#warn}" -ne 0 ] && die "Missing commands: >>> ${warn[*]}." >>> + >> >> I did not run this, but will it not itself trigger -e when the test >> is false? > > This apparently falls in the special casing by Bash of what is > considered a failure when using 'set -e'; here's a test: > > $ cat test.sh > #!/usr/bin/env bash > > set -e > > [ false ] && echo "hey, we made it!" > > $ ./test.sh > hey, we made it! The above example was bogus and unnecessary; looking at it more closely, the test would return true when the 'warn' array contains 1 or more items (missing commands), which would cause the die command to be invoked and the script to exit. The first test handling isn't modified, so it'll chain though the second part the same as it does now. I hope that's a better explanation. --=20 Thanks, Maxim