Hello community,

here is the log from the commit of package perl-DateTime-Format-Pg for 
openSUSE:Factory checked in at 2015-06-23 11:59:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-DateTime-Format-Pg (Old)
 and      /work/SRC/openSUSE:Factory/.perl-DateTime-Format-Pg.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-DateTime-Format-Pg"

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-DateTime-Format-Pg/perl-DateTime-Format-Pg.changes
  2014-12-08 16:56:11.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.perl-DateTime-Format-Pg.new/perl-DateTime-Format-Pg.changes
     2015-06-23 11:59:41.000000000 +0200
@@ -1,0 +2,9 @@
+Sun Jun 21 08:20:10 UTC 2015 - [email protected]
+
+- updated to 0.16011
+   see /usr/share/doc/packages/perl-DateTime-Format-Pg/Changes
+
+  0.16011 2015-06-19T13:40:27Z
+      - Support full interval syntax [pr #7]
+
+-------------------------------------------------------------------

Old:
----
  DateTime-Format-Pg-0.16010.tar.gz

New:
----
  DateTime-Format-Pg-0.16011.tar.gz
  cpanspec.yml

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-DateTime-Format-Pg.spec ++++++
--- /var/tmp/diff_new_pack.JhDASV/_old  2015-06-23 11:59:41.000000000 +0200
+++ /var/tmp/diff_new_pack.JhDASV/_new  2015-06-23 11:59:41.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-DateTime-Format-Pg
 #
-# Copyright (c) 2014 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
@@ -17,25 +17,24 @@
 
 
 Name:           perl-DateTime-Format-Pg
-Version:        0.16010
+Version:        0.16011
 Release:        0
 %define cpan_name DateTime-Format-Pg
 Summary:        Parse and format PostgreSQL dates and times
 License:        Artistic-1.0 or GPL-1.0+
 Group:          Development/Libraries/Perl
 Url:            http://search.cpan.org/dist/DateTime-Format-Pg/
-Source:         
http://www.cpan.org/authors/id/D/DM/DMAKI/%{cpan_name}-%{version}.tar.gz
+Source0:        
http://www.cpan.org/authors/id/D/DM/DMAKI/%{cpan_name}-%{version}.tar.gz
+Source1:        cpanspec.yml
 BuildArch:      noarch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  perl
 BuildRequires:  perl-macros
-BuildRequires:  perl(CPAN::Meta)
-BuildRequires:  perl(CPAN::Meta::Prereqs)
 BuildRequires:  perl(DateTime) >= 0.10
 BuildRequires:  perl(DateTime::Format::Builder) >= 0.72
 BuildRequires:  perl(DateTime::TimeZone) >= 0.05
 BuildRequires:  perl(ExtUtils::MakeMaker) >= 6.36
-BuildRequires:  perl(Module::Build) >= 0.38
+BuildRequires:  perl(Module::Build) >= 0.380000
 Requires:       perl(DateTime) >= 0.10
 Requires:       perl(DateTime::Format::Builder) >= 0.72
 Requires:       perl(DateTime::TimeZone) >= 0.05
@@ -64,6 +63,6 @@
 
 %files -f %{name}.files
 %defattr(-,root,root,755)
-%doc Changes cpanfile LICENSE Makefile README.md
+%doc Changes LICENSE Makefile README.md
 
 %changelog

++++++ DateTime-Format-Pg-0.16010.tar.gz -> DateTime-Format-Pg-0.16011.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DateTime-Format-Pg-0.16010/Build.PL 
new/DateTime-Format-Pg-0.16011/Build.PL
--- old/DateTime-Format-Pg-0.16010/Build.PL     2014-09-18 14:36:07.000000000 
+0200
+++ new/DateTime-Format-Pg-0.16011/Build.PL     2015-06-19 15:40:31.000000000 
+0200
@@ -12,8 +12,6 @@
 use Module::Build;
 use File::Basename;
 use File::Spec;
-use CPAN::Meta;
-use CPAN::Meta::Prereqs;
 
 my %args = (
     license              => 'perl',
@@ -34,7 +32,7 @@
     test_files           => ((-d '.git' || $ENV{RELEASE_TESTING}) && -d 'xt') 
? 't/ xt/' : 't/',
     recursive_test_files => 1,
 
-    
+
 );
 if (-d 'share') {
     $args{share_dir} = 'share';
@@ -53,20 +51,15 @@
 )->new(%args);
 $builder->create_build_script();
 
-my $mbmeta = CPAN::Meta->load_file('MYMETA.json');
-my $meta = CPAN::Meta->load_file('META.json');
-my $prereqs_hash = CPAN::Meta::Prereqs->new(
-    $meta->prereqs
-)->with_merged_prereqs(
-    CPAN::Meta::Prereqs->new($mbmeta->prereqs)
-)->as_string_hash;
-my $mymeta = CPAN::Meta->new(
-    {
-        %{$meta->as_struct},
-        prereqs => $prereqs_hash
-    }
-);
-print "Merging cpanfile prereqs to MYMETA.yml\n";
-$mymeta->save('MYMETA.yml', { version => 1.4 });
-print "Merging cpanfile prereqs to MYMETA.json\n";
-$mymeta->save('MYMETA.json', { version => 2 });
+use File::Copy;
+
+print "cp META.json MYMETA.json\n";
+copy("META.json","MYMETA.json") or die "Copy failed(META.json): $!";
+
+if (-f 'META.yml') {
+    print "cp META.yml MYMETA.yml\n";
+    copy("META.yml","MYMETA.yml") or die "Copy failed(META.yml): $!";
+} else {
+    print "There is no META.yml... You may install this module from the 
repository...\n";
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DateTime-Format-Pg-0.16010/Changes 
new/DateTime-Format-Pg-0.16011/Changes
--- old/DateTime-Format-Pg-0.16010/Changes      2014-09-18 14:36:07.000000000 
+0200
+++ new/DateTime-Format-Pg-0.16011/Changes      2015-06-19 15:40:31.000000000 
+0200
@@ -1,5 +1,8 @@
 Revision history for Perl extension DateTime::Format::Pg.
 
+0.16011 2015-06-19T13:40:27Z
+    - Support full interval syntax [pr #7]
+
 0.16010 2014-09-18T12:36:03Z
     - Add support for various more interval units [pr #3]:
       millenium, century, decade, month, week
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DateTime-Format-Pg-0.16010/META.json 
new/DateTime-Format-Pg-0.16011/META.json
--- old/DateTime-Format-Pg-0.16010/META.json    2014-09-18 14:36:07.000000000 
+0200
+++ new/DateTime-Format-Pg-0.16011/META.json    2015-06-19 15:40:31.000000000 
+0200
@@ -4,7 +4,7 @@
       "Daisuke Maki <[email protected]>"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "Minilla/v0.12.0",
+   "generated_by" : "Minilla/v2.2.0",
    "license" : [
       "perl_5"
    ],
@@ -34,15 +34,14 @@
       },
       "configure" : {
          "requires" : {
-            "CPAN::Meta" : "0",
-            "CPAN::Meta::Prereqs" : "0",
             "Module::Build" : "0.38"
          }
       },
       "develop" : {
          "requires" : {
             "Test::CPAN::Meta" : "0",
-            "Test::MinimumVersion" : "0.10108",
+            "Test::MinimumVersion::Fast" : "0.04",
+            "Test::PAUSE::Permissions" : "0.04",
             "Test::Pod" : "1.41",
             "Test::Spellunker" : "v0.2.7"
          }
@@ -58,7 +57,7 @@
    "provides" : {
       "DateTime::Format::Pg" : {
          "file" : "lib/DateTime/Format/Pg.pm",
-         "version" : "0.16010"
+         "version" : "0.16011"
       }
    },
    "release_status" : "stable",
@@ -72,11 +71,12 @@
          "web" : "https://github.com/lestrrat/DateTime-Format-Pg";
       }
    },
-   "version" : "0.16010",
+   "version" : "0.16011",
    "x_contributors" : [
       "Vasily Chekalkin <[email protected]>",
       "David Steinbrunner <[email protected]>",
       "Henrik Pauli <[email protected]>",
+      "Nitish Bezzala <[email protected]>",
       "lestrrat <[email protected]>"
    ]
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DateTime-Format-Pg-0.16010/META.yml 
new/DateTime-Format-Pg-0.16011/META.yml
--- old/DateTime-Format-Pg-0.16010/META.yml     2014-09-18 14:36:07.000000000 
+0200
+++ new/DateTime-Format-Pg-0.16011/META.yml     2015-06-19 15:40:31.000000000 
+0200
@@ -6,11 +6,9 @@
   ExtUtils::MakeMaker: '6.36'
   Test::More: '0'
 configure_requires:
-  CPAN::Meta: '0'
-  CPAN::Meta::Prereqs: '0'
   Module::Build: '0.38'
 dynamic_config: 0
-generated_by: 'Minilla/v0.12.0, CPAN::Meta::Converter version 2.120921'
+generated_by: 'Minilla/v2.2.0, CPAN::Meta::Converter version 2.142690'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -29,7 +27,7 @@
 provides:
   DateTime::Format::Pg:
     file: lib/DateTime/Format/Pg.pm
-    version: '0.16010'
+    version: '0.16011'
 requires:
   DateTime: '0.10'
   DateTime::Format::Builder: '0.72'
@@ -38,9 +36,10 @@
   bugtracker: https://github.com/lestrrat/DateTime-Format-Pg/issues
   homepage: https://github.com/lestrrat/DateTime-Format-Pg
   repository: git://github.com/lestrrat/DateTime-Format-Pg.git
-version: '0.16010'
+version: '0.16011'
 x_contributors:
   - 'Vasily Chekalkin <[email protected]>'
   - 'David Steinbrunner <[email protected]>'
   - 'Henrik Pauli <[email protected]>'
+  - 'Nitish Bezzala <[email protected]>'
   - 'lestrrat <[email protected]>'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DateTime-Format-Pg-0.16010/lib/DateTime/Format/Pg.pm 
new/DateTime-Format-Pg-0.16011/lib/DateTime/Format/Pg.pm
--- old/DateTime-Format-Pg-0.16010/lib/DateTime/Format/Pg.pm    2014-09-18 
14:36:07.000000000 +0200
+++ new/DateTime-Format-Pg-0.16011/lib/DateTime/Format/Pg.pm    2015-06-19 
15:40:31.000000000 +0200
@@ -10,8 +10,9 @@
 use DateTime::TimeZone 0.06;
 use DateTime::TimeZone::UTC;
 use DateTime::TimeZone::Floating;
+use Data::Dumper;
 
-$VERSION = '0.16010';
+$VERSION = '0.16011';
 $VERSION = eval $VERSION;
 
 our @ISA = ('DateTime::Format::Builder');
@@ -560,59 +561,73 @@
 =cut
 
 sub parse_duration {
-    my ($self, $string) = @_;
-    my ($mil, $cent, $dec, $year, $mon, $wk, $day, $sgn, $hour, $min, $sec, 
$frc, $ago) = $string =~ m{
-        \A                                     # Start of string.
-        (?:\@\s*)?                             # Optional leading @.
-        (?:([-+]?\d+)\s+(?:millennium|millennia|millenniums|mil|mils)\s*)?  # 
millennia
-        (?:([-+]?\d+)\s+(?:century|centuries|cent|c)\s*)?                   # 
centuries
-        (?:([-+]?\d+)\s+(?:decade|decades|dec|decs)\s*)?                    # 
decades
-        (?:([-+]?\d+)\s+(?:year|years|yr|yrs|y)\s*)?                        # 
years
-        (?:([-+]?\d+)\s+(?:month|months|mon|mons)\s*)?                      # 
months
-        (?:([-+]?\d+)\s+(?:week|weeks|w)\s*)?                               # 
weeks
-        (?:([-+]?\d+)\s+(?:day|days|d)\s*)?                                 # 
days
-        (?:                                    # Start h/m/s
-          # hours
-          
(?:([-+])?([0-9]\d|[1-9]\d{2,}(?=:)|\d+(?=\s+hour))(?:\s+hours?)?\s*)?
-          # minutes
-          
(?::?((?<=:)[012345]\d|\d+(?=\s+min(?:ute)?s?))(?:\s+min(?:ute)?s?)?\s*)?
-          # seconds
-          
(?::?((?<=:)[012345]\d|\d+(?=\.|\s+sec(?:ond)?s?))(\.\d+)?(?:\s+sec(?:ond)?s?)?\s*)?
-        ?)                                     # End hh:mm:ss
-        (ago)?                                 # Optional inversion
-        \z                                     # End of string
-    }xms or croak "Invalid interval string $string";
+    my ($self, $string_to_parse) = @_;
 
     # NB: We can't just pass our values to new() because it treats all
     # arguments as negative if we have a single negative component.
     # PostgreSQL might return mixed signs, e.g. '1 mon -1day'.
     my $du = DateTime::Duration->new;
 
-    # Define for calculations
-    $_ ||= 0 for $sec, $frc, $min, $day, $mon;
+    my %units = ( map(($_, ["seconds", 1]), qw(s second seconds sec secs)),
+                     map(($_, ["minutes", 1]), qw(m minute minutes min mins)),
+                     map(($_, ["hours",   1]), qw(h hr hour hours)),
+                     map(($_, ["days",    1]), qw(d day days)),
+                     map(($_, ["weeks",   1]), qw(w week weeks)),
+                     map(($_, ["months",  1]), qw(M mon mons month months)),
+                     map(($_, ["years",   1]), qw(y yr yrs year years)),
+                     map(($_, ["years",  10]), qw(decade decades dec decs)),
+                     map(($_, ["years", 100]), qw(c cent century centuries)),
+                     map(($_, ["years", 1000]), qw(millennium millennia 
millenniums mil mils)) );
+
+    (my $string = $string_to_parse) =~ s/^@\s*//;
+    $string =~ s/\+(\d+)/$1/g;
+
+    my $subtract = 0;
+    if ( $string =~ s/ago// ) {
+        $subtract = 1;
+    }
+
+    my $sign = 0;
+    my %done;
+
+#   $timespec =~ s/\b(\d+):(\d\d):((\d\d)|(\d\d.\d+))\b/$1h $2m $3s/g;
+    $string =~ s/\b(\d+):(\d\d):(\d\d)\b/$1h $2m $3s/g;
+    $string =~ s/\b(\d+):(\d\d)\b/$1h $2m/g;
+
+    if ( $string =~ m/-(\d+)h (\d+)m (\d+)s\s*/ ) {
+        $string =~ s/\s*(\d+)m\s+(\d+)s\s*/ -$1m -$2s /;
+    }
 
-    # DT::Duration only stores years, days, months, seconds (and
-    # nanoseconds)
-    $year += 1000 * $mil if $mil;
-    $year += 100 * $cent if $cent;
-    $year += 10 * $dec   if $dec;
-    $mon += 12 * $year if $year;
-    $day +=  7 *   $wk if $wk;
-    $min += 60 * $hour if $hour;
-
-    # HH:MM:SS.FFFF share a single sign
-    if ($sgn && $sgn eq '-') {
-        $_ *= -1 for $min, $sec, $frc;
+    if ( $string =~ m/-(\d+)h (\d+)m\s*/ ) {
+        $string =~ s/\s*(\d+)m\s*/ -$1m /;
     }
 
-    $du->add(
-        months      => $mon,
-        days        => $day,
-        minutes     => $min,
-        seconds     => $sec,
-        nanoseconds => $frc * DateTime::Duration::MAX_NANOSECONDS,
-    );
-    return $ago ? $du->inverse : $du;
+
+    while ($string =~ 
s/^\s*(-?\d+(?:[.,]\d+)?)\s*([a-zA-Z]+)(?:\s*(?:,|and)\s*)*//i) {
+        my($amount, $unit) = ($1, $2);
+        $unit = lc($unit) unless length($unit) == 1;
+
+        my ($base_unit, $num);
+        if ( defined( $units{$unit} ) ) { 
+            ($base_unit, $num) = @{$units{$unit}};
+            my $key = $base_unit . "-" . $num;
+            Carp::croak "Unknown timespec: $string_to_parse" if 
defined($done{$key});
+            $done{$key} = 1;
+
+            $amount =~ s/,/./;
+            if ( $subtract ) {
+                 $du->subtract( $base_unit => $amount * $num );
+            } else {
+                $du->add( $base_unit => $amount * $num );
+            }
+        } else {
+            Carp::croak "Unknown timespec: $string_to_parse";
+        }
+    }
+
+
+
+    return $du;
 }
 
 *parse_interval = \&parse_duration;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DateTime-Format-Pg-0.16010/t/parse_interval.t 
new/DateTime-Format-Pg-0.16011/t/parse_interval.t
--- old/DateTime-Format-Pg-0.16010/t/parse_interval.t   2014-09-18 
14:36:07.000000000 +0200
+++ new/DateTime-Format-Pg-0.16011/t/parse_interval.t   2015-06-19 
15:40:31.000000000 +0200
@@ -11,12 +11,15 @@
 BEGIN
 {
     @negative_data = (
-        '098:08:00',
-        '1:08:00',
-        '-012:00:00',
+        '12:34:00 1 week 42 seconds',
     );
 
     @positive_data = (
+        [ '098:08:00' => DateTime::Duration->new( hours => 98, minutes => 8, ) 
],
+        [ '1:08' => DateTime::Duration->new( hours => 1, minutes => 8, ) ],
+        [ '3 days 1:08' => DateTime::Duration->new( days => 3, hours => 1, 
minutes => 8, ) ],
+        [ '1:08:00' => DateTime::Duration->new( hours => 1, minutes => 8, ) ],
+        [ '-012:00:00' => DateTime::Duration->new( hours => -12, ) ],
         [ '00:00:00' => DateTime::Duration->new() ],
         [ '-08:08:00' => DateTime::Duration->new( hours => -8, minutes => -8) 
],
         [ '-98:08:00' => DateTime::Duration->new( hours => -98, minutes => -8) 
],
@@ -28,6 +31,7 @@
         [ '-23:59'    => DateTime::Duration->new(hours => -23, minutes => -59) 
],
         [ '-1 days -00:01' => DateTime::Duration->new( days => -1, minutes => 
-1) ],
         [ '1 mon -1 days' => DateTime::Duration->new(months => 1)->add(days => 
-1) ],
+        [ '1 day 1 month' => DateTime::Duration->new(months => 1)->add(days => 
1) ],
         [ '1 month -1 days' => DateTime::Duration->new(months => 1)->add(days 
=> -1) ],
         [ '@ 1 mon -1 days' => DateTime::Duration->new(months => 1)->add(days 
=> -1) ],
         [ '@ 1 month -1 days' => DateTime::Duration->new(months => 
1)->add(days => -1) ],
@@ -145,6 +149,7 @@
         
         [ '1 mil 2 c 4 decade 8 yr 9 months 18 d ' => DateTime::Duration->new( 
years => 1248, months => 9, days => 18 )],
         [ '12 yr 42 w' => DateTime::Duration->new( years => 12, weeks => 42 )],
+        [ '12:34:56 1 week' => DateTime::Duration->new( weeks => 1, hours => 
12, minutes => 34, seconds => 56)],
     );
 
     plan tests => @negative_data + @positive_data + 1;

++++++ 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
#custom_test: |-
#startserver && make test
#ignore_requires: Bizarre::Module

Reply via email to