utils: 'find-files' returns a sorted list.
* guix/build/utils.scm (find-files): Sort the result lexicographically. * guix/scripts/pull.scm (unpack): Don't sort the result of 'find-files'.
This commit is contained in:
parent
8ce3104e0e
commit
66018f1c33
|
@ -185,29 +185,32 @@ but ignore errors."
|
||||||
lstat))
|
lstat))
|
||||||
|
|
||||||
(define (find-files dir regexp)
|
(define (find-files dir regexp)
|
||||||
"Return the list of files under DIR whose basename matches REGEXP."
|
"Return the lexicographically sorted list of files under DIR whose basename
|
||||||
|
matches REGEXP."
|
||||||
(define file-rx
|
(define file-rx
|
||||||
(if (regexp? regexp)
|
(if (regexp? regexp)
|
||||||
regexp
|
regexp
|
||||||
(make-regexp regexp)))
|
(make-regexp regexp)))
|
||||||
|
|
||||||
(file-system-fold (const #t)
|
;; Sort the result to get deterministic results.
|
||||||
(lambda (file stat result) ; leaf
|
(sort (file-system-fold (const #t)
|
||||||
(if (regexp-exec file-rx (basename file))
|
(lambda (file stat result) ; leaf
|
||||||
(cons file result)
|
(if (regexp-exec file-rx (basename file))
|
||||||
result))
|
(cons file result)
|
||||||
(lambda (dir stat result) ; down
|
result))
|
||||||
result)
|
(lambda (dir stat result) ; down
|
||||||
(lambda (dir stat result) ; up
|
result)
|
||||||
result)
|
(lambda (dir stat result) ; up
|
||||||
(lambda (file stat result) ; skip
|
result)
|
||||||
result)
|
(lambda (file stat result) ; skip
|
||||||
(lambda (file stat errno result)
|
result)
|
||||||
(format (current-error-port) "find-files: ~a: ~a~%"
|
(lambda (file stat errno result)
|
||||||
file (strerror errno))
|
(format (current-error-port) "find-files: ~a: ~a~%"
|
||||||
#f)
|
file (strerror errno))
|
||||||
'()
|
#f)
|
||||||
dir))
|
'()
|
||||||
|
dir)
|
||||||
|
string<?))
|
||||||
|
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
|
|
|
@ -116,9 +116,7 @@ files."
|
||||||
;; download), we must build it first to avoid errors since
|
;; download), we must build it first to avoid errors since
|
||||||
;; (gnutls) is unavailable.
|
;; (gnutls) is unavailable.
|
||||||
(cons (string-append out "/guix/build/download.scm")
|
(cons (string-append out "/guix/build/download.scm")
|
||||||
|
(find-files out "\\.scm")))
|
||||||
;; Sort the file names to get deterministic results.
|
|
||||||
(sort (find-files out "\\.scm") string<?)))
|
|
||||||
|
|
||||||
;; Remove the "fake" (guix config).
|
;; Remove the "fake" (guix config).
|
||||||
(delete-file (string-append out "/guix/config.scm"))
|
(delete-file (string-append out "/guix/config.scm"))
|
||||||
|
|
Loading…
Reference in New Issue