r52009 - in /trunk/libtime-piece-perl: Changes META.yml Piece.pm Piece.xs Seconds.pm debian/changelog

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Tue Feb 2 03:09:51 UTC 2010


Author: jawnsy-guest
Date: Tue Feb  2 03:09:38 2010
New Revision: 52009

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

Modified:
    trunk/libtime-piece-perl/Changes
    trunk/libtime-piece-perl/META.yml
    trunk/libtime-piece-perl/Piece.pm
    trunk/libtime-piece-perl/Piece.xs
    trunk/libtime-piece-perl/Seconds.pm
    trunk/libtime-piece-perl/debian/changelog

Modified: trunk/libtime-piece-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtime-piece-perl/Changes?rev=52009&op=diff
==============================================================================
--- trunk/libtime-piece-perl/Changes (original)
+++ trunk/libtime-piece-perl/Changes Tue Feb  2 03:09:38 2010
@@ -1,5 +1,11 @@
 
 Time::Piece Changes
+
+1.17
+    - Force all to use internal strptime then everyone gets %z even OSX
+      users.
+    - Finally figured out the timezone test failures on Win32 and fixed
+      them.
 
 1.16
 	- Implement %z for the internal implementation of strptime(). 

Modified: trunk/libtime-piece-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtime-piece-perl/META.yml?rev=52009&op=diff
==============================================================================
--- trunk/libtime-piece-perl/META.yml (original)
+++ trunk/libtime-piece-perl/META.yml Tue Feb  2 03:09:38 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                Time-Piece
-version:             1.16
+version:             1.17
 abstract:            Object Oriented time objects
 license:             ~
 author:              

Modified: trunk/libtime-piece-perl/Piece.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtime-piece-perl/Piece.pm?rev=52009&op=diff
==============================================================================
--- trunk/libtime-piece-perl/Piece.pm (original)
+++ trunk/libtime-piece-perl/Piece.pm Tue Feb  2 03:09:38 2010
@@ -1,4 +1,4 @@
-# $Id: Piece.pm 90 2010-01-11 21:02:28Z matt $
+# $Id: Piece.pm 91 2010-02-01 21:38:28Z matt $
 
 package Time::Piece;
 
@@ -21,7 +21,7 @@
     ':override' => 'internal',
     );
 
-our $VERSION = '1.16';
+our $VERSION = '1.17';
 
 bootstrap Time::Piece $VERSION;
 
@@ -296,7 +296,9 @@
 
     # Compute floating offset in hours.
     #
-    my $delta = 24 * (&$j(CORE::localtime $epoch) - &$j(CORE::gmtime $epoch));
+    # Note use of crt methods so the tz is properly set...
+    # See: http://perlmonks.org/?node_id=820347
+    my $delta = 24 * ($j->(_crt_localtime($epoch)) - $j->(_crt_gmtime($epoch)));
 
     # Return value in seconds rounded to nearest minute.
     return Time::Seconds->new( int($delta * 60 + ($delta >= 0 ? 0.5 : -0.5)) * 60 );

Modified: trunk/libtime-piece-perl/Piece.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtime-piece-perl/Piece.xs?rev=52009&op=diff
==============================================================================
--- trunk/libtime-piece-perl/Piece.xs (original)
+++ trunk/libtime-piece-perl/Piece.xs Tue Feb  2 03:09:38 2010
@@ -303,16 +303,9 @@
     ptm->tm_wday = (jday + WEEKDAY_BIAS) % 7;
 }
 
-#ifndef HAS_STRPTIME
-    /* Assume everyone has strptime except Win32 and QNX4 */
-#   define HAS_STRPTIME 1
 #   if defined(WIN32) || (defined(__QNX__) && defined(__WATCOMC__))
-#       undef HAS_STRPTIME
+#       define strncasecmp(x,y,n) strnicmp(x,y,n)
 #   endif
-#endif
-
-#ifndef HAS_STRPTIME
-#define strncasecmp(x,y,n) strnicmp(x,y,n)
 
 #if defined(WIN32)
 #if defined(__BORLANDC__)
@@ -922,7 +915,7 @@
 
 
 char *
-strptime(pTHX_ const char *buf, const char *fmt, struct tm *tm)
+our_strptime(pTHX_ const char *buf, const char *fmt, struct tm *tm)
 {
 	char *ret;
 
@@ -939,8 +932,6 @@
 
 	return ret;
 }
-
-#endif /* !HAS_STRPTIME */
 
 MODULE = Time::Piece     PACKAGE = Time::Piece
 
@@ -1039,11 +1030,7 @@
   PPCODE:
        t = 0;
        mytm = *gmtime(&t);
-#ifdef HAS_STRPTIME
-       remainder = (char *)strptime(string, format, &mytm);
-#else
-       remainder = (char *)strptime(aTHX_ string, format, &mytm);
-#endif
+       remainder = (char *)our_strptime(aTHX_ string, format, &mytm);
        if (remainder == NULL) {
 	  croak("Error parsing time");
        }
@@ -1104,3 +1091,43 @@
        PUSHs(sv_2mortal(newSViv(0)));
        /* islocal */
        PUSHs(sv_2mortal(newSViv(0)));
+
+void
+_crt_localtime(time_t sec)
+    PREINIT:
+        struct tm mytm;
+    PPCODE:
+        mytm = *localtime(&sec);
+        /* Need to get: $s,$n,$h,$d,$m,$y */
+        
+        EXTEND(SP, 9);
+        PUSHs(sv_2mortal(newSViv(mytm.tm_sec)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_min)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_hour)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_mday)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_mon)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_year)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_year)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_wday)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_yday)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_isdst)));
+        
+void
+_crt_gmtime(time_t sec)
+    PREINIT:
+        struct tm mytm;
+    PPCODE:
+        mytm = *gmtime(&sec);
+        /* Need to get: $s,$n,$h,$d,$m,$y */
+        
+        EXTEND(SP, 9);
+        PUSHs(sv_2mortal(newSViv(mytm.tm_sec)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_min)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_hour)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_mday)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_mon)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_year)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_wday)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_yday)));
+        PUSHs(sv_2mortal(newSViv(mytm.tm_isdst)));
+        

Modified: trunk/libtime-piece-perl/Seconds.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtime-piece-perl/Seconds.pm?rev=52009&op=diff
==============================================================================
--- trunk/libtime-piece-perl/Seconds.pm (original)
+++ trunk/libtime-piece-perl/Seconds.pm Tue Feb  2 03:09:38 2010
@@ -1,4 +1,4 @@
-# $Id: Seconds.pm 69 2006-09-07 17:41:05Z matt $
+# $Id: Seconds.pm 44 2002-09-08 20:51:38Z matt $
 
 package Time::Seconds;
 use strict;

Modified: trunk/libtime-piece-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtime-piece-perl/debian/changelog?rev=52009&op=diff
==============================================================================
--- trunk/libtime-piece-perl/debian/changelog (original)
+++ trunk/libtime-piece-perl/debian/changelog Tue Feb  2 03:09:38 2010
@@ -1,3 +1,9 @@
+libtime-piece-perl (1.17-1) UNRELEASED; urgency=low
+
+  * New upstream release
+
+ -- Jonathan Yu <jawnsy at cpan.org>  Mon, 01 Feb 2010 22:00:04 -0500
+
 libtime-piece-perl (1.16-1) unstable; urgency=low
 
   [ Jonathan Yu ]




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