[Reproducible-commits] [perl] 16/36: Support an empty POD_MAN_DATE environment variable

Mattia Rizzolo mattia at mapreri.org
Tue Nov 17 14:01:00 UTC 2015


This is an automated email from the git hooks/post-receive script.

mapreri-guest pushed a commit to branch pu/reproducible_builds
in repository perl.

commit a3b4c0523cf5854420782710cf8fc8598a933a4c
Author: Russ Allbery <rra at cpan.org>
Date:   Wed Apr 15 22:21:25 2015 -0700

    Support an empty POD_MAN_DATE environment variable
    
    One may want to set this to an empty string.  Handle that correctly.
    
    (backported to Perl 5.20.2 by Niko Tyni <ntyni at debian.org>)
    
    Origin: upstream, http://git.eyrie.org/?p=perl/podlators.git;a=commitdiff;h=e0e9fcb53e8fc954b2b1955385eea18c27f869af
    Bug-Debian: https://bugs.debian.org/780259
    Patch-Name: fixes/podman-empty-date.diff
---
 cpan/podlators/lib/Pod/Man.pm  | 2 +-
 cpan/podlators/t/devise-date.t | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
index 365892e..8997a15 100644
--- a/cpan/podlators/lib/Pod/Man.pm
+++ b/cpan/podlators/lib/Pod/Man.pm
@@ -894,7 +894,7 @@ sub devise_date {
     my ($self) = @_;
 
     # If POD_MAN_DATE is set, always use it.
-    if ($ENV{POD_MAN_DATE}) {
+    if (defined($ENV{POD_MAN_DATE})) {
         return $ENV{POD_MAN_DATE};
     }
 
diff --git a/cpan/podlators/t/devise-date.t b/cpan/podlators/t/devise-date.t
index 9da9d1b..27271d9 100644
--- a/cpan/podlators/t/devise-date.t
+++ b/cpan/podlators/t/devise-date.t
@@ -12,7 +12,7 @@ use warnings;
 use Pod::Man;
 use POSIX qw(strftime);
 
-use Test::More tests => 2;
+use Test::More tests => 3;
 
 # Check that the results of device_date matches strftime.  There is no input
 # file name, so this will use the current time.
@@ -26,3 +26,7 @@ is(
 # Set the override environment variable and ensure that it's honored.
 local $ENV{POD_MAN_DATE} = '2014-01-01';
 is($parser->devise_date, '2014-01-01', 'devise_date honors POD_MAN_DATE');
+
+# Check that an empty environment variable is honored.
+local $ENV{POD_MAN_DATE} = q{};
+is($parser->devise_date, q{}, 'devise_date honors empty POD_MAN_DATE');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/perl.git



More information about the Reproducible-commits mailing list