libkcapi/reproducibledate.patch
Marcus Meissner 06fc11f271 Accepting request 508953 from home:bmwiedemann:branches:security
Add reproduciblesort.patch to always link .o files in the same order and
Add reproducibledate.patch to not add current time to man-pages to fix build-compare

OBS-URL: https://build.opensuse.org/request/show/508953
OBS-URL: https://build.opensuse.org/package/show/security/libkcapi?expand=0&rev=12
2017-07-08 14:11:16 +00:00

32 lines
1.1 KiB
Diff

commit fb7b152478b28d998c781f1ad924675b85c314db
Author: Bernhard M. Wiedemann <bwiedemann@suse.de>
Date: Sat Jul 8 15:32:36 2017 +0200
Allow to override build date
in order to allow for reproducible builds.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
Also use gmtime instead of localtime to be independent of timezone.
diff --git a/lib/doc/bin/kernel-doc b/lib/doc/bin/kernel-doc
index 0c8bf6a..2851162 100755
--- a/lib/doc/bin/kernel-doc
+++ b/lib/doc/bin/kernel-doc
@@ -253,10 +253,11 @@ my %highlights = %highlights_man;
my $blankline = $blankline_man;
my $modulename = "Kernel API";
my $function_only = 0;
+my $build_date = $ENV{SOURCE_DATE_EPOCH} || time;
my $man_date = ('January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October',
- 'November', 'December')[(localtime)[4]] .
- " " . ((localtime)[5]+1900);
+ 'November', 'December')[(gmtime($build_date))[4]] .
+ " " . ((gmtime($build_date))[5]+1900);
my $show_not_found = 0;
# Essentially these are globals.