mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
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.
This commit is contained in:
parent
cf48ea9539
commit
f9c0400392
2 changed files with 16 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -331,6 +331,17 @@ cat > "$module_dir/package.scm"<<EOF
|
|||
EOF
|
||||
guix package --bootstrap --install-from-file="$module_dir/package.scm"
|
||||
|
||||
# Make sure an error is raised if the file doesn't return a package.
|
||||
cat > "$module_dir/package.scm"<<EOF
|
||||
(use-modules (gnu packages base))
|
||||
|
||||
(define my-package coreutils) ;returns *unspecified*
|
||||
EOF
|
||||
if guix package --bootstrap --install-from-file="$module_dir/package.scm"
|
||||
then false; else true; fi
|
||||
|
||||
rm "$module_dir/package.scm"
|
||||
|
||||
# This one should not show up in searches since it's no supported on the
|
||||
# current system.
|
||||
test "`guix package -A super-non-portable-emacs`" = ""
|
||||
|
|
Loading…
Reference in a new issue