From: Hilko Bengen Date: Sun, 27 Jan 2019 04:01:06 +0000 (+0100) Subject: USe date for pod2man from README mtime X-Git-Tag: archive/raspbian/1.12.4-1+rpi1~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=92e21de826bfa181db94564bbcdaf609d0b9fcf9;p=nbdkit.git USe date for pod2man from README mtime Gbp-Pq: Name 0003-USe-date-for-pod2man-from-README-mtime.patch --- diff --git a/podwrapper.pl.in b/podwrapper.pl.in index 9593ebe..6ddbe29 100755 --- a/podwrapper.pl.in +++ b/podwrapper.pl.in @@ -41,6 +41,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" }; @@ -216,6 +217,11 @@ if (!$date && -d $filename) { $_ = `git show -s --format=%ci`; $date = $1 if /^(\d+-\d+-\d+)\s/; } +$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) = (localtime)[3,4,5]; $date = sprintf ("%04d-%02d-%02d", $year+1900, $month+1, $day);