File: 04_reproducible_build.diff

package info (click to toggle)
ne 3.3.4-3
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 2,556 kB
  • sloc: ansic: 25,614; perl: 572; makefile: 265; ruby: 232; sh: 38
file content (20 lines) | stat: -rw-r--r-- 706 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Description: Make the build reproducible
Author: Chris Lamb <lamby@debian.org>
Last-Update: 2025-10-22

--- ne-3.3.4.orig/version.pl
+++ ne-3.3.4/version.pl
@@ -35,9 +35,10 @@ unless ( $version )
 		print "$0: could not determine version.\n";
 		exit 0;
 	}
-my $year  = 1900 + (localtime(time()))[5];
-my $month = substr("00" . (1+(localtime(time()))[4]), -2);
-my $date  = substr("00" . (  (localtime(time()))[3]), -2);
+my @timestamp = gmtime($ENV{SOURCE_DATE_EPOCH} || time);
+my $year  = 1900 + $timestamp[5];
+my $month = substr("00" . (1 + $timestamp[4]), -2);
+my $date  = substr("00" . $timestamp[3], -2);
 
 open  NE_VERSION_TEXINFO, ">doc/version.texinfo";
 print NE_VERSION_TEXINFO qq[\@ignore