diff options
author | 宋文武 <iyzsong@gmail.com> | 2015-05-23 09:43:12 +0800 |
---|---|---|
committer | 宋文武 <iyzsong@gmail.com> | 2015-05-23 09:43:12 +0800 |
commit | 86a81222cad9841c67e9d9bcd46c567383e9a34f (patch) | |
tree | d976896cba87c5de65d8fdc4bf0be85880c04153 /guix/serialization.scm | |
parent | 3e3d47fc5347a5032fd2039831be1dc1d80576ed (diff) | |
parent | 8605321dd6f3c42590046be9d69112a8c8cf7cbf (diff) |
Merge branch 'master' into gtk-rebuild
Conflicts:
gnu/packages/gtk.scm
Diffstat (limited to 'guix/serialization.scm')
-rw-r--r-- | guix/serialization.scm | 23 |
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) |