aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2021-02-25 10:24:11 +0100
committerMathieu Othacehe <othacehe@gnu.org>2021-02-25 10:24:11 +0100
commit4dfce0115f3d09945bf9f5a0775ffbf20ba39c79 (patch)
tree03cbc1b05dd056702acae723dbdd91db49c4fbb8
parentb6c7e5af026f2d0fdbcc96a7815e15008ef0eb1c (diff)
downloadguix-4dfce0115f3d09945bf9f5a0775ffbf20ba39c79.tar
guix-4dfce0115f3d09945bf9f5a0775ffbf20ba39c79.tar.gz
describe: Make sure package-channels always returns a list.
* guix/describe.scm (package-channels): Return an empty list if the file origin could not be determined.
-rw-r--r--guix/describe.scm20
1 files changed, 10 insertions, 10 deletions
diff --git a/guix/describe.scm b/guix/describe.scm
index 46448de311..0683ad8a27 100644
--- a/guix/describe.scm
+++ b/guix/describe.scm
@@ -156,16 +156,16 @@ not be determined."
(let ((file (if (string-prefix? "/" file)
file
(search-path %load-path file))))
- (and file
- (string-prefix? (%store-prefix) file)
-
- (filter-map
- (lambda (entry)
- (let ((item (manifest-entry-item entry)))
- (and (or (string-prefix? item file)
- (string=? "guix" (manifest-entry-name entry)))
- (manifest-entry-channel entry))))
- (current-profile-entries)))))))
+ (if (and file
+ (string-prefix? (%store-prefix) file))
+ (filter-map
+ (lambda (entry)
+ (let ((item (manifest-entry-item entry)))
+ (and (or (string-prefix? item file)
+ (string=? "guix" (manifest-entry-name entry)))
+ (manifest-entry-channel entry))))
+ (current-profile-entries))
+ '())))))
(define (package-provenance package)
"Return the provenance of PACKAGE as an sexp for use as the 'provenance'