From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id GBPPCh14HGTnpwAASxT56A (envelope-from ) for ; Thu, 23 Mar 2023 17:02:37 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id +CCWCh14HGR3pQAAauVa8A (envelope-from ) for ; Thu, 23 Mar 2023 17:02:37 +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 C72E61DE2D for ; Thu, 23 Mar 2023 17:02:36 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=OfwaXipJ; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679587357; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=y5gVdeogxSk1LLby3/BAt5DBtWCoosqz8MmjKhbC1O0=; b=eooJaWQr2vY9b4K1/S1vYx9cUT109MrBBM2Q8kzRWKYeBFzgYIleoSX1lgFzVzzP8v/A7m AwMS58anl5SYzxMtCihUPPXlr6smKrQ6HLUzlQvdBapz/XgBowUTT7q04fEWEzfjSnoLgb W0RLmrgzXfIut3aRftt65vZGxfTDgmofBHqgvXUXolV5+fMrL5gDAAR/S5WBmNQ1RlbobC hiLMohaGotzQJI6pibJ8yIpgAsbtWcKea+Q2S48fRf1eAbZ75q0PGa/KAqHb3wLgzhMp5S bL+NdUG//34NewPteZkTEsnJASseoVRuTUpVXk9wP+IVElPenOPR7mv7ITVhwA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679587357; a=rsa-sha256; cv=none; b=t3ML7Le0wyZiVe6d6T7s7UbPoE/KwHKbUmmVb6U5T79PYBZpSOLZ4SMGkUY1vjLayo8Bw2 1dBNK+JAPOztgV6ALWwqnxLzVKSHfUrZG3EWBQQMoKtvR61gcglcLt1L2FPZa69eny7Duv ayR66pJISxAvnOIU/iH3EC3ZHBnC1VB4/gzhYhi+gRlE5sCaPMjVY82Kb7ryU56Cz2n5oC 0Ql4n9k9tw+aCA6wyy0u7USl1mfDTWwUQzJWUfgMOv01x0P3Q3jEx3VvAaLlrxImmgeEsy yAw8PUdZ6bylzbbo5PfmZfzHW/lxigqQb+0zWlHcf8fRKLiabfhokeOWaBE1TA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=OfwaXipJ; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pfNNP-00080T-CY; Thu, 23 Mar 2023 12:01:19 -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 1pfNN9-0007m9-Ey for bug-guix@gnu.org; Thu, 23 Mar 2023 12:01:12 -0400 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 1pfNN8-0001lt-MF for bug-guix@gnu.org; Thu, 23 Mar 2023 12:01:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pfNN8-00039T-8H; Thu, 23 Mar 2023 12:01:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#62406: =?UTF-8?Q?=E2=80=9C!_?= =?UTF-8?Q?failing-command=E2=80=9D?= pattern in shell tests is wrong Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bavier@posteo.net, bug-guix@gnu.org Resent-Date: Thu, 23 Mar 2023 16:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62406 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 62406@debbugs.gnu.org Cc: Eric Bavier X-Debbugs-Original-To: bug-guix@gnu.org X-Debbugs-Original-Xcc: Eric Bavier Received: via spool by submit@debbugs.gnu.org id=B.167958722212054 (code B ref -1); Thu, 23 Mar 2023 16:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 23 Mar 2023 16:00:22 +0000 Received: from localhost ([127.0.0.1]:39176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfNMU-00038M-0y for submit@debbugs.gnu.org; Thu, 23 Mar 2023 12:00:22 -0400 Received: from lists.gnu.org ([209.51.188.17]:55014) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfNMR-00038B-Rg for submit@debbugs.gnu.org; Thu, 23 Mar 2023 12:00:20 -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 1pfNMR-0007Ta-2G for bug-guix@gnu.org; Thu, 23 Mar 2023 12:00:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pfNMQ-0001c0-RS for bug-guix@gnu.org; Thu, 23 Mar 2023 12:00:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=y5gVdeogxSk1LLby3/BAt5DBtWCoosqz8MmjKhbC1O0=; b=OfwaXipJe224BI UvSuwz4Qm5Q5lmEjzj/hgCmp9x1ZH+z01nF3vIczz1cGuLnF1yT1LPlPYziFyL7A69hyAfGIGCjET wmIR5yjKsg21wmELc/mXJjauk8HskExpBZryMOkz2yecBcEJTR2M3nXHybsAvELLWl5pNoMg7jaVH QJbp97k8l3ZjrjtzcnOh5/rWxR/S2X2SEZui7nWS0LfbDI6eD6pmnzUpKrpb4doywTF9HFABpOz6H cgQT0dbFe/hfMBR0OPzYgbfiFj87EDEUFtp+j44zgB19YloUsR9T+kbtJrc2v0mL/KWWhtKUQ5vYw k3/qRb1Ng+qwREDdlx9g==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pfNMP-00048H-At for bug-guix@gnu.org; Thu, 23 Mar 2023 12:00:18 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Tridi 3 Germinal an 231 de la =?UTF-8?Q?R=C3=A9volution, ?= jour de l'Asperge X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 23 Mar 2023 17:00:14 +0100 Message-ID: <87y1nn790x.fsf@inria.fr> 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: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: X-Migadu-Queue-Id: C72E61DE2D X-Spam-Score: -2.95 X-Migadu-Spam-Score: -2.95 X-Migadu-Scanner: scn0.migadu.com List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-TUID: wuApuXrR42kd In (commit d8934360d2453a403b5433e71d09188e4ed23b57), we changed: if command that should fail; then false; else true; fi to: ! command that should fail I had reservations back then, and now I know why: :-) --8<---------------cut here---------------start------------->8--- $ bash -xe -c '! true; true' + true + true $ echo $? 0 $ bash -xe -c '! false; true' + false + true $ echo $? 0 --8<---------------cut here---------------end--------------->8--- Whether or not the command following the exclamation mark succeeds, the statement succeeds. Bummer. The Bash manual (info "(bash) Pipelines") reads: If the reserved word '!' precedes the pipeline, the exit status is the logical negation of the exit status as described above. The shell waits for all commands in the pipeline to terminate before returning a value. To me, that means it should work as we thought, but it=E2=80=99s a fact tha= t it doesn=E2=80=99t. Thoughts? Ludo=E2=80=99.