raco setup: fix reporting of stderr output

Handle was mangled in commit 17275b946a.
This commit is contained in:
Matthew Flatt 2015-05-18 18:05:30 -06:00
parent 542b960d12
commit 7067559ac7

View File

@ -176,12 +176,18 @@
[(path? cc) [(path? cc)
(path->relative-string/setup cc #:cache pkg-path-cache)] (path->relative-string/setup cc #:cache pkg-path-cache)]
[else cc])) [else cc]))
(let ([msg (if (exn? x) (let ([msg (cond
(format-error x #:long? #f #:to-string? #t #:cache pkg-path-cache) [(exn? x)
;; `x` is a pair of long and short strings: (format-error x #:long? #f #:to-string? #t #:cache pkg-path-cache)]
(cdr x))]) [(not x)
(unless (null? x) (for ([str (in-list (regexp-split #rx"\n" msg))]) ;; No error; just output
(setup-fprintf port #f " ~a" str)))) #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 out)) (eprintf "STDOUT:\n~a=====\n" out))
(unless (zero? (string-length err)) (eprintf "STDERR:\n~a=====\n" err))))) (unless (zero? (string-length err)) (eprintf "STDERR:\n~a=====\n" err)))))