mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 10:43:43 +00:00
scripts/kernel-doc: Use $KBUILD_BUILD_TIMESTAMP as man page date
Together with the preceding changes, this allows man pages to be built reproducibly. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
parent
b44158b170
commit
b2c4105b08
@ -253,11 +253,20 @@ my %highlights = %highlights_man;
|
|||||||
my $blankline = $blankline_man;
|
my $blankline = $blankline_man;
|
||||||
my $modulename = "Kernel API";
|
my $modulename = "Kernel API";
|
||||||
my $function_only = 0;
|
my $function_only = 0;
|
||||||
|
my $show_not_found = 0;
|
||||||
|
|
||||||
|
my @build_time;
|
||||||
|
if (defined($ENV{'KBUILD_BUILD_TIMESTAMP'}) &&
|
||||||
|
(my $seconds = `date -d"${ENV{'KBUILD_BUILD_TIMESTAMP'}}" +%s`) ne '') {
|
||||||
|
@build_time = gmtime($seconds);
|
||||||
|
} else {
|
||||||
|
@build_time = localtime;
|
||||||
|
}
|
||||||
|
|
||||||
my $man_date = ('January', 'February', 'March', 'April', 'May', 'June',
|
my $man_date = ('January', 'February', 'March', 'April', 'May', 'June',
|
||||||
'July', 'August', 'September', 'October',
|
'July', 'August', 'September', 'October',
|
||||||
'November', 'December')[(localtime)[4]] .
|
'November', 'December')[$build_time[4]] .
|
||||||
" " . ((localtime)[5]+1900);
|
" " . ($build_time[5]+1900);
|
||||||
my $show_not_found = 0;
|
|
||||||
|
|
||||||
# Essentially these are globals.
|
# Essentially these are globals.
|
||||||
# They probably want to be tidied up, made more localised or something.
|
# They probably want to be tidied up, made more localised or something.
|
||||||
|
Loading…
Reference in New Issue
Block a user