blob: 0cdfeffd1fc16c8fab70a151d9dbecb288ce7255 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001From 6198856b5323d6204094293f01b890472618f182 Mon Sep 17 00:00:00 2001
2From: Russ Allbery <rra@cpan.org>
3Date: Wed, 15 Apr 2015 20:49:07 -0700
4Subject: Documentation and test suite updates for UTC fix
5
6Update the Pod::Man and pod2man documentation and the test suite
7for the new UTC-based default page footer, and add a Changes
8entry.
9
10(backported to Perl 5.20.2 by Niko Tyni <ntyni@debian.org>)
11
12Origin: upstream, http://git.eyrie.org/?p=perl/podlators.git;a=commitdiff;h=52db93bf80e4a06f8497e4ebade0506b6ee0e70d
13Bug-Debian: https://bugs.debian.org/780259
14Patch-Name: fixes/podman-utc-docs.diff
15---
16 cpan/podlators/lib/Pod/Man.pm | 6 +++++-
17 cpan/podlators/scripts/pod2man.PL | 11 ++++++-----
18 cpan/podlators/t/devise-date.t | 2 +-
19 3 files changed, 12 insertions(+), 7 deletions(-)
20
21diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
22index c3ba201..365892e 100644
23--- a/cpan/podlators/lib/Pod/Man.pm
24+++ b/cpan/podlators/lib/Pod/Man.pm
25@@ -910,6 +910,8 @@ sub devise_date {
26
27 # Can't use POSIX::strftime(), which uses Fcntl, because MakeMaker uses
28 # this and it has to work in the core which can't load dynamic libraries.
29+ # Use gmtime instead of localtime so that the generated man page does not
30+ # depend on the local time zone setting and is more reproducible
31 my ($year, $month, $day) = (gmtime($time))[5,4,3];
32 return sprintf("%04d-%02d-%02d", $year + 1900, $month + 1, $day);
33 }
34@@ -1656,7 +1658,9 @@ environment variable POD_MAN_DATE, if set, will be used. Failing that,
35 the modification date of the input file will be used, or the current time
36 if stat() can't find that file (which will be the case if the input is
37 from C<STDIN>). If obtained from the file modification date or the
38-current time, he date will be formatted as C<YYYY-MM-DD>.
39+current time, the date will be formatted as C<YYYY-MM-DD> and will be based
40+on UTC (so that the output will be reproducible regardless of local time
41+zone).
42
43 =item errors
44
45diff --git a/cpan/podlators/scripts/pod2man.PL b/cpan/podlators/scripts/pod2man.PL
46index 6af3474..38695f8 100644
47--- a/cpan/podlators/scripts/pod2man.PL
48+++ b/cpan/podlators/scripts/pod2man.PL
49@@ -174,9 +174,10 @@ Contributed Perl Documentation", but also see B<--official> below.
50
51 =item B<-d> I<string>, B<--date>=I<string>
52
53-Set the left-hand footer string to this value. By default, the modification
54-date of the input file will be used, or the current date if input comes from
55-C<STDIN>.
56+Set the left-hand footer string to this value. By default, the
57+modification date of the input file will be used, or the current date if
58+input comes from C<STDIN>, and will be based on UTC (so that the output
59+will be reproducible regardless of local time zone).
60
61 =item B<-errors>=I<style>
62
63@@ -383,8 +384,8 @@ B<pod2man> by Larry Wall and Tom Christiansen.
64
65 =head1 COPYRIGHT AND LICENSE
66
67-Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013 Russ
68-Allbery <rra@stanford.edu>.
69+Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013, 2014,
70+2015 Russ Allbery <rra@cpan.org>.
71
72 This program is free software; you may redistribute it and/or modify it
73 under the same terms as Perl itself.
74diff --git a/cpan/podlators/t/devise-date.t b/cpan/podlators/t/devise-date.t
75index c610dd9..9da9d1b 100644
76--- a/cpan/podlators/t/devise-date.t
77+++ b/cpan/podlators/t/devise-date.t
78@@ -19,7 +19,7 @@ use Test::More tests => 2;
79 my $parser = Pod::Man->new;
80 is(
81 $parser->devise_date,
82- strftime('%Y-%m-%d', localtime()),
83+ strftime('%Y-%m-%d', gmtime()),
84 'devise_date matches strftime'
85 );
86