diff options
author | Lukas Schwaighofer <lukas@schwaighofer.name> | 2017-11-04 11:36:41 -0400 |
---|---|---|
committer | Gene Cumm <gene.cumm@gmail.com> | 2017-11-04 11:37:02 -0400 |
commit | 523250bbd841597bfd60009771f9afa09a324dc7 (patch) | |
tree | 51d9a2aeee685c3d3e244c4d6bf64a7432c9c58b | |
parent | f1e7b73dd8c1d657fd68640c6a2cf430872e703e (diff) | |
download | syslinux-523250bbd841597bfd60009771f9afa09a324dc7.tar.gz syslinux-523250bbd841597bfd60009771f9afa09a324dc7.tar.xz syslinux-523250bbd841597bfd60009771f9afa09a324dc7.zip |
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>
-rwxr-xr-x | libinstaller/bin2c.pl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libinstaller/bin2c.pl b/libinstaller/bin2c.pl index 07c11ddb..c79a506f 100755 --- a/libinstaller/bin2c.pl +++ b/libinstaller/bin2c.pl @@ -71,8 +71,11 @@ if ($align != 0) { 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; |