From f351850a64e4651ce008800df464545647e19ebd Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 18 May 2015 18:05:30 -0600 Subject: [PATCH] raco setup: fix reporting of stderr output Handle was mangled in commit 17275b946a. (cherry picked from commit 7067559ac7f3e28094089950f0ab3793b726c5f8) --- racket/collects/setup/setup-core.rkt | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/racket/collects/setup/setup-core.rkt b/racket/collects/setup/setup-core.rkt index 16581acf89..48e4cde39a 100644 --- a/racket/collects/setup/setup-core.rkt +++ b/racket/collects/setup/setup-core.rkt @@ -176,12 +176,18 @@ [(path? cc) (path->relative-string/setup cc #:cache pkg-path-cache)] [else cc])) - (let ([msg (if (exn? x) - (format-error x #:long? #f #:to-string? #t #:cache pkg-path-cache) - ;; `x` is a pair of long and short strings: - (cdr x))]) - (unless (null? x) (for ([str (in-list (regexp-split #rx"\n" msg))]) - (setup-fprintf port #f " ~a" str)))) + (let ([msg (cond + [(exn? x) + (format-error x #:long? #f #:to-string? #t #:cache pkg-path-cache)] + [(not x) + ;; No error; just output + #f] + [else + ;; `x` is a pair of strings, long and short forms of the error: + (cdr x)])]) + (when x + (for ([str (in-list (regexp-split #rx"\n" msg))]) + (setup-fprintf port #f " ~a" str)))) (unless (zero? (string-length out)) (eprintf "STDOUT:\n~a=====\n" out)) (unless (zero? (string-length err)) (eprintf "STDERR:\n~a=====\n" err)))))