summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-06-17 01:22:35 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-06-29 14:53:21 -0400
commit4f3bdc8f21657dbda857027b3ec8754dd4c7c67b (patch)
treec2a13dca9fdd301c8042696ea5f8f62dcfe43818 /guix
parent6b0e55cde901dd5f6eae72cee10723b7739cadf7 (diff)
downloadguix-patches-4f3bdc8f21657dbda857027b3ec8754dd4c7c67b.tar
guix-patches-4f3bdc8f21657dbda857027b3ec8754dd4c7c67b.tar.gz
pack: Prevent duplicate files in tar archives.
Tar translate duplicate files in the archive into hard links. These can cause problems, as not every tool support them; for example dpkg doesn't. * gnu/system/file-systems.scm (reduce-directories): New procedure. (file-prefix?): Lift the restriction on file prefix. The procedure can be useful for comparing relative file names. Adjust doc. (file-name-depth): New procedure, extracted from ... (btrfs-store-subvolume-file-name): ... here. * guix/scripts/pack.scm (self-contained-tarball/builder): Use reduce-directories. * tests/file-systems.scm ("reduce-directories"): New test.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/pack.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 952c1455be..cee1444110 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -230,13 +230,15 @@ its source property."
`((guix build pack)
(guix build utils)
(guix build union)
- (gnu build install))
+ (gnu build install)
+ (gnu system file-systems))
#:select? import-module?)
#~(begin
(use-modules (guix build pack)
(guix build utils)
((guix build union) #:select (relative-file-name))
(gnu build install)
+ ((gnu system file-systems) #:select (reduce-directories))
(srfi srfi-1)
(srfi srfi-26)
(ice-9 match))
@@ -303,7 +305,7 @@ its source property."
,(string-append "." (%store-directory))
- ,@(delete-duplicates
+ ,@(reduce-directories
(filter-map (match-lambda
(('directory directory)
(string-append "." directory))