aboutsummaryrefslogtreecommitdiff
path: root/tests/store-deduplication.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-07-03 00:26:59 +0200
committerLudovic Courtès <ludo@gnu.org>2018-07-03 00:39:11 +0200
commit3dbf331942f11ee888ccbf849cacdd3a0ab971cd (patch)
treee14b075fe4e103288d7536123bcc4c83f1bf1f3a /tests/store-deduplication.scm
parentaf2f8ae5f14d272d341148764d256792d8ef06aa (diff)
downloadpatches-3dbf331942f11ee888ccbf849cacdd3a0ab971cd.tar
patches-3dbf331942f11ee888ccbf849cacdd3a0ab971cd.tar.gz
deduplication: Place link files under /gnu/store/.links.
Previously they'd always be placed next to TO-REPLACE, which would lead to EPERM in some cases. * guix/store/deduplication.scm (replace-with-link): Add #:swap-directory parameter and honor it. Add call to 'make-file-writable'. Catch 'system-error' around 'rename-file'. (deduplicate): Pass #:swap-directory and remove uses of 'false-if-system-error'. * tests/store-deduplication.scm ("deduplicate"): Add 'chmod' call.
Diffstat (limited to 'tests/store-deduplication.scm')
-rw-r--r--tests/store-deduplication.scm4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/store-deduplication.scm b/tests/store-deduplication.scm
index 2361723199..4ca2ec0f61 100644
--- a/tests/store-deduplication.scm
+++ b/tests/store-deduplication.scm
@@ -47,6 +47,10 @@
(lambda (port)
(put-bytevector port data))))
identical)
+ ;; Make the parent of IDENTICAL read-only. This should not prevent
+ ;; deduplication for inserting its hard link.
+ (chmod (dirname (second identical)) #o544)
+
(call-with-output-file unique
(lambda (port)
(put-bytevector port (string->utf8 "This is unique."))))