Skip to content

Commit 523250b

Browse files
lukas227geneC
authored andcommitted
libinstaller: Use SOURCE_DATE_EPOCH for synthesized modification time 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>
1 parent f1e7b73 commit 523250b

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

libinstaller/bin2c.pl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,11 @@
7171

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

74-
@st = stat STDIN;
75-
76-
printf "\nconst int %s_mtime = %d;\n", $table_name, $st[9];
74+
if (defined $ENV{'SOURCE_DATE_EPOCH'}) {
75+
printf "\nconst int %s_mtime = %s;\n", $table_name, $ENV{'SOURCE_DATE_EPOCH'};
76+
} else {
77+
@st = stat STDIN;
78+
printf "\nconst int %s_mtime = %d;\n", $table_name, $st[9];
79+
}
7780

7881
exit 0;

0 commit comments

Comments
 (0)