Issue 2373 darcs dist should be able to create reproducible tar balls

Title darcs dist should be able to create reproducible tar balls
Priority wishlist Status unknown
Milestone Resolved in
Superseder Nosy List bf
Assigned To

Created on 2014-04-09.14:52:57 by bf, last changed 2014-04-09.14:52:57 by bf.

msg17309 (view) Author: bf Date: 2014-04-09.14:52:56
It would be nice if 'darcs dist' supported creating reproducible .tar.gz
files, when given suitable options. At the moment, what I do is this:

(1) get the xml-formatted data of the tag, grep it for the timestamp and
convert it to format suitable for touch:

    timestamp=$(darcs changes --no-interactive --xml-output --matches
'exact "TAG <tag>"'\
        | perl -ne 'print "$1.$2" if /date=.(\d{12})(\d{2})/')

(2) touch every source file with this timestamp:

    darcs show files | xargs touch -t "$timestamp"

(3) darcs dist -d <project-name>-<tag> -t <tag>

This is a step in the right direction and seems to work in simple cases,
but is far from ideal. For instance, what if a file that belongs to an
old tag has been removed later? Since 'darcs show files' has no --tag
option, such a file will not get the same timestamp as the other files.
A work-around would be to 'darcs get --tag="^<tag>$"' to a temporary
location and perform the above actions there.

I assume that the order in which the files are stored in the tar is
deterministic; if this is not the case, then darcs should be modified to
support that.

A side note: the code above demonstrates the hoops one has to go through
just to get the exact timestamp of a patch. It would be nice if the UI
offered more direct ways to get at the low-level meta data of a patch.
Also note that the method above is not reliable, since tag names are not
enforced to be unique per repo. However, these are separate issues.
Date User Action Args
2014-04-09 14:52:57bfcreate