[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/06: linux-initrd: Populate cpio archives in a deterministic order.
From: |
Ludovic Courtès |
Subject: |
05/06: linux-initrd: Populate cpio archives in a deterministic order. |
Date: |
Wed, 24 Jun 2015 16:06:05 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 583323ca1d1af5462f1b45f4be50f96bc8f1e46b
Author: Ludovic Courtès <address@hidden>
Date: Wed Jun 24 17:48:02 2015 +0200
linux-initrd: Populate cpio archives in a deterministic order.
* gnu/build/linux-initrd.scm (write-cpio-archive)[files]: Use 'sort' instead
of 'reverse'.
---
gnu/build/linux-initrd.scm | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/gnu/build/linux-initrd.scm b/gnu/build/linux-initrd.scm
index 2c14883..815c7a0 100644
--- a/gnu/build/linux-initrd.scm
+++ b/gnu/build/linux-initrd.scm
@@ -49,21 +49,22 @@ COMPRESS? is true, compress it using GZIP. On success,
return OUTPUT."
;; directories."
(define files
- ;; XXX: Use a deterministic order.
- (reverse
- (file-system-fold (const #t) ;enter?
- (lambda (file stat result) ;leaf
- (cons file result))
- (lambda (dir stat result) ;down
- (if (string=? dir directory)
- result
- (cons dir result)))
- (lambda (file stat result)
- result)
- (const #f) ;skip
- (const #f) ;error
- '()
- directory)))
+ ;; Use 'sort' so that (1) the order of files is deterministic, and (2)
+ ;; directories appear before the files they contain.
+ (sort (file-system-fold (const #t) ;enter?
+ (lambda (file stat result) ;leaf
+ (cons file result))
+ (lambda (dir stat result) ;down
+ (if (string=? dir directory)
+ result
+ (cons dir result)))
+ (lambda (file stat result)
+ result)
+ (const #f) ;skip
+ (const #f) ;error
+ '()
+ directory)
+ string<?))
(call-with-output-file output
(lambda (port)
- branch master updated (6d149ec -> eae5b3f), Ludovic Courtès, 2015/06/24
- 06/06: linux-initrd: Produce cpio archives with zeroed timestamps, etc., Ludovic Courtès, 2015/06/24
- 03/06: Add (guix cpio)., Ludovic Courtès, 2015/06/24
- 01/06: gnu: pius: Depend on GnuPG 2.0 rather than 2.1., Ludovic Courtès, 2015/06/24
- 04/06: linux-initrd: Use (guix cpio) instead of GNU cpio., Ludovic Courtès, 2015/06/24
- 02/06: tests: Move 'file=?' to (guix tests)., Ludovic Courtès, 2015/06/24
- 05/06: linux-initrd: Populate cpio archives in a deterministic order.,
Ludovic Courtès <=