Package: pod2pdf
Version: 0.42-1
Severity: minor
Tags: patch

The following patch corrects the options --timestamp to use ISO 8601
standard for dates and times which is suitable (agnostic; only
numbers) for international use. See

      http://en.wikipedia.org/wiki/ISO_8601
      http://www.cl.cam.ac.uk/~mgk25/iso-time.html

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages pod2pdf depends on:
ii  libgetopt-argvfile-perl       1.11-1     Perl module for reading script opt
ii  libpdf-api2-perl              0.73-1     module for creating or modifying P
ii  perl                          5.10.0-25  Larry Wall's Practical Extraction 
ii  perl-modules                  5.10.0-25  Core Perl modules

Versions of packages pod2pdf recommends:
ii  libfile-type-perl             0.22-1.1   determine file type using magic st
ii  libimage-size-perl            3.2-3      Perl module for determining images

pod2pdf suggests no packages.

-- no debconf information
>From 2eabe4eab57e12a832713a3833d93769e2db2e67 Mon Sep 17 00:00:00 2001
From: Jari Aalto <[email protected]>
Date: Thu, 8 Oct 2009 21:30:42 +0300
Subject: [PATCH] (dateISO8601): New. Use ISO 8601 standard for date and time

Signed-off-by: Jari Aalto <[email protected]>
---
 bin/pod2pdf |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/bin/pod2pdf b/bin/pod2pdf
index 51e3c56..336a344 100755
--- a/bin/pod2pdf
+++ b/bin/pod2pdf
@@ -46,6 +46,21 @@ argvFile();  # Process @ARGV to load specified config files. 
(Function
              # in @ARGV with the contents of the specified file)
              
              
+
+#--------------------------------------------------------------------------
+
+sub dateISO8601 ($) {
+    my ($timeval) = shift || time;
+
+    warn "time: $timeval";
+
+    my ($yyyy, $MM, $dd, $hh, $mm) = (localtime $timeval)[5, 4, 3, 2, 1];
+    $yyyy += 1900;
+    $MM++;
+
+    sprintf "$yyyy-%02d-%02d %02d:%02d", $MM, $dd, $hh, $mm;
+}
+
 #--Parse command-line options----------------------------------------------
 
 my %options = (
@@ -74,9 +89,11 @@ GetOptions(\%config,
   version => sub{ print "This is pod2pdf, version $App::pod2pdf::VERSION\n"; 
exit }
 ) or die("[Error] Could not parse options");
 
-$config{title}  = (@ARGV) ? $ARGV[0] : 'STDIN' unless (exists $config{title});
-$config{title} .= (' - ' . ((@ARGV) ? scalar localtime($^T - (-M 
$ARGV[0])*24*60*60) : scalar localtime)) if (exists $config{timestamp});
+my $file = $ARGV[0];
+my $time = $file ? $^T - (-M $file) * 24 * 60 * 60 : time;
 
+$config{title}  = $file ? $file : 'STDIN' unless exists $config{title};
+$config{title} .= ' - ' .  dateISO8601 $time if exists $config{timestamp};
 
 #--Set output location-----------------------------------------------------
 
-- 
1.6.3.3

Reply via email to