Skip to content

Commit

Permalink
libinstaller: Use SOURCE_DATE_EPOCH for synthesized modification time…
Browse files Browse the repository at this point in the history
… stamps

Patches bin2c.pl to use the value of SOURCE_DATE_EPOCH instead of real
modification time stamp (only if SOURCE_DATE_EPOCH is set).

Author: Lukas Schwaighofer <lukas@schwaighofer.name>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
  • Loading branch information
lukas227 authored and geneC committed Nov 4, 2017
1 parent f1e7b73 commit 523250b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libinstaller/bin2c.pl
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@

printf "\n};\n\nconst unsigned int %s_len = %u;\n", $table_name, $total_len;

@st = stat STDIN;

printf "\nconst int %s_mtime = %d;\n", $table_name, $st[9];
if (defined $ENV{'SOURCE_DATE_EPOCH'}) {
printf "\nconst int %s_mtime = %s;\n", $table_name, $ENV{'SOURCE_DATE_EPOCH'};
} else {
@st = stat STDIN;
printf "\nconst int %s_mtime = %d;\n", $table_name, $st[9];
}

exit 0;

0 comments on commit 523250b

Please sign in to comment.