Skip to content

Commit

Permalink
Add support for SOURCE_DATE_EPOCH environment variable
Browse files Browse the repository at this point in the history
This fixes failure to build reproducibly, which can be seen in Debian:
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/far2l.html

See https://reproducible-builds.org/ for details.
  • Loading branch information
mitya57 committed Dec 14, 2024
1 parent d3e2ccb commit fc5dfe2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion far2l/bootstrap/scripts/far2l_m4.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
my $full_version = "$major.$minor.$patch $arch";

# Получаем текущий год
my $current_year = (localtime)[5] + 1900;
my (@tm) = localtime($ENV{SOURCE_DATE_EPOCH} || time());
my $current_year = $tm[5] + 1900;
my $copyright_years = "2016-$current_year";

# Открываем файл и читаем его содержимое
Expand Down
2 changes: 1 addition & 1 deletion far2l/bootstrap/scripts/farver.pl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

die 'Bad args' if !defined($path) || !defined($arch) || !defined($major) || !defined($minor) || !defined($patch);

my (@tm) = localtime(time());
my (@tm) = localtime($ENV{SOURCE_DATE_EPOCH} || time());
my $year = $tm[5] + 1900;

my $tmp = "$path.tmp";
Expand Down

0 comments on commit fc5dfe2

Please sign in to comment.