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,11 +176,17 @@
[(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))])
(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)))))