r68923 - in /trunk/libtime-local-perl: Changes META.yml debian/changelog lib/Time/Local.pm t/Local.t
periapt-guest at users.alioth.debian.org
periapt-guest at users.alioth.debian.org
Thu Feb 17 21:09:02 UTC 2011
Author: periapt-guest
Date: Thu Feb 17 21:08:41 2011
New Revision: 68923
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=68923
Log:
New upstream release (Closes: #603253)
Modified:
trunk/libtime-local-perl/Changes
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=68923&op=diff
==============================================================================
--- trunk/libtime-local-perl/Changes (original)
+++ trunk/libtime-local-perl/Changes Thu Feb 17 21:08:41 2011
@@ -1,3 +1,13 @@
+1.2000 2011-01-02
+
+- Release 1.1902 as a stable version without any further chances.
+
+1.1902 2010-12-16 TRIAL RELEASE
+
+- Merge all changes from blead perl.
+- Try to restore compatibility with older perls, which don't have a 64bit
+ capable localtime/gmtime.
+
1.1901 2008-11-01
- Test fixes only. The tests planned the wrong number of tests on
Modified: trunk/libtime-local-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtime-local-perl/META.yml?rev=68923&op=diff
==============================================================================
--- trunk/libtime-local-perl/META.yml (original)
+++ trunk/libtime-local-perl/META.yml Thu Feb 17 21:08:41 2011
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Time-Local
-version: 1.1901
+version: 1.2000
abstract: ~
author:
- Dave Rolsky <autarch at urth.org>
@@ -8,12 +8,14 @@
distribution_type: module
configure_requires:
ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
requires: {}
no_index:
directory:
- t
- inc
-generated_by: ExtUtils::MakeMaker version 6.48
+generated_by: ExtUtils::MakeMaker version 6.56
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=68923&op=diff
==============================================================================
--- trunk/libtime-local-perl/debian/changelog (original)
+++ trunk/libtime-local-perl/debian/changelog Thu Feb 17 21:08:41 2011
@@ -1,4 +1,4 @@
-libtime-local-perl (1.1901-2) UNRELEASED; urgency=low
+libtime-local-perl (1.2000-1) UNRELEASED; urgency=low
[ gregor herrmann ]
* debian/control: Changed: Switched Vcs-Browser field to ViewSVN
@@ -7,8 +7,9 @@
[ Nicholas Bamber ]
* Added myself to Uploaders
+ * New upstream release (Closes: #603253)
- -- gregor herrmann <gregoa at debian.org> Sun, 16 Nov 2008 20:48:32 +0100
+ -- Nicholas Bamber <nicholas at periapt.co.uk> Thu, 17 Feb 2011 21:09:47 +0000
libtime-local-perl (1.1901-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=68923&op=diff
==============================================================================
--- trunk/libtime-local-perl/lib/Time/Local.pm (original)
+++ trunk/libtime-local-perl/lib/Time/Local.pm Thu Feb 17 21:08:41 2011
@@ -4,10 +4,9 @@
use Carp;
use Config;
use strict;
-use integer;
use vars qw( $VERSION @ISA @EXPORT @EXPORT_OK );
-$VERSION = '1.1901';
+$VERSION = '1.2000';
@ISA = qw( Exporter );
@EXPORT = qw( timegm timelocal );
@@ -29,16 +28,23 @@
use constant SECS_PER_HOUR => 3600;
use constant SECS_PER_DAY => 86400;
-my $MaxInt;
-if ( $^O eq 'MacOS' ) {
- # time_t is unsigned...
- $MaxInt = ( 1 << ( 8 * $Config{ivsize} ) ) - 1;
+my $MaxDay;
+if ($] < 5.012000) {
+ my $MaxInt;
+ if ( $^O eq 'MacOS' ) {
+ # time_t is unsigned...
+ $MaxInt = ( 1 << ( 8 * $Config{ivsize} ) ) - 1;
+ }
+ else {
+ $MaxInt = ( ( 1 << ( 8 * $Config{ivsize} - 2 ) ) - 1 ) * 2 + 1;
+ }
+
+ $MaxDay = int( ( $MaxInt - ( SECS_PER_DAY / 2 ) ) / SECS_PER_DAY ) - 1;
}
else {
- $MaxInt = ( ( 1 << ( 8 * $Config{ivsize} - 2 ) ) - 1 ) * 2 + 1;
-}
-
-my $MaxDay = int( ( $MaxInt - ( SECS_PER_DAY / 2 ) ) / SECS_PER_DAY ) - 1;
+ # recent localtime()'s limit is the year 2**31
+ $MaxDay = 365 * (2**31);
+}
# Determine the EPOC day for this machine
my $Epoc = 0;
@@ -68,13 +74,13 @@
return $_[3] + (
$Cheat{ pack( 'ss', @_[ 4, 5 ] ) } ||= do {
my $month = ( $_[4] + 10 ) % 12;
- my $year = ( $_[5] + 1900 ) - ( $month / 10 );
+ my $year = $_[5] + 1900 - int($month / 10);
( ( 365 * $year )
- + ( $year / 4 )
- - ( $year / 100 )
- + ( $year / 400 )
- + ( ( ( $month * 306 ) + 5 ) / 10 )
+ + int( $year / 4 )
+ - int( $year / 100 )
+ + int( $year / 400 )
+ + int( ( ( $month * 306 ) + 5 ) / 10 )
)
- $Epoc;
}
@@ -277,13 +283,18 @@
=head2 Limits of time_t
-The range of dates that can be actually be handled depends on the size
-of C<time_t> (usually a signed integer) on the given
-platform. Currently, this is 32 bits for most systems, yielding an
-approximate range from Dec 1901 to Jan 2038.
+On perl versions older than 5.12.0, the range of dates that can be
+actually be handled depends on the size of C<time_t> (usually a signed
+integer) on the given platform. Currently, this is 32 bits for most
+systems, yielding an approximate range from Dec 1901 to Jan 2038.
Both C<timelocal()> and C<timegm()> croak if given dates outside the
supported range.
+
+As of version 5.12.0, perl has stopped using the underlying time
+library of the operating system it's running on and has its own
+implementation of those routines with a safe range of at least
++/ 2**52 (about 142 million years).
=head2 Ambiguous Local Times (DST)
@@ -309,10 +320,12 @@
=head2 Negative Epoch Values
-Negative epoch (C<time_t>) values are not officially supported by the
-POSIX standards, so this module's tests do not test them. On some
-systems, they are known not to work. These include MacOS (pre-OSX) and
-Win32.
+On perl version 5.12.0 and newer, negative epoch values are fully
+supported.
+
+On older versions of perl, negative epoch (C<time_t>) values, which
+are not officially supported by the POSIX standards, are known not to
+work on some systems. These include MacOS (pre-OSX) and Win32.
On systems which do support negative epoch values, this module should
be able to cope with dates before the start of the epoch, down the
Modified: trunk/libtime-local-perl/t/Local.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtime-local-perl/t/Local.t?rev=68923&op=diff
==============================================================================
--- trunk/libtime-local-perl/t/Local.t (original)
+++ trunk/libtime-local-perl/t/Local.t Thu Feb 17 21:08:41 2011
@@ -1,11 +1,4 @@
#!./perl
-
-BEGIN {
- if ($ENV{PERL_CORE}){
- chdir('t') if -d 't';
- @INC = ('.', '../lib');
- }
-}
use strict;
@@ -26,11 +19,16 @@
# leap day
[2020, 2, 29, 12, 59, 59],
[2030, 7, 4, 17, 07, 06],
+
# The following test fails on a surprising number of systems
# so it is commented out. The end of the Epoch for a 32-bit signed
# implementation of time_t should be Jan 19, 2038 03:14:07 UTC.
# [2038, 1, 17, 23, 59, 59], # last full day in any tz
);
+
+# more than 2**31 time_t - requires a 64bit safe localtime/gmtime
+push @time, [2258, 8, 11, 1, 49, 17]
+ if $] >= 5.012000;
my @bad_time =
(
@@ -80,7 +78,7 @@
$tests += @neg_time * 12;
$tests += @bad_time;
$tests += @years;
-$tests += 23;
+$tests += 21;
plan tests => $tests;
@@ -89,12 +87,13 @@
$year -= 1900;
$mon--;
- SKIP: {
+ SKIP: {
skip '1970 test on VOS fails.', 12
if $^O eq 'vos' && $year == 70;
skip 'this platform does not support negative epochs.', 12
if $year < 70 && ! $neg_epoch_ok;
+ # Test timelocal()
{
my $year_in = $year < 70 ? $year + 1900 : $year;
my $time = timelocal($sec,$min,$hour,$mday,$mon,$year_in);
@@ -109,6 +108,8 @@
is($Y, $year, "timelocal year for @$_");
}
+
+ # Test timegm()
{
my $year_in = $year < 70 ? $year + 1900 : $year;
my $time = timegm($sec,$min,$hour,$mday,$mon,$year_in);
@@ -125,6 +126,7 @@
}
}
+
for (@bad_time) {
my($year, $mon, $mday, $hour, $min, $sec) = @$_;
$year -= 1900;
@@ -263,21 +265,3 @@
is( ( localtime( timelocal( 0, 0, 2, 27, 2, 2005 ) ) )[2], 2,
'hour is 2 when given 2:00 AM on Europe/London date change' );
}
-
-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