diff --git a/pkgs/distro-build/config.rkt b/pkgs/distro-build/config.rkt index 09e7973968..fcde926a98 100644 --- a/pkgs/distro-build/config.rkt +++ b/pkgs/distro-build/config.rkt @@ -145,6 +145,8 @@ [(#:site-dest) (path-string? val)] [(#:pdf-doc?) (boolean? val)] [(#:max-snapshots) (real? val)] + [(#:pause-before) (and (real? val) (not (negative? val)))] + [(#:pause-after) (and (real? val) (not (negative? val)))] [(#:readme) (or (string? val) (and (procedure? val) (procedure-arity-includes? val 1)))] diff --git a/pkgs/distro-build/doc.txt b/pkgs/distro-build/doc.txt index 1daefe6897..2299d1d2f3 100644 --- a/pkgs/distro-build/doc.txt +++ b/pkgs/distro-build/doc.txt @@ -239,6 +239,14 @@ Site-configuration keywords (where means no spaces, etc.): #:max-snapshots --- number of snapshots to keep, used by the `snapshot-site' makefile target + #:pause-before --- a pause in seconds to + wait before starting a machine, which may help a virtual machine + avoid confusion from being stopped and started too quickly; the + default is 0 + + #:pause-after --- a pause in seconds to + wait after stopping a machine; the default is 0 + #:custom --- a hash table mapping arbitrary keywords to arbitrary values; when a value for `#:custom' is overriden in a nested configuration, the new table is merged with the overriden diff --git a/pkgs/distro-build/drive-clients.rkt b/pkgs/distro-build/drive-clients.rkt index c0ed0a744c..db349a1334 100644 --- a/pkgs/distro-build/drive-clients.rkt +++ b/pkgs/distro-build/drive-clients.rkt @@ -458,6 +458,7 @@ (limit-and-report-failure c 2 (lambda () + (sleep (get-opt c '#:pause-before 0)) ;; start client, if a VM: (start-client c (or (get-opt c '#:max-vm) 1)) ;; catch failure in build step proper, so we @@ -467,6 +468,7 @@ c 1 (lambda () (client-build c))) ;; stop client, if a VM: - (stop-client c))))))])))) + (stop-client c) + (sleep (get-opt c '#:pause-after 0)))))))])))) (display-time)