#714 man page generator: use $SOURCE_DATE_EPOCH if specified
Merged by onosek. Opened by zbyszek.
zbyszek/rpkg manpage-gen-use-source_date_epoch  into  master

Download 714.patch

When doing package builds, centpkg builds the man page using
pyrpkg.man_gen.generate(), and since the man page embeds the build timestamp in
the footer, the result is irreproducible. Use $SOURCE_DATE_EPOCH [1], if set, to
clamp the timestamp.

If SOURCE_DATE_EPOCH is set, but not a valid integer, this will raise an error.
I think this is appropriate, since this would most likely be a result of some
strange operator error.

Checked with:
$ PYTHONPATH=.:centpkg-0.8.2/src python centpkg-0.8.2/doc/centpkg_man_page.py
$ SOURCE_DATE_EPOCH=3001111 PYTHONPATH=.:centpkg-0.8.2/src python centpkg-0.8.2/doc/centpkg_man_page.py
The only difference is the date in the footer.

[1] https://reproducible-builds.org/docs/source-date-epoch/

Signed-off-by: Zbigniew Jędrzejewski-Szmek zbyszek@in.waw.pl

rebased onto 136c0ed8859ef92321c5b784dffd19d5c1df420b

Thanks for the change.

Pull-Request has been merged by onosek

Metadata