From f9c0400392843540a87985a67ffb9fb6e4dbc2fa Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 18 Sep 2019 14:55:44 +0200 Subject: guix package: "guix package -f FILE" ensures FILE returns a package. * guix/scripts/package.scm (options->installable): Add clause for 'install option with a non-package object. * tests/guix-package.sh: Add test. --- guix/scripts/package.scm | 6 +++++- tests/guix-package.sh | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index a43c96516f..21737f43da 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -607,7 +607,11 @@ (define to-install (let-values (((package output) (specification->package+output spec))) (package->manifest-entry* package output)))) - (_ #f)) + (('install . obj) + (leave (G_ "cannot install non-package object: ~s~%") + obj)) + (_ + #f)) opts)) (fold manifest-transaction-install-entry diff --git a/tests/guix-package.sh b/tests/guix-package.sh index 79d6ec65e4..79e89286f1 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh @@ -331,6 +331,17 @@ cat > "$module_dir/package.scm"< "$module_dir/package.scm"<