mirror of https://notabug.org/mthl/cuirass.git
cuirass: Add '--one-shot' command line argument.
parent
7e9af4298e
commit
3377d948ef
|
@ -33,6 +33,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
|
||||||
(simple-format #t "Usage: ~a [OPTIONS] SPECFILE~%" (%program-name))
|
(simple-format #t "Usage: ~a [OPTIONS] SPECFILE~%" (%program-name))
|
||||||
(display "Run build jobs from SPECFILE.
|
(display "Run build jobs from SPECFILE.
|
||||||
|
|
||||||
|
--one-shot Evaluate and build jobs only once
|
||||||
--cache-directory=DIR Use DIR for storing repository data
|
--cache-directory=DIR Use DIR for storing repository data
|
||||||
-D --database=DB Use DB to store build results.
|
-D --database=DB Use DB to store build results.
|
||||||
-I, --interval=N Wait N seconds between each evaluation
|
-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))
|
(show-package-information))
|
||||||
|
|
||||||
(define %options
|
(define %options
|
||||||
'((cache-directory (value #t))
|
'((one-shot (value #f))
|
||||||
|
(cache-directory (value #t))
|
||||||
(database (single-char #\f) (value #t))
|
(database (single-char #\f) (value #t))
|
||||||
(interval (single-char #\I) (value #t))
|
(interval (single-char #\I) (value #t))
|
||||||
(version (single-char #\V) (value #f))
|
(version (single-char #\V) (value #f))
|
||||||
|
@ -160,12 +162,15 @@ if required."
|
||||||
(display "You must provide a specification file as argument.~%")
|
(display "You must provide a specification file as argument.~%")
|
||||||
(exit 1))
|
(exit 1))
|
||||||
(else
|
(else
|
||||||
(let ((interval (string->number (option-ref opts 'interval "60")))
|
(let ((one-shot? (option-ref opts 'one-shot #f))
|
||||||
(specs (save-module-excursion
|
(interval (string->number (option-ref opts 'interval "60")))
|
||||||
(λ ()
|
(specs (save-module-excursion
|
||||||
(set-current-module (make-user-module))
|
(λ ()
|
||||||
(primitive-load (car specfile))))))
|
(set-current-module (make-user-module))
|
||||||
|
(primitive-load (car specfile))))))
|
||||||
(with-database db
|
(with-database db
|
||||||
(while #t
|
(if one-shot?
|
||||||
(process-specs db specs)
|
(process-specs db specs)
|
||||||
(sleep interval)))))))))
|
(while #t
|
||||||
|
(process-specs db specs)
|
||||||
|
(sleep interval))))))))))
|
||||||
|
|
Loading…
Reference in New Issue