git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* I18N.pm is incompatible with perl < 5.8.3
@ 2012-02-02 13:11 Tom G. Christensen
  2012-02-02 16:48 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 11+ messages in thread
From: Tom G. Christensen @ 2012-02-02 13:11 UTC (permalink / raw)
  To: git

Hello,

While running the git 1.7.9 testsuite on RHEL 3 with perl 5.8.0 and 
gettext 0.11.4 I got this error in t0202-gettext-perl.sh:
# test_external test Perl Git::I18N API failed: /usr/bin/perl 
/builddir/build/BUILD/git-1.7.9/t/t0202/test.pl
# test_external_without_stderr test no stderr: Perl Git::I18N API 
failed: /usr/bin/perl /builddir/build/BUILD/git-1.7.9/t/t0202/test.pl:

A verbose run gave me this:
# test_external test Perl Git::I18N API failed: /usr/bin/perl 
/builddir/build/BUILD/git-1.7.9/t/t0202/test.pl
# expecting no stderr from previous command
# test_external_without_stderr test no stderr: Perl Git::I18N API 
failed: /usr/bin/perl /builddir/build/BUILD/git-1.7.9/t/t0202/test.pl:
# Stderr is:
"import" is not exported by the Exporter module
Can't continue after import errors at 
/builddir/build/BUILD/git-1.7.9/t/../perl/blib/lib/Git/I18N.pm line 5
BEGIN failed--compilation aborted at 
/builddir/build/BUILD/git-1.7.9/t/../perl/blib/lib/Git/I18N.pm line 5.
Compilation failed in require at 
/builddir/build/BUILD/git-1.7.9/t/t0202/test.pl line 8.
BEGIN failed--compilation aborted at 
/builddir/build/BUILD/git-1.7.9/t/t0202/test.pl line 8.
# Looks like your test died before it could output anything.

I found the cause and the solution here:
http://www.nntp.perl.org/group/perl.module.build/2008/02/msg1214.html

I've changed
  use Exporter 'import'
to
  BEGIN {
   require Exporter;
   *{import} = \&Exporter::import;
   }
in I18N.pm.

The test now passes (GETTEXT_LOCALE=1):
# lib-gettext: No is_IS UTF-8 locale available
# lib-gettext: No is_IS ISO-8859-1 locale available
# run 1: Perl Git::I18N API (/usr/bin/perl 
/builddir/build/BUILD/git-1.7.9/t/t0202/test.pl)
1..8
ok 1 - Testing Git::I18N with NO Perl gettext library
ok 2 - Git::I18N is located at 
/builddir/build/BUILD/git-1.7.9/t/../perl/blib/lib/Git/I18N.pm
ok 3 - sanity: Git::I18N has 1 export(s)
ok 4 - sanity: Git::I18N exports everything by default
ok 5 - sanity: __ has a $ prototype
ok 6 - Passing a string through __() in the C locale works
ok 7 - Without a gettext library + <C> locale <TEST: A Perl test string> 
turns into <TEST: A Perl test string>
ok 8 - Without a gettext library + <is> locale <TEST: A Perl test 
string> turns into <TEST: A Perl test string>
# test_external test Perl Git::I18N API was ok
# expecting no stderr from previous command
# test_external_without_stderr test no stderr: Perl Git::I18N API was ok

-tgc

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-03-16 16:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-02 13:11 I18N.pm is incompatible with perl < 5.8.3 Tom G. Christensen
2012-02-02 16:48 ` Ævar Arnfjörð Bjarmason
2012-02-02 21:23   ` Tom G. Christensen
2012-03-07 12:56   ` Tom G. Christensen
2012-03-07 20:53     ` Ævar Arnfjörð Bjarmason
2012-03-10 12:29       ` [PATCH 0/2] Minor fixes for Perl + Git::I18N Ævar Arnfjörð Bjarmason
2012-03-10 12:29         ` [PATCH 1/2] Git::I18N: compatibility with perl <5.8.3 Ævar Arnfjörð Bjarmason
2012-03-10 12:29         ` [PATCH 2/2] perl/Makefile: install Git::I18N under NO_PERL_MAKEMAKER Ævar Arnfjörð Bjarmason
2012-03-10 21:38           ` Junio C Hamano
2012-03-11 19:27             ` Ævar Arnfjörð Bjarmason
2012-03-16 16:14               ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).