aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2014-12-24 10:07:03 -0500
committerMark H Weaver <mhw@netris.org>2014-12-24 10:07:03 -0500
commitf948656c171ac1a8fae90fd0592ab16fdb895776 (patch)
tree218e092e7b050884dbbc5db555db0a2610acce4d /gnu
parent7dcf67c070b926274aaef3234edfb2ea77c24862 (diff)
parent764c077b307f0a9cdc800494da552077d6d23895 (diff)
downloadguix-f948656c171ac1a8fae90fd0592ab16fdb895776.tar
guix-f948656c171ac1a8fae90fd0592ab16fdb895776.tar.gz
Merge branch 'master' into xorg-updates
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages.scm41
1 files changed, 23 insertions, 18 deletions
diff --git a/gnu/packages.scm b/gnu/packages.scm
index c9efd0d691..6109d1f896 100644
--- a/gnu/packages.scm
+++ b/gnu/packages.scm
@@ -105,24 +105,29 @@
(append environment `((,%distro-root-directory . "gnu/packages"))))))
(define* (scheme-files directory)
- "Return the list of Scheme files found under DIRECTORY."
- (file-system-fold (const #t) ; enter?
- (lambda (path stat result) ; leaf
- (if (string-suffix? ".scm" path)
- (cons path result)
- result))
- (lambda (path stat result) ; down
- result)
- (lambda (path stat result) ; up
- result)
- (const #f) ; skip
- (lambda (path stat errno result)
- (warning (_ "cannot access `~a': ~a~%")
- path (strerror errno))
- result)
- '()
- directory
- stat))
+ "Return the list of Scheme files found under DIRECTORY, recursively. The
+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
+ (if (string-suffix? ".scm" path)
+ (cons path result)
+ result))
+ (lambda (path stat result) ; down
+ result)
+ (lambda (path stat result) ; up
+ result)
+ (const #f) ; skip
+ (lambda (path stat errno result)
+ (warning (_ "cannot access `~a': ~a~%")
+ path (strerror errno))
+ result)
+ '()
+ directory
+ stat)
+ string<?))
(define file-name->module-name
(let ((not-slash (char-set-complement (char-set #\/))))