summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2016-06-10 22:48:40 +0200
committerMathieu Lirzin <mthl@gnu.org>2016-06-10 23:39:12 +0200
commitd3487acc4286c7cc36547b3329dabd8749a0dd35 (patch)
tree45187c500ccbb3e3ab31d88c6fe262565dc57b4d /bin
parent87a79ae33d82b69133aa011da41afbf3d1f9e98d (diff)
downloadcuirass-d3487acc4286c7cc36547b3329dabd8749a0dd35.tar
cuirass-d3487acc4286c7cc36547b3329dabd8749a0dd35.tar.gz
cuirass: Add --file command line option.
bin/cuirass.in (%options, show-help): Add --file option. (evaluate): Add SPEC argument. (main): Adjust accordingly.
Diffstat (limited to 'bin')
-rw-r--r--bin/cuirass.in16
1 files changed, 10 insertions, 6 deletions
diff --git a/bin/cuirass.in b/bin/cuirass.in
index 2683f6b..ea55264 100644
--- a/bin/cuirass.in
+++ b/bin/cuirass.in
@@ -31,14 +31,16 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
(display "
Run Guix job from a git repository cloned in CACHEDIR.
- -I, --interval[=]N Wait N seconds between each evaluation
+ -f --use-file=FILE Use FILE which defines the job to evaluate.
+ -I, --interval=N Wait N seconds between each evaluation
-V, --version Display version
-h, --help Display this help message")
(newline)
(show-package-information))
(define %options
- `((interval (single-char #\I) (value #t))
+ `((file (single-char #\f) (value #t))
+ (interval (single-char #\I) (value #t))
(version (single-char #\V) (value #f))
(help (single-char #\h) (value #f))))
@@ -80,12 +82,12 @@ DIR if required."
((guix-variable 'derivations 'build-derivations) store (list drv))))
jobs))
-(define (evaluate dir)
+(define (evaluate dir spec)
"Evaluate and build package derivations in directory DIR."
(save-module-excursion
(lambda ()
(set-current-module %user-module)
- (primitive-load (string-append dir "/guix/build-aux/hydra/gnu-system.scm"))))
+ (primitive-load (string-append dir "/" spec))))
(let ((store ((guix-variable 'store 'open-connection))))
(dynamic-wind
(const #t)
@@ -120,12 +122,14 @@ DIR if required."
(show-version progname)
(exit 0))
(else
- (let* ((args (option-ref opts '() #f))
+ (let* ((jobfile (option-ref opts 'file
+ "guix/build-aux/hydra/gnu-system.scm"))
+ (args (option-ref opts '() #f))
(cachedir (if (null? args)
(getenv "CUIRASS_CACHEDIR")
(car args))))
(while #t
(pull-changes cachedir)
(compile cachedir)
- (evaluate cachedir)
+ (evaluate cachedir jobfile)
(sleep (string->number (option-ref opts 'interval "60")))))))))