From ae9dde3857068fd2057390873775ff554f6bf672 Mon Sep 17 00:00:00 2001 From: Hilko Bengen Date: Sun, 27 Jan 2019 05:01:06 +0100 Subject: [PATCH] USe date for pod2man from README mtime Gbp-Pq: Name 0003-USe-date-for-pod2man-from-README-mtime.patch --- podwrapper.pl.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/podwrapper.pl.in b/podwrapper.pl.in index 2765b76..e9db2da 100755 --- a/podwrapper.pl.in +++ b/podwrapper.pl.in @@ -44,6 +44,7 @@ use Pod::Simple; use Pod::Simple::Text; use Pod::Simple::XHTML; use File::Basename; +use POSIX qw< strftime >; # https://www.redhat.com/archives/libguestfs/2013-May/thread.html#00088 eval { $Text::Wrap::huge = "overflow" }; @@ -252,6 +253,11 @@ if (!$date && -d $filename) { local $ENV{GIT_DIR} = $filename; $date = `git show -O/dev/null -s --format=format:%cs`; } +$filename = "$abs_top_srcdir/README"; +if (-r $filename) { + my $mtime = (stat $filename)[9]; + $date = strftime ('%Y-%m-%d', gmtime($mtime)); +} if (!$date) { my ($day, $month, $year) = (gmtime($ENV{SOURCE_DATE_EPOCH} || time))[3,4,5]; $date = sprintf ("%04d-%02d-%02d", $year+1900, $month+1, $day); -- 2.30.2