[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/11: guix package: "guix package -f FILE" ensures FILE returns a packa
From: |
guix-commits |
Subject: |
01/11: guix package: "guix package -f FILE" ensures FILE returns a package. |
Date: |
Wed, 18 Sep 2019 17:10:36 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit f9c0400392843540a87985a67ffb9fb6e4dbc2fa
Author: Ludovic Courtès <address@hidden>
Date: Wed Sep 18 14:55:44 2019 +0200
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 a43c965..21737f4 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -607,7 +607,11 @@ and upgrades."
(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 79d6ec6..79e8928 100644
--- a/tests/guix-package.sh
+++ b/tests/guix-package.sh
@@ -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`" = ""
- branch master updated (cf48ea9 -> da55110), guix-commits, 2019/09/18
- 04/11: gnu: Add python-jupyter-protocol., guix-commits, 2019/09/18
- 06/11: gnu: Add python-jupyter-kernel-test., guix-commits, 2019/09/18
- 01/11: guix package: "guix package -f FILE" ensures FILE returns a package.,
guix-commits <=
- 02/11: linux-container: 'eval/container' correctly passes -L and -C flags., guix-commits, 2019/09/18
- 05/11: gnu: Add python-jupyter-kernel-mgmt., guix-commits, 2019/09/18
- 08/11: doc: Mention the "repository name" for 'guix pack -f docker'., guix-commits, 2019/09/18
- 07/11: gnu: Add Xeus., guix-commits, 2019/09/18
- 03/11: gnu: nlohmann-json-cpp: Update to 3.7.0., guix-commits, 2019/09/18
- 09/11: import: pypi: Refresher recognizes pythonhosted.org source URLs., guix-commits, 2019/09/18
- 11/11: scripts: pull: Add options for generation management, guix-commits, 2019/09/18
- 10/11: pull: Work around Ubuntu's 'sudo'., guix-commits, 2019/09/18