Hello community,
here is the log from the commit of package perl-DateTime-Format-MySQL for
openSUSE:Factory checked in at 2015-04-22 01:18:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-DateTime-Format-MySQL (Old)
and /work/SRC/openSUSE:Factory/.perl-DateTime-Format-MySQL.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-DateTime-Format-MySQL"
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-DateTime-Format-MySQL/perl-DateTime-Format-MySQL.changes
2011-11-21 12:38:46.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.perl-DateTime-Format-MySQL.new/perl-DateTime-Format-MySQL.changes
2015-04-22 01:18:01.000000000 +0200
@@ -1,0 +2,9 @@
+Sun Dec 21 22:14:59 UTC 2014 - [email protected]
+
+- update to 0.05
+ + Added parsing of MySQL fractional seconds (microseconds).
+ * Allowed additional valid MySQL formats (delimiters in DATE and TIME
+ fields using punctuation, 'T' separator between DATE and TIME and
+ single-digit time or date values).
+
+-------------------------------------------------------------------
Old:
----
DateTime-Format-MySQL-0.04.tar.gz
New:
----
DateTime-Format-MySQL-0.05.tar.gz
cpanspec.yml
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-DateTime-Format-MySQL.spec ++++++
--- /var/tmp/diff_new_pack.v7gOLx/_old 2015-04-22 01:18:02.000000000 +0200
+++ /var/tmp/diff_new_pack.v7gOLx/_new 2015-04-22 01:18:02.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-DateTime-Format-MySQL
#
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,24 +16,23 @@
#
-
Name: perl-DateTime-Format-MySQL
-Version: 0.04
-Release: 1
-License: GPL-1.0+ or Artistic-1.0
+Version: 0.05
+Release: 0
%define cpan_name DateTime-Format-MySQL
Summary: Parse and format MySQL dates and times
-Url: http://search.cpan.org/dist/DateTime-Format-MySQL/
+License: Artistic-1.0 or GPL-1.0+
Group: Development/Libraries/Perl
-Source:
http://www.cpan.org/authors/id/D/DR/DROLSKY/DateTime-Format-MySQL-0.04.tar.gz
-# Source: %{cpan_name}-%{version}.tar.bz2
+Url: http://search.cpan.org/dist/DateTime-Format-MySQL/
+Source0:
http://www.cpan.org/authors/id/X/XM/XMIKEW/%{cpan_name}-%{version}.tar.gz
+Source1: cpanspec.yml
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
-BuildRequires: perl(Module::Build)
BuildRequires: perl(DateTime)
BuildRequires: perl(DateTime::Format::Builder) >= 0.6
+BuildRequires: perl(Module::Build) >= 0.420000
Requires: perl(DateTime)
Requires: perl(DateTime::Format::Builder) >= 0.6
%{perl_requires}
@@ -58,11 +57,8 @@
./Build install destdir=%{buildroot} create_packlist=0
%perl_gen_filelist
-%clean
-%{__rm} -rf %{buildroot}
-
%files -f %{name}.files
-%defattr(644,root,root,755)
+%defattr(-,root,root,755)
%doc Changes LICENSE README
%changelog
++++++ DateTime-Format-MySQL-0.04.tar.gz -> DateTime-Format-MySQL-0.05.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/DateTime-Format-MySQL-0.04/Build.PL
new/DateTime-Format-MySQL-0.05/Build.PL
--- old/DateTime-Format-MySQL-0.04/Build.PL 2005-04-18 05:05:47.000000000
+0200
+++ new/DateTime-Format-MySQL-0.05/Build.PL 2014-10-27 18:46:55.000000000
+0100
@@ -8,6 +8,7 @@
requires => { 'DateTime' => 0,
'DateTime::Format::Builder' => 0.60,
},
- sign => 1,
+ build_requires => { 'Module::Build' => 0 },
+ sign => 0,
create_makefile_pl => 'passthrough',
)->create_build_script;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/DateTime-Format-MySQL-0.04/Changes
new/DateTime-Format-MySQL-0.05/Changes
--- old/DateTime-Format-MySQL-0.04/Changes 2005-04-18 05:05:47.000000000
+0200
+++ new/DateTime-Format-MySQL-0.05/Changes 2014-10-27 18:46:55.000000000
+0100
@@ -1,3 +1,12 @@
+
+0.05 2014-10-26
+
+- Added parsing of MySQL fractional seconds (microseconds).
+- Allowed additional valid MySQL formats (delimiters in DATE and TIME
+ fields using punctuation, 'T' separator between DATE and TIME and
+ single-digit time or date values).
+
+
0.04 2005-05-17
- Added parsing for TIMESTAMP as returned by MySQL 4.1. Patch by Mike
@@ -24,4 +33,4 @@
0.01 2003-03-19
-- First release
\ No newline at end of file
+- First release
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/DateTime-Format-MySQL-0.04/MANIFEST
new/DateTime-Format-MySQL-0.05/MANIFEST
--- old/DateTime-Format-MySQL-0.04/MANIFEST 2005-04-18 05:05:47.000000000
+0200
+++ new/DateTime-Format-MySQL-0.05/MANIFEST 2014-10-27 18:46:55.000000000
+0100
@@ -9,4 +9,4 @@
t/00load.t
t/01format.t
t/02parse.t
-SIGNATURE Added here by Module::Build
+META.json
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/DateTime-Format-MySQL-0.04/META.json
new/DateTime-Format-MySQL-0.05/META.json
--- old/DateTime-Format-MySQL-0.04/META.json 1970-01-01 01:00:00.000000000
+0100
+++ new/DateTime-Format-MySQL-0.05/META.json 2014-10-27 18:46:55.000000000
+0100
@@ -0,0 +1,47 @@
+{
+ "abstract" : "Parse and format MySQL dates and times",
+ "author" : [
+ "Dave Rolsky <[email protected]>"
+ ],
+ "dynamic_config" : 1,
+ "generated_by" : "Module::Build version 0.421",
+ "license" : [
+ "perl_5"
+ ],
+ "meta-spec" : {
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : "2"
+ },
+ "name" : "DateTime-Format-MySQL",
+ "prereqs" : {
+ "build" : {
+ "requires" : {
+ "Module::Build" : "0"
+ }
+ },
+ "configure" : {
+ "requires" : {
+ "Module::Build" : "0.42"
+ }
+ },
+ "runtime" : {
+ "requires" : {
+ "DateTime" : "0",
+ "DateTime::Format::Builder" : "0.6"
+ }
+ }
+ },
+ "provides" : {
+ "DateTime::Format::MySQL" : {
+ "file" : "lib/DateTime/Format/MySQL.pm",
+ "version" : "0.05"
+ }
+ },
+ "release_status" : "stable",
+ "resources" : {
+ "license" : [
+ "http://dev.perl.org/licenses/"
+ ]
+ },
+ "version" : "0.05"
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/DateTime-Format-MySQL-0.04/META.yml
new/DateTime-Format-MySQL-0.05/META.yml
--- old/DateTime-Format-MySQL-0.04/META.yml 2005-04-18 05:05:47.000000000
+0200
+++ new/DateTime-Format-MySQL-0.05/META.yml 2014-10-27 18:46:55.000000000
+0100
@@ -1,15 +1,25 @@
---
-name: DateTime-Format-MySQL
-version: 0.04
+abstract: 'Parse and format MySQL dates and times'
author:
- - Dave Rolsky <[email protected]>
-abstract: Parse and format MySQL dates and times
+ - 'Dave Rolsky <[email protected]>'
+build_requires:
+ Module::Build: '0'
+configure_requires:
+ Module::Build: '0.42'
+dynamic_config: 1
+generated_by: 'Module::Build version 0.421, CPAN::Meta::Converter version
2.142060'
license: perl
-requires:
- DateTime: 0
- DateTime::Format::Builder: 0.6
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: '1.4'
+name: DateTime-Format-MySQL
provides:
DateTime::Format::MySQL:
file: lib/DateTime/Format/MySQL.pm
- version: 0.04
-generated_by: Module::Build version 0.2609
+ version: '0.05'
+requires:
+ DateTime: '0'
+ DateTime::Format::Builder: '0.6'
+resources:
+ license: http://dev.perl.org/licenses/
+version: '0.05'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/DateTime-Format-MySQL-0.04/Makefile.PL
new/DateTime-Format-MySQL-0.05/Makefile.PL
--- old/DateTime-Format-MySQL-0.04/Makefile.PL 2005-04-18 05:05:47.000000000
+0200
+++ new/DateTime-Format-MySQL-0.05/Makefile.PL 2014-10-27 18:46:55.000000000
+0100
@@ -1,31 +1,34 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.03
-
+# Note: this file was auto-generated by Module::Build::Compat version 0.4210
+
unless (eval "use Module::Build::Compat 0.02; 1" ) {
print "This module requires Module::Build to install itself.\n";
-
+
require ExtUtils::MakeMaker;
my $yn = ExtUtils::MakeMaker::prompt
(' Install Module::Build now from CPAN?', 'y');
-
+
unless ($yn =~ /^y/i) {
die " *** Cannot install without Module::Build. Exiting ...\n";
}
-
+
require Cwd;
require File::Spec;
require CPAN;
-
+
# Save this 'cause CPAN will chdir all over the place.
my $cwd = Cwd::cwd();
- my $makefile = File::Spec->rel2abs($0);
-
- CPAN::Shell->install('Module::Build::Compat')
- or die " *** Cannot install without Module::Build. Exiting ...\n";
-
+
+ CPAN::Shell->install('Module::Build::Compat');
+ CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
+ or die "Couldn't install Module::Build, giving up.\n";
+
chdir $cwd or die "Cannot chdir() back to $cwd: $!";
}
eval "use Module::Build::Compat 0.02; 1" or die $@;
- use lib '_build/lib';
+
Module::Build::Compat->run_build_pl(args => \@ARGV);
+ my $build_script = 'Build';
+ $build_script .= '.com' if $^O eq 'VMS';
+ exit(0) unless(-e $build_script); # cpantesters convention
require Module::Build;
Module::Build::Compat->write_makefile(build_class => 'Module::Build');
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/DateTime-Format-MySQL-0.04/SIGNATURE
new/DateTime-Format-MySQL-0.05/SIGNATURE
--- old/DateTime-Format-MySQL-0.04/SIGNATURE 2005-04-18 05:05:48.000000000
+0200
+++ new/DateTime-Format-MySQL-0.05/SIGNATURE 1970-01-01 01:00:00.000000000
+0100
@@ -1,34 +0,0 @@
-This file contains message digests of all files listed in MANIFEST,
-signed via the Module::Signature module, version 0.44.
-
-To verify the content in this distribution, first make sure you have
-Module::Signature installed, then type:
-
- % cpansign -v
-
-It will check each file's integrity, as well as the signature's
-validity. If "==> Signature verified OK! <==" is not displayed,
-the distribution may already have been compromised, and you should
-not run its Makefile.PL or Build.PL.
-
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-SHA1 f9ea00c30efa8b02db35bffc1def295842b16c27 Build.PL
-SHA1 bfd8d4a9d2abf35f0c2f698d43ed7e79ac25c251 Changes
-SHA1 f235ba4160673bcb7c9d58c2f09dbc7fc0efadea LICENSE
-SHA1 97482a200af3118c25b6bbde182e789235ba5e2e MANIFEST
-SHA1 dedee97d47c51600c49854b7f02886e1458f1836 META.yml
-SHA1 a359d4072690a21ce63e4b393bdbc19d72b6be5a Makefile.PL
-SHA1 fd36ac44e2187809656e523ecb1369e0727cb454 README
-SHA1 6574bcf084efc086915a31bfaa79b8af69f1719d lib/DateTime/Format/MySQL.pm
-SHA1 bde76102b35bcf952833a2591d47e5934488bf67 t/00load.t
-SHA1 1e02b55044432bd012489db798216871f93b5db7 t/01format.t
-SHA1 e4599370c6f4321fba2ed9faa1d03e9d69139fab t/02parse.t
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.0 (GNU/Linux)
-
-iD8DBQFCYyQM3Or3ZzQuifMRAl8AAJwI7ewaW1cqCZs1MowkFcn0eKd/cwCgwS83
-wTIIFKfcdNU3JYlUP5SjxKY=
-=yGT3
------END PGP SIGNATURE-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/DateTime-Format-MySQL-0.04/lib/DateTime/Format/MySQL.pm
new/DateTime-Format-MySQL-0.05/lib/DateTime/Format/MySQL.pm
--- old/DateTime-Format-MySQL-0.04/lib/DateTime/Format/MySQL.pm 2005-04-18
05:05:47.000000000 +0200
+++ new/DateTime-Format-MySQL-0.05/lib/DateTime/Format/MySQL.pm 2014-10-27
18:46:55.000000000 +0100
@@ -4,31 +4,47 @@
use vars qw ($VERSION);
-$VERSION = '0.04';
+$VERSION = '0.05';
use DateTime;
use DateTime::Format::Builder
( parsers =>
{ parse_date =>
{ params => [ qw( year month day ) ],
- regex => qr/^(\d{1,4})-(\d\d)-(\d\d)$/,
+ regex => qr/^(\d{1,4})[[:punct:]](\d{1,2})[[:punct:]](\d{1,2})$/,
},
parse_datetime =>
- { params => [ qw( year month day hour minute second ) ],
- regex => qr/^(\d{1,4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)$/,
- extra => { time_zone => 'floating' },
- },
+ [ { params => [ qw( year month day hour minute second ) ],
+ regex =>
qr/^(\d{1,4})[[:punct:]](\d{1,2})[[:punct:]](\d{1,2})[\sT](\d{1,2})[[:punct:]](\d{1,2})[[:punct:]](\d{1,2})$/,
+ extra => { time_zone => 'floating' },
+ },
+ { params => [ qw( year month day hour minute second microsecond ) ],
+ regex =>
qr/^(\d{1,4})[[:punct:]](\d{1,2})[[:punct:]](\d{1,2})[\sT](\d{1,2})[[:punct::](\d{1,2})[[:punct:]](\d{1,2})\.(\d{1,6})/,
+ extra => { time_zone => 'floating' },
+ postprocess => \&_convert_micro_to_nanosecs,
+ },
+ ],
parse_timestamp =>
- [ { length => 14,
+ [ { params => [ qw( year month day hour minute second microsecond ) ],
+ regex =>
qr/^(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)\.(\d{1,6})$/,
+ extra => { time_zone => 'floating' },
+ postprocess => \&_convert_micro_to_nanosecs,
+ },
+ { params => [ qw( year month day hour minute second microsecond ) ],
+ regex =>
qr/^(\d{1,4})[[:punct:]](\d{1,2})[[:punct:]](\d{1,2})[\sT](\d{1,2})[[:punct:]](\d{1,2})[[:punct:]](\d{1,2})\.(\d{1,6})/,
+ extra => { time_zone => 'floating' },
+ postprocess => \&_convert_micro_to_nanosecs,
+ },
+ { length => 14,
params => [ qw( year month day hour minute second ) ],
regex => qr/^(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/,
extra => { time_zone => 'floating' },
},
{
params => [ qw( year month day hour minute second ) ],
- regex => qr/^(\d{1,4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)$/,
+ regex =>
qr/^(\d{1,4})[[:punct:]](\d{1,2})[[:punct:]](\d{1,2})[\sT](\d{1,2})[[:punct:]](\d{1,2})[[:punct:]](\d{1,2})$/,
extra => { time_zone => 'floating'},
},
{ length => 12,
@@ -98,6 +114,19 @@
return $self->format_date($dt) . ' ' . $self->format_time($dt);
}
+# DateTime constructor only has nanosecond. MySQL provides micro
+sub _convert_micro_to_nanosecs
+{
+ my %p = @_;
+ my $micro_secs = delete $p{parsed}{microsecond};
+
+ # right pad with zeros
+ $micro_secs .= '0' x (6 - length($micro_secs));
+ $p{parsed}{nanosecond} = $micro_secs * 1000;
+ return 1; # parse successful
+}
+
+
1;
@@ -167,7 +196,7 @@
=head1 COPYRIGHT
-Copyright (c) 2003 David Rolsky. All rights reserved. This program
+Copyright (c) 2003-2014 David Rolsky. All rights reserved. This program
is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/DateTime-Format-MySQL-0.04/t/02parse.t
new/DateTime-Format-MySQL-0.05/t/02parse.t
--- old/DateTime-Format-MySQL-0.04/t/02parse.t 2005-04-18 05:05:47.000000000
+0200
+++ new/DateTime-Format-MySQL-0.05/t/02parse.t 2014-10-27 18:46:55.000000000
+0100
@@ -1,13 +1,13 @@
use strict;
-use Test::More tests => 42;
+use Test::More tests => 84;
use DateTime::Format::MySQL;
my $mysql = 'DateTime::Format::MySQL';
{
- my $dt = $mysql->parse_date( '2003-02-15' );
+ my $dt = $mysql->parse_date( '2003_02_15' );
is( $dt->year, 2003 );
is( $dt->month, 2 );
is( $dt->day, 15 );
@@ -24,16 +24,78 @@
}
{
- my $dt = $mysql->parse_timestamp( '2003-02-15 10:09:08' );
+ my $dt = $mysql->parse_datetime( '2003-02-15 10:09:08.2' );
is( $dt->year, 2003 );
is( $dt->month, 2 );
is( $dt->day, 15 );
is( $dt->hour, 10 );
is( $dt->minute, 9 );
is( $dt->second, 8 );
+ is( $dt->microsecond, 200_000 );
+ is( $dt->nanosecond, 200_000_000 );
}
{
+ my $dt = $mysql->parse_datetime( '2014:10:26 01:02:03.002' );
+ is( $dt->year, 2014 );
+ is( $dt->month, 10 );
+ is( $dt->day_of_month, 26 );
+ is( $dt->hour, 1 );
+ is( $dt->minute, 02 );
+ is( $dt->second, 03 );
+ is( $dt->microsecond, 2_000 );
+ is( $dt->nanosecond, 2_000_000 );
+}
+
+{
+ my $dt = $mysql->parse_timestamp( '2003-02-15 10:09:08.0' );
+ is( $dt->year, 2003 );
+ is( $dt->month, 2 );
+ is( $dt->day, 15 );
+ is( $dt->hour, 10 );
+ is( $dt->minute, 9 );
+ is( $dt->second, 8 );
+ is( $dt->microsecond, 0 );
+ is( $dt->nanosecond, 0 );
+}
+
+{
+ my $dt = $mysql->parse_timestamp( '2014:10:26 01:02:03' );
+ is( $dt->year, 2014 );
+ is( $dt->month, 10 );
+ is( $dt->day_of_month, 26 );
+ is( $dt->hour, 1 );
+ is( $dt->minute, 02 );
+ is( $dt->second, 03 );
+ is( $dt->microsecond, 0 );
+ is( $dt->nanosecond, 0 );
+}
+
+{
+ my $dt = $mysql->parse_datetime( '2014-10-26T01:02:03.2' );
+ is( $dt->year, 2014 );
+ is( $dt->month, 10 );
+ is( $dt->day_of_month, 26 );
+ is( $dt->hour, 1 );
+ is( $dt->minute, 02 );
+ is( $dt->second, 03 );
+ is( $dt->microsecond, 200_000 );
+ is( $dt->nanosecond, 200_000_000 );
+}
+
+{
+ my $dt = $mysql->parse_timestamp( '2014^1^6 1^2^3.123456' );
+ is( $dt->year, 2014 );
+ is( $dt->month, 1 );
+ is( $dt->day_of_month, 6 );
+ is( $dt->hour, 1 );
+ is( $dt->minute, 2 );
+ is( $dt->second, 3 );
+ is( $dt->microsecond, 123_456 );
+ is( $dt->nanosecond, 123_456_000 );
+}
+
+{
my $dt = $mysql->parse_timestamp('70');
is( $dt->year, 1970 );
}
++++++ cpanspec.yml ++++++
---
#description_paragraphs: 3
#no_testing: broken upstream
#sources:
# - source1
# - source2
#patches:
# foo.patch: -p1
# bar.patch:
#preamble: |-
# BuildRequires: gcc-c++
#post_prep: |-
# hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s, *,,g'`
# sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL
#post_install: |-
# sed on %{name}.files
#license: SUSE-NonFree
#skip_noarch: 1
#custom_build: -
#./Build build flags=%{?_smp_mflags} --myflag
#ignore_requires: Bizarre::Module