summaryrefslogtreecommitdiff
path: root/guix/scripts/build.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-02-20 23:41:24 +0100
committerLudovic Courtès <ludo@gnu.org>2013-02-20 23:46:57 +0100
commit9bb2b96aabdbb245c4a409e96b25df2954cfe385 (patch)
treeed08fd19242d1f481be005d655c67187eadb5dee /guix/scripts/build.scm
parent7730d112a2707522943d06940da25a22841a4568 (diff)
ui: Factorize `show-what-to-build'.
* guix/scripts/package.scm (guix-package)[show-what-to-build]: Move to.. * guix/ui.scm (show-what-to-build): ... here. Add a `store' parameter'. Adjust callers. * guix/scripts/build.scm (guix-build): Use it. Remove `req' and `req*' variables.
Diffstat (limited to 'guix/scripts/build.scm')
-rw-r--r--guix/scripts/build.scm23
1 files changed, 2 insertions, 21 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 7863fb881b..fbd22a9e29 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -241,31 +241,12 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n"))
(package-derivation (%store) p sys))))
(_ #f))
opts))
- (req (append-map (lambda (drv-path)
- (let ((d (call-with-input-file drv-path
- read-derivation)))
- (derivation-prerequisites-to-build (%store) d)))
- drv))
- (req* (delete-duplicates
- (append (remove (compose (cut valid-path? (%store) <>)
- derivation-path->output-path)
- drv)
- (map derivation-input-path req))))
(roots (filter-map (match-lambda
(('gc-root . root) root)
(_ #f))
opts)))
- (if (assoc-ref opts 'dry-run?)
- (format (current-error-port)
- (N_ "~:[the following derivation would be built:~%~{ ~a~%~}~;~]"
- "~:[the following derivations would be built:~%~{ ~a~%~}~;~]"
- (length req*))
- (null? req*) req*)
- (format (current-error-port)
- (N_ "~:[the following derivation will be built:~%~{ ~a~%~}~;~]"
- "~:[the following derivations will be built:~%~{ ~a~%~}~;~]"
- (length req*))
- (null? req*) req*))
+
+ (show-what-to-build (%store) drv (assoc-ref opts 'dry-run?))
;; TODO: Add more options.
(set-build-options (%store)