pack: Prevent duplicate files in tar archives.
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>
Thu, 17 Jun 2021 05:22:35 +0000 (01:22 -0400)
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>
Tue, 29 Jun 2021 18:53:21 +0000 (14:53 -0400)
commit4f3bdc8f21657dbda857027b3ec8754dd4c7c67b
treec2a13dca9fdd301c8042696ea5f8f62dcfe43818
parent6b0e55cde901dd5f6eae72cee10723b7739cadf7
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.
gnu/system/file-systems.scm
guix/scripts/pack.scm
tests/file-systems.scm