[Reproducible-builds] [Help-tar] [PATCH] Add --clamp-mtime option
Jérémy Bobbio
lunar at debian.org
Thu Jun 4 20:02:14 UTC 2015
Paul Eggert:
> On 06/04/2015 08:59 AM, Jérémy Bobbio wrote:
> >BUILD_DATE="Mon, 01 Jun 2015 18:11:50 +0200"
>
> Yes, that's the hassle I was referring to. Something has to keep track of
> BUILD_DATE and update it when appropriate. It would be better if this were
> automated somehow. (Sorry, I don't have an answer here, just pointing out
> the problem.)
We use BUILD_DATE="$(dpkg-parsechangelog -S Date)" to get the time of
the latest debian/changelog entry. Other projects could use
BUILD_DATE="$(git log -1 --pretty="%cd")". I had inlined a value to
put an emphasis on the fact that it was not Debian specific.
> >we currently do:
> >
> > find "$DIR" -newermt "$BUILD_DATE' -print0 | \
> > xargs -0r touch --no-dereference --date="$BUILD_DATE"
> > tar -cf archive.tar "$DIR"
> >
> >And with the `--clamp-mtime` option, we could replace the last lines by:
> >
> > tar -cf archive.tar --mtime="$BUILD_DATE" --clamp-mtime "$DIR"
> >
> >Bonus: actual file metadata are not altered.
>
> OK, but it sounds like you have something working now, and here the bonus
> (actual file metadata not altered) is reasonably minor, so the argument for
> adding this new feature to tar is relatively weak.
Some figures: there's at least 150 packages that could be fixed with
such an option and a change in dpkg. Another batch of 25 (and maybe
more) using `tar` that would benefit from a nicer way to clamp mtimes to
a given value.
https://reproducible.debian.net/issues/unstable/not_using_dh_builddeb_issue.html
https://reproducible.debian.net/issues/unstable/timestamps_in_tarball_issue.html
(and we had some disagreement on adding the find+xargs+touch
construction to dh_builddeb which would be solved by fixing the issue
directly in dpkg; also because making it optional would become easier)
--
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/20150604/95b3b450/attachment.sig>
More information about the Reproducible-builds
mailing list