summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2016-06-12 02:14:25 +0200
committerMathieu Lirzin <mthl@gnu.org>2016-06-13 18:11:02 +0200
commit6642651271f5f41b4512d7c7f7c8393bf1d73793 (patch)
treec8236f48b6170745fc5dfe5dcf09265889cfed27 /bin
parent49ab3c8b0de993fdc32d90a258e62c485d23af07 (diff)
downloadcuirass-6642651271f5f41b4512d7c7f7c8393bf1d73793.tar
cuirass-6642651271f5f41b4512d7c7f7c8393bf1d73793.tar.gz
cuirass: Add --subset command line option.
bin/cuirass.in (%options, show-help): Add --subset option. (evaluate): Add ARGS argument. (main): Adjust accordingly.
Diffstat (limited to 'bin')
-rw-r--r--bin/cuirass.in12
1 files changed, 8 insertions, 4 deletions
diff --git a/bin/cuirass.in b/bin/cuirass.in
index 8eaf842..f94099b 100644
--- a/bin/cuirass.in
+++ b/bin/cuirass.in
@@ -32,7 +32,8 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
(display "
Run Guix job from a git repository cloned in CACHEDIR.
- -f --use-file=FILE Use FILE which defines the job to evaluate.
+ -f --use-file=FILE Use FILE which defines the job to evaluate
+ --subset=SET Evaluate SET which is a subset of Guix packages
-I, --interval=N Wait N seconds between each evaluation
-V, --version Display version
-h, --help Display this help message")
@@ -41,6 +42,7 @@ Run Guix job from a git repository cloned in CACHEDIR.
(define %options
`((file (single-char #\f) (value #t))
+ (subset (value #t))
(interval (single-char #\I) (value #t))
(version (single-char #\V) (value #f))
(help (single-char #\h) (value #f))))
@@ -82,7 +84,7 @@ DIR if required."
((guix-variable 'derivations 'build-derivations) store (list drv))))
jobs))
-(define (evaluate store dir spec)
+(define (evaluate store dir spec args)
"Evaluate and build package derivations in directory DIR."
(save-module-excursion
(lambda ()
@@ -91,7 +93,7 @@ DIR if required."
(format #t "prepending ~s to the load path~%" guixdir)
(set! %load-path (cons guixdir %load-path)))
(primitive-load spec)))
- (let ((job-specs ((module-ref %user-module 'hydra-jobs) store '())))
+ (let ((job-specs ((module-ref %user-module 'hydra-jobs) store args)))
(map (match-lambda
(($ <job-spec> name thunk metadata)
(format (current-error-port) "evaluating '~a'... " name)
@@ -117,6 +119,7 @@ DIR if required."
(else
(let* ((store ((guix-variable 'store 'open-connection)))
(jobfile (option-ref opts 'file "tests/gnu-system.scm"))
+ (subset (option-ref opts 'subset "all"))
(args (option-ref opts '() #f))
(cachedir (if (null? args)
(getenv "CUIRASS_CACHEDIR")
@@ -127,7 +130,8 @@ DIR if required."
(while #t
(pull-changes cachedir)
(compile cachedir)
- (let ((jobs (evaluate store cachedir jobfile)))
+ (let ((jobs (evaluate store cachedir jobfile
+ (acons 'subset subset '()))))
((guix-variable 'store 'set-build-options) store
#:use-substitutes? #f)
(build-packages store jobs))