packages: Sort Scheme file lists used by 'fold-packages'.
* gnu/packages.scm (scheme-files): Call 'sort' on result.
This commit is contained in:
parent
ce44657aab
commit
d95523fb8b
@ -105,8 +105,12 @@
|
|||||||
(append environment `((,%distro-root-directory . "gnu/packages"))))))
|
(append environment `((,%distro-root-directory . "gnu/packages"))))))
|
||||||
|
|
||||||
(define* (scheme-files directory)
|
(define* (scheme-files directory)
|
||||||
"Return the list of Scheme files found under DIRECTORY."
|
"Return the list of Scheme files found under DIRECTORY, recursively. The
|
||||||
(file-system-fold (const #t) ; enter?
|
returned list is sorted in alphabetical order."
|
||||||
|
|
||||||
|
;; Sort entries so that 'fold-packages' works in a deterministic fashion
|
||||||
|
;; regardless of details of the underlying file system.
|
||||||
|
(sort (file-system-fold (const #t) ; enter?
|
||||||
(lambda (path stat result) ; leaf
|
(lambda (path stat result) ; leaf
|
||||||
(if (string-suffix? ".scm" path)
|
(if (string-suffix? ".scm" path)
|
||||||
(cons path result)
|
(cons path result)
|
||||||
@ -122,7 +126,8 @@
|
|||||||
result)
|
result)
|
||||||
'()
|
'()
|
||||||
directory
|
directory
|
||||||
stat))
|
stat)
|
||||||
|
string<?))
|
||||||
|
|
||||||
(define file-name->module-name
|
(define file-name->module-name
|
||||||
(let ((not-slash (char-set-complement (char-set #\/))))
|
(let ((not-slash (char-set-complement (char-set #\/))))
|
||||||
|
Loading…
Reference in New Issue
Block a user