Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Locale-Maketext-Lexicon CPAN distribution.

Report information
The Basics
Id: 31940
Status: resolved
Priority: 0/
Queue: Locale-Maketext-Lexicon

People
Owner: Nobody in particular
Requestors: ntyni [...] iki.fi
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.65
Fixed in: (no value)



Subject: xgettext '-f' option is broken
Download (untitled) / with headers
text/plain 349b
Hi, as reported in Debian bug #307777, http://bugs.debian.org/307777 , the Locale::Maketext::Extract::Run() function can't handle newline-separated input for the '-f' option. This is fixed by chomp()ing the filenames. I'm attaching a patch and a crude testcase for this. Cheers, -- Niko Tyni (on behalf of the Debian Perl Group) ntyni@debian.org
Subject: 307777.patch
Download 307777.patch
text/x-diff 1.2k
diff --git a/lib/Locale/Maketext/Extract/Run.pm b/lib/Locale/Maketext/Extract/Run.pm index 205d5dd..3a6e7c0 100644 --- a/lib/Locale/Maketext/Extract/Run.pm +++ b/lib/Locale/Maketext/Extract/Run.pm @@ -52,6 +52,7 @@ sub run { foreach my $file (@{$opts{f}||[]}) { open FILE, $file or die "Cannot open $file: $!"; while (<FILE>) { + chomp; push @ARGV, $_ if -r and !-d; } } diff --git a/t/7-runextract.t b/t/7-runextract.t new file mode 100644 index 0000000..f751906 --- /dev/null +++ b/t/7-runextract.t @@ -0,0 +1,28 @@ +#! /usr/bin/perl -w +use lib '../lib'; +use strict; +use Test::More tests => 2; + +# test if the xgettext '-f' parameter stripts newlines from the filenames +# http://bugs.debian.org/307777 + +use_ok('Locale::Maketext::Extract::Run'); + +my $inputfile = "$$.in"; +my $listfile = "$$.list"; +my $outfile = "$$.out"; + +open(F, ">$inputfile") or die("create $inputfile failed: $!"); +print F "loc('test')"; +close F; + +open(F, ">$listfile") or die("create $inputfile failed: $!"); +print F "$inputfile\n/dev/null"; +close F; + +Locale::Maketext::Extract::Run::xgettext('-f', $listfile, '-o', $outfile); + +ok(-s $outfile, "non-empty output for Locale::Maketext::Extract::Run::xgettext"); + +unlink $_ for ($inputfile, $listfile, $outfile); +
Download (untitled) / with headers
text/plain 495b
On Thu Dec 27 15:18:40 2007, ntyni@iki.fi wrote: Show quoted text
> Hi, > > as reported in Debian bug #307777, http://bugs.debian.org/307777 , the > Locale::Maketext::Extract::Run() function can't handle newline-separated > input for the '-f' option. This is fixed by chomp()ing the filenames. > > I'm attaching a patch and a crude testcase for this. > > Cheers,
Hi Niko Sorry it has taken so long to deal with this bug - your fix and tests will be in the next release (early November : 0.74) thanks Clint


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.