aboutsummaryrefslogtreecommitdiff
path: root/guix/ui.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-05-20 18:14:55 +0200
committerLudovic Courtès <ludo@gnu.org>2013-05-20 18:29:26 +0200
commit969e678ed9f907764e6412386432dfbddf493f71 (patch)
tree1e03fb0df41eb9d278dd4d75cc57fdf34c79327e /guix/ui.scm
parentd8482ad0d613758b85fdff90c5d6d6d2785564bf (diff)
downloadgnu-guix-969e678ed9f907764e6412386432dfbddf493f71.tar
gnu-guix-969e678ed9f907764e6412386432dfbddf493f71.tar.gz
Add `--max-silent-time' to `guix build' and `guix package'.
* guix/scripts/build.scm (%default-options): Add default `max-silent-time' value. (show-help, %options): Add `--max-silent-time'. (guix-build): Pass `max-silent-time' to `set-build-options'. * guix/scripts/package.scm (%default-options): Add default `max-silent-time' value. (show-help, %options): Add `--max-silent-time'. (guix-package): Pass `max-silent-time' to `set-build-options'. * guix/ui.scm (string->number*): New procedure. * tests/derivations.scm ("build-expression->derivation and max-silent-time"): New test. * doc/guix.texi (Invoking guix package, Invoking guix build): Document `--max-silent-time'.
Diffstat (limited to 'guix/ui.scm')
-rw-r--r--guix/ui.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index 6d81475812..cf94aa0818 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -38,6 +38,7 @@
leave
show-version-and-exit
show-bug-report-information
+ string->number*
show-what-to-build
call-with-error-handling
with-error-handling
@@ -134,6 +135,11 @@ Report bugs to: ~a.") %guix-bug-report-address)
General help using GNU software: <http://www.gnu.org/gethelp/>"))
(newline))
+(define (string->number* str)
+ "Like `string->number', but error out with an error message on failure."
+ (or (string->number str)
+ (leave (_ "~a: invalid number~%") str)))
+
(define (call-with-error-handling thunk)
"Call THUNK within a user-friendly error handler."
(guard (c ((package-input-error? c)