summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2016-07-02 23:08:52 +0200
committerMathieu Lirzin <mthl@gnu.org>2016-07-02 23:08:52 +0200
commit3377d948ef7e5ab71c1e3363aafb61f5fcfcca1f (patch)
treee86a2bf0c711c1f82b3c44b76ecf868ec7a955bb /bin
parent7e9af4298e302a6d12dc15235033faaba6b3a15e (diff)
downloadcuirass-3377d948ef7e5ab71c1e3363aafb61f5fcfcca1f.tar
cuirass-3377d948ef7e5ab71c1e3363aafb61f5fcfcca1f.tar.gz
cuirass: Add '--one-shot' command line argument.
Diffstat (limited to 'bin')
-rw-r--r--bin/cuirass.in23
1 files changed, 14 insertions, 9 deletions
diff --git a/bin/cuirass.in b/bin/cuirass.in
index 86058ae..d7d67f5 100644
--- a/bin/cuirass.in
+++ b/bin/cuirass.in
@@ -33,6 +33,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
(simple-format #t "Usage: ~a [OPTIONS] SPECFILE~%" (%program-name))
(display "Run build jobs from SPECFILE.
+ --one-shot Evaluate and build jobs only once
--cache-directory=DIR Use DIR for storing repository data
-D --database=DB Use DB to store build results.
-I, --interval=N Wait N seconds between each evaluation
@@ -42,7 +43,8 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
(show-package-information))
(define %options
- '((cache-directory (value #t))
+ '((one-shot (value #f))
+ (cache-directory (value #t))
(database (single-char #\f) (value #t))
(interval (single-char #\I) (value #t))
(version (single-char #\V) (value #f))
@@ -160,12 +162,15 @@ if required."
(display "You must provide a specification file as argument.~%")
(exit 1))
(else
- (let ((interval (string->number (option-ref opts 'interval "60")))
- (specs (save-module-excursion
- (λ ()
- (set-current-module (make-user-module))
- (primitive-load (car specfile))))))
+ (let ((one-shot? (option-ref opts 'one-shot #f))
+ (interval (string->number (option-ref opts 'interval "60")))
+ (specs (save-module-excursion
+ (λ ()
+ (set-current-module (make-user-module))
+ (primitive-load (car specfile))))))
(with-database db
- (while #t
- (process-specs db specs)
- (sleep interval)))))))))
+ (if one-shot?
+ (process-specs db specs)
+ (while #t
+ (process-specs db specs)
+ (sleep interval))))))))))