diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm index 7cd7ce78e1..546639818f 100644 --- a/guix/scripts/shell.scm +++ b/guix/scripts/shell.scm @@ -115,7 +115,7 @@ interactive shell in that environment.\n")) (option '(#\f "file") #t #f (lambda (opt name arg result) (alist-cons 'load (tag-package-arg result arg) - result))) + (ensure-ad-hoc result)))) (option '(#\q) #f #f (lambda (opt name arg result) (alist-cons 'explicit-loading? #t result))) diff --git a/tests/guix-shell.sh b/tests/guix-shell.sh index 3bdf625189..d8cae9d614 100644 --- a/tests/guix-shell.sh +++ b/tests/guix-shell.sh @@ -73,6 +73,20 @@ echo "Broken manifest." > "$tmpdir/manifest.scm" (cd "$tmpdir"; SHELL="$(realpath fake-shell.sh)" guix shell --bootstrap -q) rm "$tmpdir/manifest.scm" +# Make sure '-D' affects only the immediately following '-f', and not packages +# that appear later: . +cat > "$tmpdir/empty-package.scm" < /dev/null then # Compute the build environment for the initial GNU Make.