summaryrefslogtreecommitdiff
path: root/tests/gexp.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2020-12-21 23:42:10 +0100
committerMarius Bakke <marius@gnu.org>2020-12-21 23:42:10 +0100
commitbbe4ed65ed5fe7dc8ed9d226042852387cee3b1e (patch)
tree9fbf0642fe71d0d4f6d7cb4e85b4d1587c8b9b16 /tests/gexp.scm
parent034cfbd2449387c15823cd9ec3e91661f9e5bf49 (diff)
parentf00e68ace070fd5240a4b5874e61c26f6e909b6c (diff)
downloadguix-patches-bbe4ed65ed5fe7dc8ed9d226042852387cee3b1e.tar
guix-patches-bbe4ed65ed5fe7dc8ed9d226042852387cee3b1e.tar.gz
Merge branch 'master' into ungrafting
Diffstat (limited to 'tests/gexp.scm')
-rw-r--r--tests/gexp.scm20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm
index 686334af61..6e92f0e4b3 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -723,10 +723,26 @@
(lambda (port)
(display "This is the second one." port))))))
(build-drv #~(begin
- (use-modules (guix build store-copy))
+ (use-modules (guix build store-copy)
+ (guix build utils)
+ (srfi srfi-1))
+
+ (define (canonical-file? file)
+ ;; Copied from (guix tests).
+ (let ((st (lstat file)))
+ (or (not (string-prefix? (%store-directory) file))
+ (eq? 'symlink (stat:type st))
+ (and (= 1 (stat:mtime st))
+ (zero? (logand #o222 (stat:mode st)))))))
(mkdir #$output)
- (populate-store '("graph") #$output))))
+ (populate-store '("graph") #$output
+ #:deduplicate? #f)
+
+ ;; Check whether 'populate-store' canonicalizes
+ ;; permissions and timestamps.
+ (unless (every canonical-file? (find-files #$output))
+ (error "not canonical!" #$output)))))
(mlet* %store-monad ((one (gexp->derivation "one" build-one))
(two (gexp->derivation "two" (build-two one)))
(drv (gexp->derivation "store-copy" build-drv