commit a0d3509fc7cf017e2926ff3081d4951820d13a98
parent 67b26b34b34c8b9f4ce5a7259e26c47100f73985
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Sat, 20 Jul 2013 07:10:30 -0600
explicit flush after output intended to report progress
original commit: 4d75690affc254e48e4f49e3d2206de790a417f5
Diffstat:
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/pkgs/distro-build/drive-clients.rkt b/pkgs/distro-build/drive-clients.rkt
@@ -91,6 +91,7 @@
(displayln (apply ~a #:separator " "
(map (lambda (p) (if (path? p) (path->string p) p))
(cons exe args))))
+ (flush-output)
(apply system* exe args))
(define (system*/string . args)
@@ -153,6 +154,7 @@
(client-name c))))
(when vbox
(printf "Starting VirtualBox machine ~s\n" vbox)
+ (flush-output)
(case (vbox-state vbox)
[(running) (void)]
[(paused) (vbox-control vbox "resume")]
@@ -169,6 +171,7 @@
(define vbox (get-opt c '#:vbox))
(when vbox
(printf "Stopping VirtualBox machine ~s\n" vbox)
+ (flush-output)
(vbox-control vbox "savestate")
(unless (eq? (vbox-state vbox) 'saved)
(error 'start-client "virtual machine isn't in the expected saved state: ~s" c))))
@@ -355,7 +358,7 @@
(parameterize ([current-custodian cust])
(thread (lambda ()
(sleep (* timeout-factor timeout))
- (printf "timeout for ~s\n" (client-name c))
+ (eprintf "timeout for ~s\n" (client-name c))
;; try nice interrupt, first:
(set! timeout? #t)
(break-thread orig-thread)
@@ -377,6 +380,7 @@
(define log-file (build-path log-dir (client-name c)))
(make-directory* log-dir)
(printf "Logging build: ~a\n" log-file)
+ (flush-output)
(define (go)
(define p (open-output-file log-file
#:exists 'truncate/replace))
diff --git a/pkgs/distro-build/manage-snapshots.rkt b/pkgs/distro-build/manage-snapshots.rkt
@@ -30,6 +30,7 @@
(when (link-exists? link-file)
(printf "Removing old \"current\" link\n")
+ (flush-output)
(delete-file link-file))
(define (get-snapshots)
@@ -46,9 +47,11 @@
(list-tail (sort snapshots string>?) n)))
(for ([s (in-list remove-snapshots)])
(printf "Removing snapshot ~a\n" s)
+ (flush-output)
(delete-directory/files (build-path snapshots-dir s)))))
(printf "Creating \"current\" link\n")
+(flush-output)
(make-file-or-directory-link current-snapshot link-file)
(make-download-page (build-path site-dir