[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/07: environment: Avoid false positive on 'PS1' check.
From: |
guix-commits |
Subject: |
06/07: environment: Avoid false positive on 'PS1' check. |
Date: |
Thu, 5 Jan 2023 09:17:51 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit b5e3701f1aafacb6440cf18275a7f72a683d456e
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue Dec 27 22:09:03 2022 +0100
environment: Avoid false positive on 'PS1' check.
* 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 @@ environment~%")))
(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.
- branch master updated (dc7eb6f07a -> 80902fc210), guix-commits, 2023/01/05
- 02/07: home: services: environment-variables: Add support for literal strings., guix-commits, 2023/01/05
- 04/07: system: Define default 'PS1' in /etc/bashrc rather than ~/.bashrc., guix-commits, 2023/01/05
- 06/07: environment: Avoid false positive on 'PS1' check.,
guix-commits <=
- 07/07: gnu: guile-avahi: Fix cross-compilation., guix-commits, 2023/01/05
- 05/07: environment: Simplify 'PS1' suggestion on '--check'., guix-commits, 2023/01/05
- 01/07: home: '--version' really says "guix home"., guix-commits, 2023/01/05
- 03/07: system, home: Factorize default '.bashrc'., guix-commits, 2023/01/05