using the SOURCE_DATE_EPOCH env var
to make vpp package builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
Change-Id: Iae0935c9bb4ccdfdb65600be543945a88f2e137f
Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
void generate_top_boilerplate(FILE *fp)
{
void generate_top_boilerplate(FILE *fp)
{
- char *datestring = ctime(&starttime);
+ time_t curtime;
+ char *datestring;
+ char *source_date_epoch;
+ if ((source_date_epoch = getenv("SOURCE_DATE_EPOCH")) == NULL || (curtime = (time_t)strtol(source_date_epoch, NULL, 10)) <= 0)
+ curtime = starttime;
+ datestring = asctime(gmtime(&curtime));
fixed_name = fixup_input_filename();
datestring[24] = 0;
fixed_name = fixup_input_filename();
datestring[24] = 0;