pack: Streamline how files are included in tarballs.
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>
Tue, 6 Jul 2021 16:27:36 +0000 (12:27 -0400)
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>
Sun, 18 Jul 2021 06:10:49 +0000 (02:10 -0400)
commit11f0698243da27be93b16cec574fbf262279779a
tree2f963278251112d113a448ee8c2ab9d92e324ba6
parentb019496fc3643f0bd837c62078086e3ff51b6001
pack: Streamline how files are included in tarballs.

Thanks to Guillem Jover <guillem@debian.org> on the OFTC's #debian-dpkg
channel for helping with troubleshooting.

Letting GNU Tar recursively walk the complete files hierarchy side-steps the
risks associated with providing a list of file names:

1. Duplicated files in the archive (recorded as hard links by GNU Tar)
2. Missing parent directories.

The above would cause dpkg to malfunction, for example by aborting early and
skipping triggers when there were missing parent directories.

* guix/scripts/pack.scm (self-contained-tarball/builder): Do not call
POPULATE-SINGLE-PROFILE-DIRECTORY, which creates extraneous files such as
/root.  Instead, call POPULATE-STORE and INSTALL-DATABASE-AND-GC-ROOTS
individually to more precisely generate the file system.  Replace the list of
files by the current directory, "." and streamline the way options are passed.
* gnu/system/file-systems.scm (reduce-directories): Remove procedure.
* tests/file-systems.scm ("reduce-directories"): Remove test.
gnu/system/file-systems.scm
guix/scripts/pack.scm
tests/file-systems.scm