From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 UIkVDFdjq2O8MQEAbAwnHQ (envelope-from ) for ; Tue, 27 Dec 2022 22:27:51 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id KGwaC1djq2NfZQEAG6o9tA (envelope-from ) for ; Tue, 27 Dec 2022 22:27:51 +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 D9CB83F8A0 for ; Tue, 27 Dec 2022 22:27:50 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAHTW-0001Fc-6y; Tue, 27 Dec 2022 16:27:06 -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 1pAHTT-0001Eq-FO for guix-patches@gnu.org; Tue, 27 Dec 2022 16:27:03 -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 1pAHTT-00040q-6D for guix-patches@gnu.org; Tue, 27 Dec 2022 16:27:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pAHTT-0007tU-1X for guix-patches@gnu.org; Tue, 27 Dec 2022 16:27:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60365] [PATCH 4/4] environment: Avoid false positive on 'PS1' check. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 27 Dec 2022 21:27:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60365 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60365@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 60365-submit@debbugs.gnu.org id=B60365.167217640030293 (code B ref 60365); Tue, 27 Dec 2022 21:27:03 +0000 Received: (at 60365) by debbugs.gnu.org; 27 Dec 2022 21:26:40 +0000 Received: from localhost ([127.0.0.1]:56609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAHT5-0007sS-RU for submit@debbugs.gnu.org; Tue, 27 Dec 2022 16:26:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAHT0-0007rg-Jd for 60365@debbugs.gnu.org; Tue, 27 Dec 2022 16:26:34 -0500 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 1pAHSv-0003xU-Cz; Tue, 27 Dec 2022 16:26:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=mFnGOYrRMxmh7l+dvRYR9J5Hwr/OR0s9vi0mN6SICo0=; b=UtZdI3nlYlHVCiBz3c5b WPM2cHU3TBxVz7ofkp/O/1+z/HLG3T9zlc4gnoJCDrcqLQNfXlpge54XNtgcTtiwCRipytW2t56EY 0vZtBR/rT4jkKVBGAfCJ0KdCQfJERA3dYOUxUr3EKOu/AP6wNg0ij0xhk0LXSZBZxVGbx5x/kbTgN OzXyFVuo4EbUk+SYVBd8cJOpN9IVJNtj6k9wl7+TmltL5NuuDxtaTYCmP0cB3lICGmgbdcCL1Jx80 ex06igMTWRdwfpSlN7WiE4iIbKzcsH/PdUAi8lPL+vwRCFLeTIfJt6/ID2o4i2KnV411MSwfYVecK OBtZSt9h6HG4GQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pAHSv-0007DL-1C; Tue, 27 Dec 2022 16:26:29 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Tue, 27 Dec 2022 22:26:18 +0100 Message-Id: <20221227212618.18063-4-ludo@gnu.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221227212618.18063-1-ludo@gnu.org> References: <20221227212618.18063-1-ludo@gnu.org> 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672176470; 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=mFnGOYrRMxmh7l+dvRYR9J5Hwr/OR0s9vi0mN6SICo0=; b=CnAdyrpNli1GbY4feSYHgq4vqcYCT6pLX+YoWUeR9+kN0NDogEgsX8r9oux2gvO45zSIl0 8/I61Vz342DCwqP8Rj+zdH9HtJm1I80kCUgP8AplVxU28tDGct+orATUayEeXqIc2hOgPB Ah2Cu8gnBniw1pRtndhVuQxvtaZjyPRuxoyqN05yqbTlrjhB3yD1AIoLZG4ZkeSVIuKWeJ rkmW4CoUS0Ul52br5y0Tjh8WIUNzIZwEoIBZmZCImvIp1KgY8/Oq7Ps3HWIQRLldcXYM+w RufnLy4sV3n+SvzuQ4eAAuXyrZGJIzAv+Hm9nN+Ukz6QWPVi0sQ3Uj8wfDhu8g== 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=UtZdI3nl; 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=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1672176470; a=rsa-sha256; cv=none; b=UPIklUYug41xicoZU/e+LJvmEScI4lFC605tPAu9BHsuS9y+CACOJCZVp7Jb+POoKJr3cW o7lkUNQ5lHhS7MxPx3Qu2NtMQI2Nw87/xndROGPtD1XhbwakJs+i50+XP/OILs8A5qsGeI je50G4srMzgsyT5s1Gsw+Exp26YdqEsDRgQUiw76tejR/m5+vNLVy7jsyqSsd7xxFV0e+r s3SQ+qiOO2vQlwpP0aBtoVddrQD/4h4fbgW8srTWt3kkdJu6Nh92qiSFHmoTkFP4YqGWGS VXKmuqtkZSoUt2nlAcEaTLJw1reV1KrVVZVq1/4LkHT8KtU0xSZi0RFowXXhgQ== X-Spam-Score: -0.93 X-Migadu-Queue-Id: D9CB83F8A0 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=UtZdI3nl; 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=pass (policy=none) header.from=gnu.org X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -0.93 X-TUID: JHQ3DjN7oDA0 * guix/scripts/environment.scm (validate-child-shell-environment): Do not warn when 'PS1' refers to 'GUIX_ENVIRONMENT'. --- guix/scripts/environment.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index bdbfa03fcf..c7fd8fd340 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -601,7 +601,12 @@ (define-syntax-rule (warn exp ...) (match (vhash-assoc "PS1" actual) (#f #f) ((_ . str) - (when (and (getenv "PS1") (string=? str (getenv "PS1"))) + (when (and (getenv "PS1") (string=? str (getenv "PS1")) + + ;; 'PS1' might be conditional on 'GUIX_ENVIRONMENT', as + ;; shown in the hint below. + (not (or (string-contains str "$GUIX_ENVIRONMENT") + (string-contains str "${GUIX_ENVIRONMENT")))) (warning (G_ "'PS1' is the same in sub-shell~%")) (display-hint (G_ "Consider setting a different prompt for environment shells to make them distinguishable. -- 2.38.1