On Thu Mar 19 05:04:05 2009, DOLMEN wrote:
Show quoted text> Version 0.08 generates the %changelog section of the spec file with
> locale dependent dates (with strftime() line 288).
> RPM does not like dates in french such as "jeu mar 19 2009".
>
> Compare:
> LANG=en_US cpan2dist --format=CPANPLUS::Dist::RPM --buildprereq --force
> Storable
> with:
> LANG=fr_FR cpan2dist --format=CPANPLUS::Dist::RPM --buildprereq --force
> Storable
>
>
> Workaround: force an english locale.
>
> *** FIX ***
> The date is currently formatted using POSIX::strftime (line 288 of
RPM.pm):
Show quoted text> strftime("%a %b %d %Y", localtime)
> Use this instead:
> do { my $d = scalar localtime; substr($d, 0, 11) . substr($d, 20) }
Another patch:
--- RPM.pm.orig 2010-03-15 22:12:50.000000000 +0100
+++ RPM.pm 2010-03-15 22:41:02.000000000 +0100
@@ -28,7 +28,7 @@
use Path::Class;
use Pod::POM;
use Pod::POM::View::Text;
-use POSIX qw{ strftime };
+use POSIX qw{ strftime setlocale LC_ALL LC_TIME};
use Readonly;
use Software::LicenseUtils;
use Text::Autoformat;
@@ -279,6 +279,11 @@
my $tmpl = Template->new;
# Process template into spec
+ # Use "C" strftime
+ my $oldlcall = setlocale( LC_ALL );
+ my $oldltime = setlocale( LC_TIME );
+ setlocale( LC_ALL, "C" );
+ setlocale( LC_TIME, "C" );
$tmpl->process(
$self->section_data('spec'),
{
@@ -293,6 +298,8 @@
},
$self->status->specpath,
);
+ setlocale( LC_ALL, $oldlcall );
+ setlocale( LC_TIME, $oldltime );
}
sub _package_exists {