[rb-general] Creating reproducible tar files
Eitan Adler
lists at eitanadler.com
Sat Jan 21 17:40:58 CET 2017
On 21 January 2017 at 08:21, <anonmous at sigaint.org> wrote:
> Please change the recommendation to use --owner=0 --group=0 instead of
> --owner=root --group=root as the end goal is to achieve 0 anyway and root
> may not always lead to 0:
>
> https://superuser.com/questions/877037/root-user-uid-got-changed
>
> Similarly using --owner=root --group=root --numeric-owner with tar.exe in
> windows leads to non-zero ids while --owner=0 --group=0 --numeric-owner
> leads to 0 ids.
Wouldn't it be better to recommend using an mtree file instead? This
allows for more specific data to be stored in a machine readable and
parseable format in VCS. While build scripts are also in VCS they are
harder to parse.
>From the man page:
===
An input file in mtree(5) format can be used to create an output
archive with arbitrary ownership, permissions, or names that differ
from existing
data on disk:
$ cat input.mtree
#mtree
usr/bin uid=0 gid=0 mode=0755 type=dir
usr/bin/ls uid=0 gid=0 mode=0755 type=file content=myls
$ tar -cvf output.tar @input.mtree
===
--
Eitan Adler
More information about the rb-general
mailing list