r26532 - in /trunk/libtime-local-perl: Changes MANIFEST.SKIP META.yml debian/changelog lib/Time/Local.pm t/Local.t

ghostbar-guest at users.alioth.debian.org ghostbar-guest at users.alioth.debian.org
Sun Nov 2 08:11:49 UTC 2008


Author: ghostbar-guest
Date: Sun Nov  2 08:11:46 2008
New Revision: 26532

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=26532
Log:
new upstream release

Modified:
    trunk/libtime-local-perl/Changes
    trunk/libtime-local-perl/MANIFEST.SKIP
    trunk/libtime-local-perl/META.yml
    trunk/libtime-local-perl/debian/changelog
    trunk/libtime-local-perl/lib/Time/Local.pm
    trunk/libtime-local-perl/t/Local.t

Modified: trunk/libtime-local-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtime-local-perl/Changes?rev=26532&op=diff
==============================================================================
--- trunk/libtime-local-perl/Changes (original)
+++ trunk/libtime-local-perl/Changes Sun Nov  2 08:11:46 2008
@@ -1,3 +1,17 @@
+1.1901  2008-11-01
+
+- Test fixes only. The tests planned the wrong number of tests on
+  32-bit platforms, causing failures.
+
+
+1.19    2008-11-01
+
+- The calculation of the maximum integer size was using
+  $Config{intsize} when it should use $Config{ivsize}. Apparently on a
+  64-bit platform intsize can be 4 when ivsize is 8. Based on a patch
+  from Jan Dubois.
+
+
 1.18    2007-10-31
 
 - Added pod and pod coverage tests.

Modified: trunk/libtime-local-perl/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtime-local-perl/MANIFEST.SKIP?rev=26532&op=diff
==============================================================================
--- trunk/libtime-local-perl/MANIFEST.SKIP (original)
+++ trunk/libtime-local-perl/MANIFEST.SKIP Sun Nov  2 08:11:46 2008
@@ -16,4 +16,5 @@
 \.zip$
 _uu$
 .*\.svn.*
-^Time-Local-.*
+^Time-Local-.*
+\.shipit

Modified: trunk/libtime-local-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtime-local-perl/META.yml?rev=26532&op=diff
==============================================================================
--- trunk/libtime-local-perl/META.yml (original)
+++ trunk/libtime-local-perl/META.yml Sun Nov  2 08:11:46 2008
@@ -1,13 +1,19 @@
 --- #YAML:1.0
-name:                Time-Local
-version:             1.18
-abstract:            ~
-license:             perl
-generated_by:        ExtUtils::MakeMaker version 6.36
-distribution_type:   module
-requires:     
-meta-spec:
-    url:     http://module-build.sourceforge.net/META-spec-v1.2.html
-    version: 1.2
+name:               Time-Local
+version:            1.1901
+abstract:           ~
 author:
     - Dave Rolsky <autarch at urth.org>
+license:            perl
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+requires:  {}
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.48
+meta-spec:
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Modified: trunk/libtime-local-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtime-local-perl/debian/changelog?rev=26532&op=diff
==============================================================================
--- trunk/libtime-local-perl/debian/changelog (original)
+++ trunk/libtime-local-perl/debian/changelog Sun Nov  2 08:11:46 2008
@@ -1,8 +1,12 @@
-libtime-local-perl (1.18-2) UNRELEASED; urgency=low
+libtime-local-perl (1.1901-1) UNRELEASED; urgency=low
 
+  [ gregor herrmann ]
   * debian/rules: delete /usr/lib/perl5 only if it exists.
 
- -- gregor herrmann <gregor+debian at comodo.priv.at>  Wed, 09 Jan 2008 21:19:09 +0100
+  [ Jose Luis Rivas ]
+  * (NOT RELEASED YET) New upstream release
+
+ -- Jose Luis Rivas <ghostbar38 at gmail.com>  Sun, 02 Nov 2008 03:40:19 -0430
 
 libtime-local-perl (1.18-1) unstable; urgency=low
 

Modified: trunk/libtime-local-perl/lib/Time/Local.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtime-local-perl/lib/Time/Local.pm?rev=26532&op=diff
==============================================================================
--- trunk/libtime-local-perl/lib/Time/Local.pm (original)
+++ trunk/libtime-local-perl/lib/Time/Local.pm Sun Nov  2 08:11:46 2008
@@ -7,7 +7,7 @@
 use integer;
 
 use vars qw( $VERSION @ISA @EXPORT @EXPORT_OK );
-$VERSION   = '1.18';
+$VERSION   = '1.1901';
 
 @ISA       = qw( Exporter );
 @EXPORT    = qw( timegm timelocal );
@@ -29,16 +29,16 @@
 use constant SECS_PER_HOUR   => 3600;
 use constant SECS_PER_DAY    => 86400;
 
