summaryrefslogtreecommitdiff
path: root/guix/ui.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-05-19 23:08:43 +0200
committerLudovic Courtès <ludo@gnu.org>2014-05-19 23:52:40 +0200
commit52ddf2ae6fb369ec64aae75fc311d6cc57a713b6 (patch)
tree7b7f02838ff6367b4819f6238a85f4fc98e7461e /guix/ui.scm
parent79b0d4e1049afe1ceb5d420a9ceb11c230a1da24 (diff)
ui: Gracefully deal with zero-output derivations.
* guix/ui.scm (show-what-to-build)[built-or-substitutable?]: New procedure. Check whether OUT is #f. Use it. * tests/ui.scm ("show-what-to-build, zero outputs"): New test.
Diffstat (limited to 'guix/ui.scm')
-rw-r--r--guix/ui.scm17
1 files changed, 9 insertions, 8 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index 259dddd481..48b5c745c6 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -261,6 +261,14 @@ error."
derivations listed in DRV. Return #t if there's something to build, #f
otherwise. When USE-SUBSTITUTES?, check and report what is prerequisites are
available for download."
+ (define (built-or-substitutable? drv)
+ (let ((out (derivation->output-path drv)))
+ ;; If DRV has zero outputs, OUT is #f.
+ (or (not out)
+ (or (valid-path? store out)
+ (and use-substitutes?
+ (has-substitutes? store out))))))
+
(let*-values (((build download)
(fold2 (lambda (drv build download)
(let-values (((b d)
@@ -275,14 +283,7 @@ available for download."
((build) ; add the DRV themselves
(delete-duplicates
(append (map derivation-file-name
- (remove (lambda (drv)
- (let ((out (derivation->output-path
- drv)))
- (or (valid-path? store out)
- (and use-substitutes?
- (has-substitutes? store
- out)))))
- drv))
+ (remove built-or-substitutable? drv))
(map derivation-input-path build))))
((download) ; add the references of DOWNLOAD
(if use-substitutes?