summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2016-06-15 15:30:15 +0200
committerMathieu Lirzin <mthl@gnu.org>2016-06-16 02:12:33 +0200
commitb103ab7eae3246f19c410c7d8cf82329836e63ce (patch)
tree373cecdb224ff67f9ae0cd553f106071b027352e /src
parent7d7251a974b27a8ef4137efa8b80232aca1c96e7 (diff)
downloadcuirass-b103ab7eae3246f19c410c7d8cf82329836e63ce.tar
cuirass-b103ab7eae3246f19c410c7d8cf82329836e63ce.tar.gz
Change <job-spec> and <job> semantics.
Diffstat (limited to 'src')
-rw-r--r--src/cuirass/job.scm34
1 files changed, 25 insertions, 9 deletions
diff --git a/src/cuirass/job.scm b/src/cuirass/job.scm
index 19e83c2..48c49b4 100644
--- a/src/cuirass/job.scm
+++ b/src/cuirass/job.scm
@@ -18,6 +18,7 @@
;;; along with Cuirass. If not, see <http://www.gnu.org/licenses/>.
(define-module (cuirass job)
+ #:use-module (cuirass base)
#:use-module (srfi srfi-9)
#:export (<job>
make-job
@@ -28,9 +29,13 @@
<job-spec>
make-job-spec
+ job-spec?
job-spec-name
+ job-spec-url
+ job-spec-branch
+ job-spec-file
job-spec-proc
- job-spec-metadata))
+ job-spec-arguments))
(define-record-type <job>
(%make-job name derivation metadata)
@@ -39,15 +44,26 @@
(derivation job-derivation) ;string
(metadata job-metadata)) ;alist
-(define* (make-job name drv #:optional (metadata '()))
- (%make-job name drv metadata))
+(define-syntax make-job
+ (syntax-rules ()
+ ;; XXX: Different orders for keyword/argument pairs should be allowed.
+ ((make-job #:name name #:derivation filename #:metadata metadata)
+ (begin
+ (format (current-error-port) "evaluating '~a'... " name)
+ (force-output (current-error-port))
+ (%make-job name
+ (call-with-time-display (λ () filename))
+ metadata)))))
(define-record-type <job-spec>
- (%make-job-spec name proc metadata)
+ (%make-job-spec name url branch file proc arguments)
job-spec?
- (name job-spec-name) ;string
- (proc job-spec-proc) ;thunk
- (metadata job-spec-metadata)) ;alist
+ (name job-spec-name) ;string
+ (url job-spec-url) ;string
+ (branch job-spec-branch) ;string
+ (file job-spec-file) ;string
+ (proc job-spec-proc) ;symbol
+ (arguments job-spec-arguments)) ;alist
-(define* (make-job-spec #:key name procedure metadata)
- (%make-job-spec name procedure metadata))
+(define* (make-job-spec #:key name url branch file proc arguments)
+ (%make-job-spec name url branch file proc arguments))