summaryrefslogtreecommitdiff
path: root/guix/serialization.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/serialization.scm')
-rw-r--r--guix/serialization.scm23
1 files changed, 8 insertions, 15 deletions
diff --git a/guix/serialization.scm b/guix/serialization.scm
index a99f53ee0b..7a3defc03d 100644
--- a/guix/serialization.scm
+++ b/guix/serialization.scm
@@ -140,10 +140,9 @@ substitute invalid byte sequences with question marks. This is a
;; not very efficient. Eventually Guile may provide a lightweight
;; permissive UTF-8 decoder.
(let* ((bv (read-byte-string p))
- (port (with-fluids ((%default-port-encoding "UTF-8")
- (%default-port-conversion-strategy
- 'substitute))
- (open-bytevector-input-port bv))))
+ (port (open-bytevector-input-port bv)))
+ (set-port-encoding! port "UTF-8")
+ (set-port-conversion-strategy! port 'substitute)
(get-string-all port)))
(define (write-string-list l p)
@@ -280,17 +279,11 @@ sub-directories of FILE as needed."
(write-string "type" p)
(write-string "directory" p)
(let ((entries
- ;; NOTE: Guile 2.0.5's 'scandir' returns all subdirectories
- ;; unconditionally, including "." and "..", regardless of the
- ;; 'select?' predicate passed to it, so we have to filter
- ;; those out externally.
- (filter (negate (cut member <> '("." "..")))
- ;; 'scandir' defaults to 'string-locale<?' to sort
- ;; files, but this happens to be case-insensitive (at
- ;; least in 'en_US' locale on libc 2.18.) Conversely,
- ;; we want files to be sorted in a case-sensitive
- ;; fashion.
- (scandir f (const #t) string<?))))
+ ;; 'scandir' defaults to 'string-locale<?' to sort files, but
+ ;; this happens to be case-insensitive (at least in 'en_US'
+ ;; locale on libc 2.18.) Conversely, we want files to be
+ ;; sorted in a case-sensitive fashion.
+ (scandir f (negate (cut member <> '("." ".."))) string<?)))
(for-each (lambda (e)
(let ((f (string-append f "/" e)))
(write-string "entry" p)