Skip Menu |

This queue is for tickets about the Rose-DateTime CPAN distribution.

Report information
The Basics
Id: 65070
Status: resolved
Priority: 0/
Queue: Rose-DateTime

People
Owner: Nobody in particular
Requestors: s.schoeling [...] linet-services.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.535



Subject: Rose::DateTime and DateTime::Locale 0.3x
Date: Mon, 24 Jan 2011 17:50:45 +0100
To: bug-Rose-DateTime [...] rt.cpan.org
From: Sven Schöling <s.schoeling [...] linet-services.de>
R:DT does not specify which DateTime::Locale version it needs. DT:L changed its API in v0.4. Methods now ending with '_short', '_long', 'medium', and '_full' used to be prefixed with those expressions. R:DT:U uses those in init_europea_dates, which dies on old DT:L versions. Attached is a patch against Rose/DB/Util.pm 0.534 that seems to work, although I didn't put much effort into correct version handling. Data: Rose-DateTime-Util-0.534, as installed by Ubuntu package librose-db-util-perl, but identical with the cpan version for this case. Test machine #1, Ubuntu 9.04 $ uname -a Linux ls-bs-ws15 2.6.31.1 #1 SMP Fri Oct 2 13:05:50 CEST 2009 x86_64 GNU/Linux $ perl -v This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi $ perl -le 'eval "use $_; print qq|$_ => \$${_}::VERSION|" for qw(Rose::DateTime::Util DateTime::Locale)' Rose::DateTime::Util => 0.534 DateTime::Locale => 0.45 Test machine #2, Ubuntu 8.04 LTS Server (the reason for all that) # uname -a Linux ubuntu804 2.6.24-24-server #1 SMP Tue Jul 7 20:21:17 UTC 2009 i686 GNU/Linux # perl -v This is perl, v5.8.8 built for i486-linux-gnu-thread-multi # perl -le 'eval "use $_; print qq|$_ => \$${_}::VERSION|" for qw(Rose::DateTime::Util DateTime::Locale)' Rose::DateTime::Util => 0.534 DateTime::Locale => 0.35 Test machine #3, Debian Etch # uname -a Linux debian-etch 2.6.18-6-486 #1 Sat Dec 27 08:57:46 UTC 2008 i686 GNU/Linux # perl -v This is perl, v5.8.8 built for i486-linux-gnu-thread-multi # perl -le 'eval "use $_; print qq|$_ => \$${_}::VERSION|" for qw(Rose::DateTime::Util DateTime::Locale)' Rose::DateTime::Util => 0.534 DateTime::Locale => 0.3101 -- Sven Schöling Entwickler LINET Services GmbH | Am Alten Bahnhof 4b | 38122 Braunschweig Tel. 0531-180508-0 | Fax 0531-180508-29 | http://www.linet-services.de Geschäftsführung: Philip Reetz und Torsten Börner HR B 9170 Amtsgericht Braunschweig ---------------------------------------------------- Besuchen Sie uns auf der CeBIT (1. bis 5. März) auf dem Univention-Partnerstand in Halle 2 Stand D36 ----------------------------------------------------
--- a/Rose/DateTime/Util.pm 2010-03-22 21:29:25.000000000 +0100 +++ b/Rose/DateTime/Util.pm 2011-01-24 17:26:48.000000000 +0100 @@ -57,8 +57,10 @@ my $locale_class = DateTime::Locale->load(DateTime->DefaultLocale); - my $short = $locale_class->date_format_short; - + my $short = $DateTime::Locale::VERSION >= 0.4 + ? $locale_class->date_format_short + : $locale_class->short_date_format; + $short =~ tr{dmyDMY}{}cd; $short =~ tr{dmyDMY}{dmydmy}s;
On Mon Jan 24 11:51:01 2011, s.schoeling@linet-services.de wrote: Show quoted text
> R:DT does not specify which DateTime::Locale version it needs. DT:L > changed its API in v0.4. Methods now ending with '_short', '_long', > 'medium', and '_full' used to be prefixed with those expressions. R:DT:U > uses those in init_europea_dates, which dies on old DT:L versions.
I was under the impression that DateTime itself would complain if it doesn't have a new enough DateTime::Locale. Example error message produced by loading DateTime 0.66 with DateTime::Locale 0.35: "DateTime::Locale version 0.4 required--this is only version 0.35 at /usr/local/lib/perl5/site_perl/5.12.1/darwin-2level/DateTime.pm line 45" Anyway, it's easy enough to patch (though I'm going to use can() instead of a version number comparison). Thanks for the report.
Subject: Re: [rt.cpan.org #65070] Rose::DateTime and DateTime::Locale 0.3x
Date: Mon, 24 Jan 2011 18:40:48 +0100
To: bug-Rose-DateTime [...] rt.cpan.org
From: Sven Schöling <s.schoeling [...] linet-services.de>
John Siracusa via RT wrote: Show quoted text
> I was under the impression that DateTime itself would complain if it doesn't have a new enough > DateTime::Locale. Example error message produced by loading DateTime 0.66 with > DateTime::Locale 0.35: > > "DateTime::Locale version 0.4 required--this is only version 0.35 at > /usr/local/lib/perl5/site_perl/5.12.1/darwin-2level/DateTime.pm line 45" > > Anyway, it's easy enough to patch (though I'm going to use can() instead of a version number > comparison). Thanks for the report. >
It was chosen to keep as many prepackaged cpan distributions as possible on those legacy systems, and DateTime was one of them. Sorry for not including the DateTime version in my report: Debian Etch: 0.35 Ubuntu 8.04: 0.41 Ubuntu 9.04: 0.55 those will of course not complain about their matching DateTime::Locale.