summaryrefslogtreecommitdiff
path: root/tests
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 /tests
parent6b0e55cde901dd5f6eae72cee10723b7739cadf7 (diff)
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 'tests')
-rw-r--r--tests/file-systems.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/file-systems.scm b/tests/file-systems.scm
index 7f7c373884f..80acb6d5b91 100644
--- a/tests/file-systems.scm
+++ b/tests/file-systems.scm
@@ -1,6 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015, 2017 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2015, 2017 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> 3;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
4;;; 4;;;
5;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
6;;; 6;;;
@@ -50,6 +50,11 @@
50 (device "/foo") 50 (device "/foo")
51 (flags '(bind-mount read-only))))))))) 51 (flags '(bind-mount read-only)))))))))
52 52
53(test-equal "reduce-directories"
54 '("./opt/gnu/" "./opt/gnuism" "a/b/c")
55 (reduce-directories '("./opt/gnu/etc" "./opt/gnu/" "./opt/gnu/bin"
56 "./opt/gnu/lib/debug" "./opt/gnuism" "a/b/c" "a/b/c")))
57
53(test-assert "does not pull (guix config)" 58(test-assert "does not pull (guix config)"
54 ;; This module is meant both for the host side and "build side", so make 59 ;; This module is meant both for the host side and "build side", so make
55 ;; sure it doesn't pull in (guix config), which depends on the user's 60 ;; sure it doesn't pull in (guix config), which depends on the user's