mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
nar: Produce archives with files sorted in C collation order.
* guix/nar.scm (write-file) <directory>: Pass 'string<?' as the second argument to 'scandir'. * tests/nar.scm ("write-file puts file in C locale collation order"): New test.
This commit is contained in:
parent
36bbbbd150
commit
96c7448f37
2 changed files with 33 additions and 3 deletions
|
@ -177,8 +177,13 @@ sub-directories of FILE as needed."
|
|||
((directory)
|
||||
(write-string "type" p)
|
||||
(write-string "directory" p)
|
||||
(let ((entries (remove (cut member <> '("." ".."))
|
||||
(scandir f))))
|
||||
(let* ((select? (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.
|
||||
(entries (scandir f select? string<?)))
|
||||
(for-each (lambda (e)
|
||||
(let ((f (string-append f "/" e)))
|
||||
(write-string "entry" p)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue