From 8b192c5550213911f930594f4fd7386f36618237 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 13 Oct 2022 15:52:43 +0200 Subject: shell: Handle '--emulate-fhs' in 'guix shell', not in 'guix environment'. Previously, using 'guix shell -CF coreutils' twice (such that the profile is cache) would result in: guix shell: error: '--profile' cannot be used with package options This patch fixes it by moving argument handling to (guix scripts shell), before 'options-with-caching' is called. * guix/scripts/environment.scm (show-environment-options-help) (%options): Remove '--emulate-fhs'. (guix-environment*): Pass OPTS as-is to 'options/resolve-packages'. * guix/scripts/shell.scm (show-help, %options): Add '--emulate-fhs'. Add the (expression . ...) component to RESULT right from the argument handler. * tests/guix-environment-container.sh: Change '--emulate-fhs' tests to use 'guix shell' instead of 'guix environment'. --- tests/guix-environment-container.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh index 898c57f41b..f233c3fcc0 100644 --- a/tests/guix-environment-container.sh +++ b/tests/guix-environment-container.sh @@ -217,7 +217,7 @@ fi # Test that the container has FHS specific files/directories. Note that /bin # exists in a non-FHS container as it will contain sh, a symlink to the bash # package, so we don't test for it. -guix environment -C --emulate-fhs --ad-hoc --bootstrap guile-bootstrap \ +guix shell -C --emulate-fhs --bootstrap guile-bootstrap \ -- guile -c '(exit (and (file-exists? "/etc/ld.so.cache") (file-exists? "/lib") (file-exists? "/sbin") @@ -229,5 +229,5 @@ guix environment -C --emulate-fhs --ad-hoc --bootstrap guile-bootstrap \ (file-exists? "/usr/share")))' # Test that the ld cache was generated and can be successfully read. -guix environment -C --emulate-fhs --ad-hoc --bootstrap guile-bootstrap \ +guix shell -CF --bootstrap guile-bootstrap \ -- guile -c '(execlp "ldconfig" "ldconfig" "-p")' -- cgit v1.2.3