From 1de2fe95e017c42aacbaa34f5dab8d48249cc064 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 9 Oct 2015 12:11:24 -0400 Subject: scripts: environment: Use system* instead of system. This allows for direct program invokation without needing a shell to act as a command interpreter. * guix/scripts/environment.scm (%default-shell): New variable. (show-help): Adjust description. Remove '--exec' reference. (%default-options): Use '%default-shell'. (%options): Adjust '--exec' to run command via the default shell. (parse-args): New procedure. (guix-environment): Use 'parse-args'. Use 'system*' instead of 'system'. * tests/guix-environment.sh: Add test for '--' command invokation. * doc/guix.texi ("Invoking guix environment"): Use new syntax. Remove '--exec' documentation. --- tests/guix-environment.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/guix-environment.sh b/tests/guix-environment.sh index 32faf71a4e..f91c78a801 100644 --- a/tests/guix-environment.sh +++ b/tests/guix-environment.sh @@ -40,7 +40,15 @@ test "`wc -l < "$tmpdir/a"`" = 1 cmp "$tmpdir/a" "$tmpdir/b" # Make sure the exit value is preserved. -if guix environment --ad-hoc guile-bootstrap --pure -E 'guile -c "(exit 42)"' +if guix environment --ad-hoc guile-bootstrap --pure -- guile -c '(exit 42)' +then + false +else + test $? = 42 +fi + +# Same as above, but with deprecated -E flag. +if guix environment --ad-hoc guile-bootstrap --pure -E "guile -c '(exit 42)'" then false else @@ -66,7 +74,7 @@ then # as returned by '--search-paths'. guix environment -e '(@@ (gnu packages commencement) gnu-make-boot0)' \ --no-substitutes --pure \ - --exec='echo $PATH $CPATH $LIBRARY_PATH' > "$tmpdir/b" + -- /bin/sh -c 'echo $PATH $CPATH $LIBRARY_PATH' > "$tmpdir/b" ( . "$tmpdir/a" ; echo $PATH $CPATH $LIBRARY_PATH ) > "$tmpdir/c" cmp "$tmpdir/b" "$tmpdir/c" -- cgit v1.2.3