2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/guix-cuirass.git synced 2023-12-14 06:03:04 +01:00

examples: random: Make store file names more distinguishable.

* examples/random-jobs.scm (random-derivation): Add 'suffix' parameter
and honor it.
(make-random-jobs): Pass a non-empty suffix to 'random-derivation'.
This commit is contained in:
Ludovic Courtès 2018-02-14 20:14:40 +01:00
parent db27955ad3
commit bc723b0835

View file

@ -29,10 +29,10 @@
(#:description "dummy job")
(#:long-description "really dummy job"))))
(define (random-derivation store)
(define* (random-derivation store #:optional (suffix ""))
(let ((nonce (random 1e6)))
(run-with-store store
(gexp->derivation "random"
(gexp->derivation (string-append "random" suffix)
#~(let* ((seed (logxor #$(cdr (gettimeofday))
(car (gettimeofday))
(cdr (gettimeofday))))
@ -44,7 +44,8 @@
(define (make-random-jobs store arguments)
(unfold (cut > <> 10)
(lambda (i)
(make-job (string-append "foo" (number->string i))
(delay (random-derivation store))))
(let ((suffix (number->string i)))
(make-job (string-append "foo" suffix)
(delay (random-derivation store suffix)))))
1+
0))