summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Veller <tove@gentoo.org>2010-01-15 09:05:04 +0000
committerTorsten Veller <tove@gentoo.org>2010-01-15 09:05:04 +0000
commit9e7da10b566e11a7d791999c9eb7b654cd343234 (patch)
tree1fe5cf58aebf6b3b4e9158d4c286f28cbc176e01 /dev-perl
parentAdd ppc64 love #291287. (diff)
downloadgentoo-2-9e7da10b566e11a7d791999c9eb7b654cd343234.tar.gz
gentoo-2-9e7da10b566e11a7d791999c9eb7b654cd343234.tar.bz2
gentoo-2-9e7da10b566e11a7d791999c9eb7b654cd343234.zip
Fix _fix_1_digit_year to work in 2010 (#298966). Cleanup
(Portage version: 2.2_rc61/cvs/Linux x86_64)
Diffstat (limited to 'dev-perl')
-rw-r--r--dev-perl/DateTime-Format-ISO8601/ChangeLog11
-rw-r--r--dev-perl/DateTime-Format-ISO8601/DateTime-Format-ISO8601-0.06-r1.ebuild (renamed from dev-perl/DateTime-Format-ISO8601/DateTime-Format-ISO8601-0.06.ebuild)5
-rw-r--r--dev-perl/DateTime-Format-ISO8601/files/fix_1_digit_year.patch120
3 files changed, 132 insertions, 4 deletions
diff --git a/dev-perl/DateTime-Format-ISO8601/ChangeLog b/dev-perl/DateTime-Format-ISO8601/ChangeLog
index 099c971faec9..a8bbaf123905 100644
--- a/dev-perl/DateTime-Format-ISO8601/ChangeLog
+++ b/dev-perl/DateTime-Format-ISO8601/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for dev-perl/DateTime-Format-ISO8601
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-perl/DateTime-Format-ISO8601/ChangeLog,v 1.2 2009/11/23 18:49:13 tove Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-perl/DateTime-Format-ISO8601/ChangeLog,v 1.3 2010/01/15 09:05:03 tove Exp $
+
+*DateTime-Format-ISO8601-0.06-r1 (15 Jan 2010)
+
+ 15 Jan 2010; Torsten Veller <tove@gentoo.org>
+ +files/fix_1_digit_year.patch, -DateTime-Format-ISO8601-0.06.ebuild,
+ +DateTime-Format-ISO8601-0.06-r1.ebuild:
+ Fix _fix_1_digit_year to work in 2010 (#298966). Cleanup
23 Nov 2009; Torsten Veller <tove@gentoo.org>
DateTime-Format-ISO8601-0.06.ebuild:
diff --git a/dev-perl/DateTime-Format-ISO8601/DateTime-Format-ISO8601-0.06.ebuild b/dev-perl/DateTime-Format-ISO8601/DateTime-Format-ISO8601-0.06-r1.ebuild
index 17a88a958cf2..29431b52363f 100644
--- a/dev-perl/DateTime-Format-ISO8601/DateTime-Format-ISO8601-0.06.ebuild
+++ b/dev-perl/DateTime-Format-ISO8601/DateTime-Format-ISO8601-0.06-r1.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-perl/DateTime-Format-ISO8601/DateTime-Format-ISO8601-0.06.ebuild,v 1.3 2009/11/23 18:49:13 tove Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-perl/DateTime-Format-ISO8601/DateTime-Format-ISO8601-0.06-r1.ebuild,v 1.1 2010/01/15 09:05:03 tove Exp $
EAPI=2
@@ -22,3 +22,4 @@ DEPEND="${RDEPEND}
dev-perl/Test-Distribution )"
SRC_TEST=do
+PATCHES=( "${FILESDIR}"/fix_1_digit_year.patch )
diff --git a/dev-perl/DateTime-Format-ISO8601/files/fix_1_digit_year.patch b/dev-perl/DateTime-Format-ISO8601/files/fix_1_digit_year.patch
new file mode 100644
index 000000000000..4e1476832a46
--- /dev/null
+++ b/dev-perl/DateTime-Format-ISO8601/files/fix_1_digit_year.patch
@@ -0,0 +1,120 @@
+Origin: other, http://github.com/oalders/DateTime-Format-ISO8601/commit/ed1ed506e3f914bd78ec452e50ec15fefe19ac75
+--- a/lib/DateTime/Format/ISO8601.pm
++++ b/lib/DateTime/Format/ISO8601.pm
+@@ -112,7 +112,7 @@
+ },
+ }
+ );
+-
++
+ # ISO8601 only allows years 0 to 9999
+ # this implimentation ignores the needs of expanded formats
+ my $dt = DateTime->from_object( object => $args{ object } );
+@@ -182,7 +182,7 @@
+ params => [ qw( year month day ) ],
+ },
+ {
+- # uncombined with above because
++ # uncombined with above because
+ #regex => qr/^ (\d{4}) -?? (\d\d) -?? (\d\d) $/x,
+ # was matching 152746-05
+
+@@ -805,20 +805,18 @@
+
+ sub _fix_1_digit_year {
+ my %p = @_;
+-
+- no strict 'refs';
+- my $year = ( $p{ self }{ base_datetime } || DateTime->now )->year;
+- use strict;
+
+- $year =~ s/.$//;
+- $p{ parsed }{ year } = $year . $p{ parsed }{ year };
++ no strict 'refs';
++ my $year = ( $p{ self }{ base_datetime } || DateTime->now )->strftime('%C') * 100;
+
++ use strict;
++ $p{ parsed }{ year } = $year + $p{ parsed }{ year };
+ return 1;
+ }
+
+ sub _fix_2_digit_year {
+ my %p = @_;
+-
++
+ # this is a mess because of the need to support parse_* being called
+ # as a class method
+ no strict 'refs';
+@@ -904,7 +902,7 @@
+ sub _fractional_second {
+ my %p = @_;
+
+- $p{ parsed }{ nanosecond } = ".$p{ parsed }{ nanosecond }" * 10**9;
++ $p{ parsed }{ nanosecond } = ".$p{ parsed }{ nanosecond }" * 10**9;
+
+ return 1;
+ }
+@@ -912,7 +910,7 @@
+ sub _fractional_minute {
+ my %p = @_;
+
+- $p{ parsed }{ second } = ".$p{ parsed }{ second }" * 60;
++ $p{ parsed }{ second } = ".$p{ parsed }{ second }" * 60;
+
+ return 1;
+ }
+@@ -920,7 +918,7 @@
+ sub _fractional_hour {
+ my %p = @_;
+
+- $p{ parsed }{ minute } = ".$p{ parsed }{ minute }" * 60;
++ $p{ parsed }{ minute } = ".$p{ parsed }{ minute }" * 60;
+
+ return 1;
+ }
+@@ -953,7 +951,7 @@
+ my $dt = DateTime->new(
+ year => $p{ parsed }{ year },
+ );
+-
++
+ if ( $dt->week_number == 1 ) {
+ $p{ parsed }{ week } -= 1;
+ }
+--- a/t/02_examples.t
++++ b/t/02_examples.t
+@@ -228,7 +228,7 @@
+ {
+ #-YWwwD -5W155
+ my $dt = DateTime::Format::ISO8601->parse_datetime( '-5W155' );
+- is( $dt->year, '2005' );
++ is( $dt->year, '2005', '-5W155' );
+ is( $dt->week_number, '15' );
+ is( $dt->day_of_week, '5' );
+ }
+@@ -236,7 +236,7 @@
+ {
+ #-Y-Www-D -5-W15-5
+ my $dt = DateTime::Format::ISO8601->parse_datetime( '-5-W15-5' );
+- is( $dt->year, '2005' );
++ is( $dt->year, '2005', '-5-W15-5' );
+ is( $dt->week_number, '15' );
+ is( $dt->day_of_week, '5' );
+ }
+@@ -244,14 +244,14 @@
+ {
+ #-YWww -5W15
+ my $dt = DateTime::Format::ISO8601->parse_datetime( '-5W15' );
+- is( $dt->year, '2005' );
++ is( $dt->year, '2005', '-5W15' );
+ is( $dt->week_number, '15' );
+ }
+
+ {
+ #-Y-Www -5-W15
+ my $dt = DateTime::Format::ISO8601->parse_datetime( '-5-W15' );
+- is( $dt->year, '2005' );
++ is( $dt->year, '2005', '-5W15' );
+ is( $dt->week_number, '15' );
+ }
+