summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-12-12 14:59:16 +0100
committerLudovic Courtès <ludo@gnu.org>2012-12-12 14:59:16 +0100
commit70915c1a2ef72e7350b2a29d1d93e30643bce6f3 (patch)
tree0f40211b13f3bbff0c9f51c2637fb6c9dff9e052
parentba55b1cb691e410339fbb446a95c65b9ea59017e (diff)
downloadpatches-70915c1a2ef72e7350b2a29d1d93e30643bce6f3.tar
patches-70915c1a2ef72e7350b2a29d1d93e30643bce6f3.tar.gz
guix-package: Add `--verbose'; silence the environment's build by default.
* guix-package.in (%options): Add `--verbose'. (show-help): Update accordingly. (guix-package): Parameterize `current-build-output-port' according to VERBOSE?. By default, silence the environment build's output.
-rw-r--r--doc/guix.texi4
-rw-r--r--guix-package.in12
2 files changed, 15 insertions, 1 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 2c9cba21a1..b8ab94f5ad 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -235,6 +235,10 @@ Use @var{profile} instead of the user's default profile.
@itemx -n
Show what would be done without actually doing it.
+@item --verbose
+Produce verbose output. In particular, emit the environment's build log
+on the standard error port.
+
@item --bootstrap
Use the bootstrap Guile to build the profile. This option is only
useful to distribution developers.
diff --git a/guix-package.in b/guix-package.in
index 7bc32f851b..ff7f38383e 100644
--- a/guix-package.in
+++ b/guix-package.in
@@ -200,6 +200,8 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n"))
-n, --dry-run show what would be done without actually doing it"))
(display (_ "
-b, --bootstrap use the bootstrap Guile to build the profile"))
+ (display (_ "
+ --verbose produce verbose output"))
(newline)
(display (_ "
-I, --list-installed[=REGEXP]
@@ -242,6 +244,9 @@ Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@"))
(option '(#\b "bootstrap") #f #f
(lambda (opt name arg result)
(alist-cons 'bootstrap? #t result)))
+ (option '("verbose") #f #f
+ (lambda (opt name arg result)
+ (alist-cons 'verbose? #t result)))
(option '(#\I "list-installed") #f #t
(lambda (opt name arg result)
(cons `(query list-installed ,(or arg ""))
@@ -321,6 +326,7 @@ Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@"))
(define (process-actions opts)
;; Process any install/remove/upgrade action from OPTS.
(let* ((dry-run? (assoc-ref opts 'dry-run?))
+ (verbose? (assoc-ref opts 'verbose?))
(profile (assoc-ref opts 'profile))
(install (filter-map (match-lambda
(('install . (? store-path?))
@@ -385,7 +391,11 @@ Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@"))
(basename profile) (+ 1 number))))
(if (string=? old-prof prof)
(format (current-error-port) (_ "nothing to be done~%"))
- (and (build-derivations %store (list prof-drv))
+ (and (parameterize ((current-build-output-port
+ (if verbose?
+ (current-error-port)
+ (%make-void-port "w"))))
+ (build-derivations %store (list prof-drv)))
(begin
(symlink prof name)
(when (file-exists? profile)