git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Tom G. Christensen" <tgc@statsbiblioteket.dk>
To: git@vger.kernel.org
Subject: I18N.pm is incompatible with perl < 5.8.3
Date: Thu, 2 Feb 2012 14:11:20 +0100	[thread overview]
Message-ID: <4F2A8B78.6090902@statsbiblioteket.dk> (raw)

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

             reply	other threads:[~2012-02-02 13:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02 13:11 Tom G. Christensen [this message]
2012-02-02 16:48 ` I18N.pm is incompatible with perl < 5.8.3 Æ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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F2A8B78.6090902@statsbiblioteket.dk \
    --to=tgc@statsbiblioteket.dk \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).