diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-02-20 23:41:24 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-02-20 23:46:57 +0100 |
commit | 9bb2b96aabdbb245c4a409e96b25df2954cfe385 (patch) | |
tree | ed08fd19242d1f481be005d655c67187eadb5dee /guix/scripts/package.scm | |
parent | 7730d112a2707522943d06940da25a22841a4568 (diff) | |
download | gnu-guix-9bb2b96aabdbb245c4a409e96b25df2954cfe385.tar gnu-guix-9bb2b96aabdbb245c4a409e96b25df2954cfe385.tar.gz |
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/package.scm')
-rw-r--r-- | guix/scripts/package.scm | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 38e8ae1150..1f9355ff22 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -380,32 +380,6 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n")) (let ((out (derivation-path->output-path (%guile-for-build)))) (not (valid-path? (%store) out)))) - (define (show-what-to-build drv dry-run?) - ;; Show what will/would be built in realizing the derivations listed - ;; in DRV. - (let* ((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 (cute valid-path? (%store) <>) - derivation-path->output-path) - drv) - (map derivation-input-path req))))) - (if 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*)))) - (define newest-available-packages (memoize find-newest-available-packages)) @@ -589,7 +563,7 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n")) (when (equal? profile %current-profile) (ensure-default-profile)) - (show-what-to-build drv dry-run?) + (show-what-to-build (%store) drv dry-run?) (or dry-run? (and (build-derivations (%store) drv) |