aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-02-14 20:14:40 +0100
committerLudovic Courtès <ludo@gnu.org>2018-02-14 20:15:19 +0100
commitbc723b0835442b7e3e2f97957f4aad0161b1d47f (patch)
tree96ed50d53c44caf75297d9265ba55125d94a6e20
parentdb27955ad3fae260ee2aa4bace8dd6a4115d338c (diff)
downloadcuirass-bc723b0835442b7e3e2f97957f4aad0161b1d47f.tar
cuirass-bc723b0835442b7e3e2f97957f4aad0161b1d47f.tar.gz
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'.
-rw-r--r--examples/random-jobs.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/random-jobs.scm b/examples/random-jobs.scm
index 9d26892..8fd895a 100644
--- a/examples/random-jobs.scm
+++ b/examples/random-jobs.scm
@@ -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))