[Reproducible-builds] Create tar archive with deterministic file order

Jérémy Bobbio lunar at debian.org
Sat Feb 14 22:27:54 UTC 2015


Steven Chamberlain:
> Finally I ended up with this:
> 
> $ find foo/ -type f -print0 > filelist
> $ tar -Jcvf foo.tar.xz -T filelist --null
> 
> Does that seem like the neatest way, or do you have better suggestions?

You are missing the actual sorting on this one. ;)

Suggested solution:

    find foo -print0 | LC_ALL=C sort -z |
        tar --null -T - --no-recursion -Jcvf foo.tar.xz

> (I thought this problem would be quite common, so I could add it to the
> Wiki FAQ).

It's there already:
https://wiki.debian.org/ReproducibleBuilds/FileOrderInTarballs

-- 
Lunar                                .''`. 
lunar at debian.org                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20150214/f055e5dd/attachment.sig>


More information about the Reproducible-builds mailing list