r39914 - in /trunk/libdatetime-format-strptime-perl: Changes MANIFEST META.yml Makefile.PL debian/changelog debian/control lib/DateTime/Format/Strptime.pm t/004_locale_defaults.t t/009_regexp.t

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Tue Jul 14 22:28:34 UTC 2009


Author: gregoa
Date: Tue Jul 14 22:28:28 2009
New Revision: 39914

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=39914
Log:
* New upstream release:
  - changes to work with new DateTime::Locale
  - bump (build) and runtime dependencies accordingly
  (Closes: #536983)

Added:
    trunk/libdatetime-format-strptime-perl/t/009_regexp.t
      - copied unchanged from r39913, branches/upstream/libdatetime-format-strptime-perl/current/t/009_regexp.t
Modified:
    trunk/libdatetime-format-strptime-perl/Changes
    trunk/libdatetime-format-strptime-perl/MANIFEST
    trunk/libdatetime-format-strptime-perl/META.yml
    trunk/libdatetime-format-strptime-perl/Makefile.PL
    trunk/libdatetime-format-strptime-perl/debian/changelog
    trunk/libdatetime-format-strptime-perl/debian/control
    trunk/libdatetime-format-strptime-perl/lib/DateTime/Format/Strptime.pm
    trunk/libdatetime-format-strptime-perl/t/004_locale_defaults.t

Modified: trunk/libdatetime-format-strptime-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-strptime-perl/Changes?rev=39914&op=diff
==============================================================================
--- trunk/libdatetime-format-strptime-perl/Changes (original)
+++ trunk/libdatetime-format-strptime-perl/Changes Tue Jul 14 22:28:28 2009
@@ -219,3 +219,9 @@
 	- Makefile.PL changes for Windows users as per issue #16
 
 1.0901 2009-05-16 -- Official release of above
+
+1.1000 2009-07-13 -- Regex Pattern
+	- If the pattern you pass in is a regular expression, that will be honored.
+	- Changed the locale tests to use require the latest version of Locale until the target stops moving.
+	
+		

Modified: trunk/libdatetime-format-strptime-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-strptime-perl/MANIFEST?rev=39914&op=diff
==============================================================================
--- trunk/libdatetime-format-strptime-perl/MANIFEST (original)
+++ trunk/libdatetime-format-strptime-perl/MANIFEST Tue Jul 14 22:28:28 2009
@@ -13,4 +13,5 @@
 t/006_locales.t
 t/007_edge.t
 t/008_epoch.t
+t/009_regexp.t
 t/more/001_all_locales.t

Modified: trunk/libdatetime-format-strptime-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-strptime-perl/META.yml?rev=39914&op=diff
==============================================================================
--- trunk/libdatetime-format-strptime-perl/META.yml (original)
+++ trunk/libdatetime-format-strptime-perl/META.yml Tue Jul 14 22:28:28 2009
@@ -3,7 +3,7 @@
         version: 1.3
         url: http://module-build.sourceforge.net/META-spec-v1.3.html
 name:           DateTime-Format-Strptime
-version:        1.0901
+version:        1.1000
 abstract:       Parse and format strp and strf time patterns
 author:
         - Rick Measham <rickm at cpan.org>
@@ -12,7 +12,7 @@
 requires:
         Params::Validate:              0.64
         DateTime:                      0.4304
-        DateTime::Locale:              0.41
+        DateTime::Locale:              0.43
         DateTime::TimeZone:            0.79
 resources:
         licence:        http://dev.perl.org/licenses/

Modified: trunk/libdatetime-format-strptime-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-strptime-perl/Makefile.PL?rev=39914&op=diff
==============================================================================
--- trunk/libdatetime-format-strptime-perl/Makefile.PL (original)
+++ trunk/libdatetime-format-strptime-perl/Makefile.PL Tue Jul 14 22:28:28 2009
@@ -28,7 +28,7 @@
     ABSTRACT     => 'Parse and format strp and strf time patterns',
     PREREQ_PM    => {
        'DateTime'           => '0.4304',
-       'DateTime::Locale'   => '0.41',
+       'DateTime::Locale'   => '0.43',
        'DateTime::TimeZone' => '0.79',
        'Params::Validate'   => '0.64',
     },
@@ -38,7 +38,7 @@
 return $^O eq 'MSWin32'?
 <<'MAKE_FRAG'
 test_more :: pure_all
-set PERL_DL_NON_LAZY=1 & $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" t/more/*.t
+	set PERL_DL_NON_LAZY=1 & $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" t/more/*.t
 MAKE_FRAG
 :
 <<'MAKE_FRAG';

Modified: trunk/libdatetime-format-strptime-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-strptime-perl/debian/changelog?rev=39914&op=diff
==============================================================================
--- trunk/libdatetime-format-strptime-perl/debian/changelog (original)
+++ trunk/libdatetime-format-strptime-perl/debian/changelog Tue Jul 14 22:28:28 2009
@@ -1,11 +1,16 @@
-libdatetime-format-strptime-perl (1.0901-1) UNRELEASED; urgency=low
+libdatetime-format-strptime-perl (1.1000-1) UNRELEASED; urgency=low
 
-  no need to upload
-
+  [ Ryan Niebur ]
   * New upstream release
   * Debian Policy 3.8.1
 
- -- Ryan Niebur <ryanryan52 at gmail.com>  Sat, 16 May 2009 18:46:54 -0700
+  [ gregor herrmann ]
+  * New upstream release:
+    - changes to work with new DateTime::Locale
+    - bump (build) and runtime dependencies accordingly
+    (Closes: #536983)
+
+ -- gregor herrmann <gregoa at debian.org>  Wed, 15 Jul 2009 00:24:52 +0200
 
 libdatetime-format-strptime-perl (1.0900-1) unstable; urgency=low
 

Modified: trunk/libdatetime-format-strptime-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-strptime-perl/debian/control?rev=39914&op=diff
==============================================================================
--- trunk/libdatetime-format-strptime-perl/debian/control (original)
+++ trunk/libdatetime-format-strptime-perl/debian/control Tue Jul 14 22:28:28 2009
@@ -3,7 +3,7 @@
 Priority: optional
 Build-Depends: debhelper (>= 7)
 Build-Depends-Indep: perl (>= 5.6.0), libdatetime-perl (>= 2:0.4304),
- libdatetime-locale-perl (>= 0.41), libdatetime-timezone-perl, libparams-validate-perl
+ libdatetime-locale-perl (>= 1:0.43), libdatetime-timezone-perl, libparams-validate-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Ernesto Hernández-Novich (USB) <emhn at usb.ve>,
  gregor herrmann <gregoa at debian.org>, Niko Tyni <ntyni at iki.fi>,
@@ -16,7 +16,7 @@
 Package: libdatetime-format-strptime-perl
 Architecture: all
 Depends: ${misc:Depends}, ${perl:Depends}, libdatetime-perl (>= 2:0.4304),
- libdatetime-locale-perl (>= 0.41), libdatetime-timezone-perl,
+ libdatetime-locale-perl (>= 1:0.43), libdatetime-timezone-perl,
  libparams-validate-perl
 Description:  Parse and format strp and strf time patterns
  DateTime::Format::Strptime implements most of strptime(3), the POSIX

Modified: trunk/libdatetime-format-strptime-perl/lib/DateTime/Format/Strptime.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-strptime-perl/lib/DateTime/Format/Strptime.pm?rev=39914&op=diff
==============================================================================
--- trunk/libdatetime-format-strptime-perl/lib/DateTime/Format/Strptime.pm (original)
+++ trunk/libdatetime-format-strptime-perl/lib/DateTime/Format/Strptime.pm Tue Jul 14 22:28:28 2009
@@ -5,14 +5,14 @@
 use DateTime;
 use DateTime::Locale;
 use DateTime::TimeZone;
-use Params::Validate qw( validate SCALAR BOOLEAN OBJECT CODEREF );
+use Params::Validate qw( validate SCALAR SCALARREF BOOLEAN OBJECT CODEREF );
 use Carp;
 
 use Exporter;
 use vars qw( $VERSION @ISA @EXPORT @EXPORT_OK %ZONEMAP %FORMATS $CROAK $errmsg);
 
 @ISA = 'Exporter';
-$VERSION = '1.0901';
+$VERSION = '1.1000';
 @EXPORT_OK = qw( &strftime &strptime );
 @EXPORT = ();
 
@@ -124,7 +124,7 @@
 
 sub new {
     my $class = shift;
-	my %args = validate( @_, {	pattern		=> { type => SCALAR },
+	my %args = validate( @_, {	pattern		=> { type => SCALAR | SCALARREF },
 								time_zone	=> { type => SCALAR | OBJECT, optional => 1 },
                                 locale      => { type => SCALAR | OBJECT, default => 'English' },
 								on_error	=> { type => SCALAR | CODEREF, default => 'undef' },
@@ -598,6 +598,9 @@
 sub _build_parser {
 	my $self = shift;
 	my $regex = my $field_list = shift;
+	if( ref $regex eq 'Regexp' ){
+		$field_list =~ s/^\(\?-xism:(.+)\)$/$1/;
+	}
 	my @fields = $field_list =~ m/(%\{\w+\}|%\d*.)/g;
 	$field_list = join('', at fields);
 
@@ -630,17 +633,17 @@
 
 	$regex =~ s/%x/$self->{_locale}->default_date_format/eg;
 	$field_list =~ s/%x/$default_date_format/eg;
-	# %x id the locale's default date format.
+	# %x is the locale's default date format.
 
 	$regex =~ s/%X/$self->{_locale}->default_time_format/eg;
 	$field_list =~ s/%X/$default_time_format/eg;
-	# %x id the locale's default time format.
-
-	# I'm absolutely certain there's a better way to do this:
-	#$regex=~s|([\/\.\-])|\\$1|g;
-	$regex = quotemeta( $regex );
-	$regex =~ s/(?<!\\)\\%/%/g;
-	$regex =~ s/%\\\{([^\}]+)\\\}/%{$1}/g;
+	# %x is the locale's default time format.
+
+	if( ref $regex ne 'Regexp' ){
+		$regex = quotemeta( $regex );
+		$regex =~ s/(?<!\\)\\%/%/g;
+		$regex =~ s/%\\\{([^\}]+)\\\}/%{$1}/g;
+	}
 
 	$regex =~ s/%T/%H:%M:%S/g;
 	$field_list =~ s/%T/%H%M%S/g;

Modified: trunk/libdatetime-format-strptime-perl/t/004_locale_defaults.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libdatetime-format-strptime-perl/t/004_locale_defaults.t?rev=39914&op=diff
==============================================================================
--- trunk/libdatetime-format-strptime-perl/t/004_locale_defaults.t (original)
+++ trunk/libdatetime-format-strptime-perl/t/004_locale_defaults.t Tue Jul 14 22:28:28 2009
@@ -20,18 +20,18 @@
 	['en_AU',	'%X',	'12:34:56 PM'],
 	['en_AU',	'%c',	'31/12/1998 12:34:56 PM'],
 	# US English
-	['en_US',	'%x',	'Dec 31, 1998'],
+	['en_US',	'%x',	'Dec 31, 98'],
 	['en_US',	'%X',	'12:34:56 PM'],
-	['en_US',	'%c',	'Dec 31, 1998 12:34:56 PM'],
+	['en_US',	'%c',	'Dec 31, 98 12:34:56 PM'],
 	# UK English
-	['en_GB',	'%x',	'31 Dec 1998'],
+	['en_GB',	'%x',	'31 Dec 98'],
 	['en_GB',	'%X',	'12:34:56 PM'],
-	['en_GB',	'%c',	'31 Dec 1998 12:34:56'],
+	['en_GB',	'%c',	'31 Dec 98 12:34:56'],
 	# French
 #);my @tests = (
-	['fr',	'%x',	'31 déc 1998'],
+	['fr',	'%x',	'31 déc 98'],
 	['fr',	'%X',	'12:34:56'],
-	['fr',	'%c',	'31 déc 1998 12:34:56'],
+	['fr',	'%c',	'31 déc 98 12:34:56'],
 );
 
 foreach (@tests) {




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