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.38.3-1+rpi1^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=971fe486f6f449135c5adda71b510fe0d5c29cff;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 0439135..cf72f67 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);