Avoid pattern matching on records which relies on slot order.

pull/3/head
Mathieu Lirzin 2016-07-01 13:21:59 +02:00
parent 9a9b3fbd45
commit 0f04df2691
1 changed files with 9 additions and 9 deletions

View File

@ -26,8 +26,7 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
(cuirass database) (cuirass database)
(cuirass job) (cuirass job)
(cuirass ui) (cuirass ui)
(ice-9 getopt-long) (ice-9 getopt-long))
(ice-9 match))
(define* (show-help prog) (define* (show-help prog)
(simple-format #t "Usage: ~a [OPTIONS] [CACHEDIR]" prog) (simple-format #t "Usage: ~a [OPTIONS] [CACHEDIR]" prog)
@ -60,13 +59,14 @@ Run Guix job from a git repository cloned in CACHEDIR.
DIR if required." DIR if required."
(or (file-exists? cachedir) (mkdir cachedir)) (or (file-exists? cachedir) (mkdir cachedir))
(with-directory-excursion cachedir (with-directory-excursion cachedir
(match spec (let ((name (job-name job))
(($ <job-spec> name url branch) (url (job-url job))
(or (file-exists? name) (system* "git" "clone" url name)) (branch (job-branch job)))
(with-directory-excursion name (or (file-exists? name) (system* "git" "clone" url name))
(and (zero? (system* "git" "fetch")) (with-directory-excursion name
(zero? (system* "git" "reset" "--hard" (and (zero? (system* "git" "fetch"))
(string-append "origin/" branch))))))))) (zero? (system* "git" "reset" "--hard"
(string-append "origin/" branch))))))))
(define (evaluate store db cachedir spec) (define (evaluate store db cachedir spec)
"Evaluate and build package derivations. Return a list a jobs." "Evaluate and build package derivations. Return a list a jobs."