guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: ui: Fix port-buffering with address@hidden


From: Eric Bavier
Subject: 03/03: ui: Fix port-buffering with address@hidden
Date: Tue, 16 Oct 2018 18:30:33 -0400 (EDT)

bavier pushed a commit to branch master
in repository guix.

commit 278f86a43f1561b1c064ce88da012db414ec7efc
Author: Eric Bavier <address@hidden>
Date:   Wed Oct 10 16:42:02 2018 -0500

    ui: Fix port-buffering with address@hidden
    
    * guix/status.scm (build-event-output-port)address@hidden: Do not call 
'setvbuf'
    on custom binary port.
    * tests/status.scm (current-build-output-port, UTF-8 + 
garbage)address@hidden:
    Use "?" in place of REPLACEMENT CHARACTER.
---
 guix/status.scm  | 5 +++--
 tests/status.scm | 5 ++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/guix/status.scm b/guix/status.scm
index 8e05d4e..ffa9d9e 100644
--- a/guix/status.scm
+++ b/guix/status.scm
@@ -588,8 +588,9 @@ The second return value is a thunk to retrieve the current 
state."
 
   ;; The build port actually receives Unicode strings.
   (set-port-encoding! port "UTF-8")
-  (setvbuf port (cond-expand (guile-2.2 'line) (else _IOLBF)))
-
+  (cond-expand
+    ((and guile-2 (not guile-2.2)) #t)
+    (else (setvbuf port 'line)))
   (values port (lambda () %state)))
 
 (define (call-with-status-report on-event thunk)
diff --git a/tests/status.scm b/tests/status.scm
index 3b74946..99abb41 100644
--- a/tests/status.scm
+++ b/tests/status.scm
@@ -125,7 +125,10 @@
 
 (test-equal "current-build-output-port, UTF-8 + garbage"
   ;; What about a mixture of UTF-8 + garbage?
-  '((build-log #f "garbage: �lambda: λ\n"))
+  (let ((replacement (cond-expand
+                      ((and guile-2 (not guile-2.2)) "?")
+                      (else "�"))))
+    `((build-log #f ,(string-append "garbage: " replacement "lambda: λ\n"))))
   (let-values (((port get-status) (build-event-output-port cons '())))
     (display "garbage: " port)
     (put-bytevector port #vu8(128))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]