-my $MaxInt = ( ( 1 << ( 8 * $Config{intsize} - 2 ) ) -1 ) * 2 + 1;
-my $MaxDay = int( ( $MaxInt - ( SECS_PER_DAY / 2 ) ) / SECS_PER_DAY ) - 1;
-
+my $MaxInt;
 if ( $^O eq 'MacOS' ) {
     # time_t is unsigned...
-    $MaxInt = ( 1 << ( 8 * $Config{intsize} ) ) - 1;
+    $MaxInt = ( 1 << ( 8 * $Config{ivsize} ) ) - 1;
 }
 else {
-    $MaxInt = ( ( 1 << ( 8 * $Config{intsize} - 2 ) ) - 1 ) * 2 + 1;
-}
+    $MaxInt = ( ( 1 << ( 8 * $Config{ivsize} - 2 ) ) - 1 ) * 2 + 1;
+}
+
+my $MaxDay = int( ( $MaxInt - ( SECS_PER_DAY / 2 ) ) / SECS_PER_DAY ) - 1;
 
 # Determine the EPOC day for this machine
 my $Epoc = 0;
@@ -68,7 +68,7 @@
     return $_[3] + (
         $Cheat{ pack( 'ss', @_[ 4, 5 ] ) } ||= do {
             my $month = ( $_[4] + 10 ) % 12;
-            my $year  = $_[5] + 1900 - $month / 10;
+            my $year  = ( $_[5] + 1900 ) - ( $month / 10 );
 
             ( ( 365 * $year )
               + ( $year / 4 )
@@ -99,12 +99,6 @@
     }
 
     unless ( $Options{no_range_check} ) {
-        if ( abs($year) >= 0x7fff ) {
-            $year += 1900;
-            croak
-                "Cannot handle date ($sec, $min, $hour, $mday, $month, *$year*)";
-        }
-
         croak "Month '$month' out of range 0..11"
             if $month > 11
             or $month < 0;

Modified: trunk/libtime-local-perl/t/Local.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtime-local-perl/t/Local.t?rev=26532&op=diff
==============================================================================
--- trunk/libtime-local-perl/t/Local.t (original)
+++ trunk/libtime-local-perl/t/Local.t Sun Nov  2 08:11:46 2008
@@ -9,6 +9,7 @@
 
 use strict;
 
+use Config;
 use Test::More;
 use Time::Local;
 
@@ -73,13 +74,13 @@
     $neg_epoch_ok = 0; # time_t is unsigned
 }
 
+my $epoch_is_64 = eval { $Config{ivsize} == 8 && ( gmtime 2**40 )[5] == 34912 };
+
 my $tests = (@time * 12);
 $tests += @neg_time * 12;
 $tests += @bad_time;
 $tests += @years;
-$tests += 10;
-$tests += 2 if $ENV{PERL_CORE};
-$tests += 8 if $ENV{MAINTAINER};
+$tests += 23;
 
 plan tests => $tests;
 
@@ -192,7 +193,24 @@
     is($@, '', 'no error with leap day of 1996 (year passed as 96)');
 }
 
-if ($ENV{MAINTAINER}) {
+SKIP:
+{
+    skip 'These tests require a system with 64-bit time_t.', 3
+        unless $epoch_is_64;
+
+    is( timegm( 8, 14, 3, 19, 0, ( 1900 + 138 ) ), 2**31,
+        'can call timegm for 2**31 epoch seconds' );
+    is( timegm( 16, 28, 6, 7, 1, ( 1900 + 206 ) ), 2**32,
+        'can call timegm for 2**32 epoch seconds (on a 64-bit system)' );
+    is( timegm( 16, 36, 0, 20, 1, ( 34912 + 1900 ) ), 2**40,
+        'can call timegm for 2**40 epoch seconds (on a 64-bit system)' );
+}
+
+SKIP:
+{
+    skip 'These tests only run for the package maintainer.', 8
+        unless $ENV{MAINTAINER};
+
     require POSIX;
 
     local $ENV{TZ} = 'Europe/Vienna';
@@ -246,14 +264,20 @@
         'hour is 2 when given 2:00 AM on Europe/London date change' );
 }
 
-if ($ENV{PERL_CORE}) {
-  package test;
-  require 'timelocal.pl';
-
-  # need to get ok() from main package
-  ::is(timegm(0,0,0,1,0,80), main::timegm(0,0,0,1,0,80),
-     'timegm in timelocal.pl');
-
-  ::is(timelocal(1,2,3,4,5,88), main::timelocal(1,2,3,4,5,88),
-     'timelocal in timelocal.pl');
-}
+SKIP:
+{
+    skip 'These tests are only run when $ENV{PERL_CORE} is true.', 2
+        unless $ENV{PERL_CORE};
+
+    {
+        package test;
+        require 'timelocal.pl';
+
+        # need to get ok() from main package
+        ::is(timegm(0,0,0,1,0,80), main::timegm(0,0,0,1,0,80),
+             'timegm in timelocal.pl');
+
+        ::is(timelocal(1,2,3,4,5,88), main::timelocal(1,2,3,4,5,88),
+             'timelocal in timelocal.pl');
+    }
+}




More information about the Pkg-perl-cvs-commits mailing list