diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-02-16 11:06:31 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-02-16 11:10:12 +0100 |
commit | 5e2495d09e5ad78f8ebb6bfa6fb4ff09fb305ec4 (patch) | |
tree | a25e08f2cf2d0910ec0371f46132edad10b265ec /guix | |
parent | 469069b6e8e05a46e5fd52f1afa1102d2bb1d927 (diff) | |
download | gnu-guix-5e2495d09e5ad78f8ebb6bfa6fb4ff09fb305ec4.tar gnu-guix-5e2495d09e5ad78f8ebb6bfa6fb4ff09fb305ec4.tar.gz |
import: utils: 'alist->package' allows false license.
Reported by <pkill9@runbox.com>.
Fixes <https://bugs.gnu.org/30470>.
* guix/import/utils.scm (alist->package): Check whether 'license' is
false and set the 'license' field to #f in this case.
* tests/import-utils.scm ("alist->package with false license"): New
test.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/import/utils.scm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/guix/import/utils.scm b/guix/import/utils.scm index d4cef6b503..efc6169077 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2012, 2013, 2018 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2016 Jelle Licht <jlicht@fsfe.org> ;;; Copyright © 2016 David Craven <david@craven.ch> ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net> @@ -330,10 +330,12 @@ the expected fields of an <origin> object." (description (assoc-ref meta "description")) (license - (let ((l (assoc-ref meta "license"))) - (or (module-ref (resolve-interface '(guix licenses) #:prefix 'license:) - (spdx-string->license l)) - (license:fsdg-compatible l)))))) + (match (assoc-ref meta "license") + (#f #f) + (l + (or (module-ref (resolve-interface '(guix licenses) #:prefix 'license:) + (spdx-string->license l)) + (license:fsdg-compatible l))))))) (define* (read-lines #:optional (port (current-input-port))) "Read lines from PORT and return them as a list." |