guix/guix/scripts
Thiago Jung Bauermann 12c06847f0
environment: Fix ‘--check’ with exported PS1 variable.
If your .bashrc (unnecessarily) exports PS1 and you’re in a non-login
shell, Guix crashes:

user@popigai:~$ guix shell --check coreutils
guix shell: checking the environment variables visible from shell '/bin/bash'...
Backtrace:
          14 (primitive-load "/home/user/.config/guix/current/bin/g…")
In guix/ui.scm:
   2206:7 13 (run-guix . _)
  2169:10 12 (run-guix-command _ . _)
In ice-9/boot-9.scm:
  1752:10 11 (with-exception-handler _ _ #:unwind? _ # _)
  1752:10 10 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
   658:37  9 (thunk)
   1320:8  8 (call-with-build-handler _ _)
   1320:8  7 (call-with-build-handler #<procedure 7fe393b7c420 at g…> …)
In guix/status.scm:
    800:4  6 (call-with-status-report _ _)
In guix/scripts/environment.scm:
   951:12  5 (_)
In guix/store.scm:
  2119:24  4 (run-with-store #<store-connection 256.99 7fe39627e500> …)
In guix/scripts/environment.scm:
   521:35  3 (_ _)
In unknown file:
           2 (string=? ("PS1" . "${debian_chroot:+($debian_chroot)…") …)
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure string=: Wrong type argument in position 1 (expecting string): ("PS1" . "${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]${EXTRA}\\$ ")
user@popigai:~$

This is because the match pattern doesn’t expect `(vhash-assoc "PS1" actual)`
to return a pair.

* guix/scripts/environment.scm (validate-child-shell-environment): Change
match pattern to expect a pair.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-11-14 23:18:08 +01:00
..
container
git Add 'guix git authenticate'. 2020-07-11 12:33:01 +02:00
home home: services: bash: Add ‘aliases’ field. 2021-11-07 23:10:41 +01:00
import import: cran: Allow imports of a specific version. 2021-11-11 00:14:30 +01:00
system gnu: bootloader: Support multiple targets. 2021-08-29 01:05:26 -04:00
archive.scm scripts: Commands warn when passed zero arguments. 2021-05-28 11:36:02 +02:00
authenticate.scm authenticate: Encode strings as ISO-8859-1. 2020-09-15 14:40:20 +02:00
build.scm Revert "guix build: Autoload (gnu packages)." 2021-06-29 00:10:54 +02:00
challenge.scm scripts: challenge: Fix regression. 2021-05-20 11:44:35 +02:00
container.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
copy.scm scripts: Commands warn when passed zero arguments. 2021-05-28 11:36:02 +02:00
deploy.scm reconfigure: Use 'formatted-message'. 2021-06-25 15:12:05 +02:00
describe.scm describe: Gracefully handle profiles that lack provenance info. 2021-05-09 23:46:46 +02:00
discover.scm scripts: discover: Report Avahi errors. 2021-05-22 14:04:19 +02:00
download.scm scripts: download: Replace 'args-fold*' by 'parse-command-line'. 2021-04-01 14:58:54 +02:00
edit.scm scripts: Commands warn when passed zero arguments. 2021-05-28 11:36:02 +02:00
environment.scm environment: Fix ‘--check’ with exported PS1 variable. 2021-11-14 23:18:08 +01:00
gc.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
git.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
graph.scm graph: Add '--max-depth'. 2021-09-21 15:15:52 +02:00
hash.scm guix hash: Honor '-H' when used alongside '-r'. 2021-01-04 11:51:48 +01:00
home.scm guix home: import: Make the user to specify a destination directory. 2021-10-31 00:51:05 +02:00
import.scm Revert the #51061 patch series for now. 2021-10-08 23:31:34 +02:00
install.scm transformations: Show '--help-transform' only where applicable. 2020-11-21 12:39:14 +01:00
lint.scm scripts: lint: Display result of checkers on stdout. 2020-11-21 10:23:08 +00:00
offload.scm ssh: Use 'guix repl' instead of 'guile'. 2020-12-23 16:03:32 +01:00
pack.scm pack: Streamline how files are included in tarballs. 2021-07-18 02:10:49 -04:00
package.scm home: import: Factorize triplicated 'version-spec' procedure. 2021-10-31 00:51:06 +02:00
perform-download.scm download: Use Disarchive as a last resort. 2021-04-29 11:24:48 -04:00
processes.scm processes: Add '--format' and the "normalized" format. 2020-11-29 23:55:57 +01:00
publish.scm publish: Defer narinfo string creation to the http-write. 2021-10-05 18:55:55 +00:00
pull.scm pull: Use SRFI-71 instead of SRFI-11. 2021-06-29 00:00:14 +02:00
refresh.scm refresh: Report suggested input changes with 'info'. 2021-10-15 23:16:29 +02:00
remove.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
repl.scm scripts: repl: Replace 'args-fold*' by 'parse-command-line'. 2021-04-01 14:58:54 +02:00
search.scm scripts: search: Replace 'args-fold*' by 'parse-command-line'. 2021-04-01 14:58:55 +02:00
shell.scm shell: Actually clean up the profile cache. 2021-11-07 23:10:41 +01:00
show.scm scripts: show: Replace 'args-fold*' by 'parse-command-line'. 2021-04-01 14:58:55 +02:00
size.scm scripts: Use 'define-command' and have 'guix help' use that. 2020-09-10 12:27:24 +02:00
substitute.scm substitute: Fix handling of short option "-h". 2021-07-16 19:36:11 +02:00
system.scm gnu: Add platform support. 2021-10-11 12:05:39 +00:00
time-machine.scm inferior: 'cached-channel-instance' no longer calls 'show-what-to-build'. 2021-08-09 18:14:37 +02:00
upgrade.scm upgrade: Allow several regexps. 2020-12-01 11:34:10 +01:00
weather.scm weather: Don't look for exported package replacements twice. 2021-09-03 10:08:27 +01:00