On Tue, 03 Jun 2008, Brendan O'Dea wrote:
> > I tried this but it doesn't work. The variable needs to be set before perl
> > is executed apparently. So you'd need some trick so that the script exec
> > itself a second time but with the environment variable set.
> 
> Really?  Something like this fails?
> 
> BEGIN {
>   local $ENV{PERL_DL_NONLAZY} = 1;
>   eval {
>     require "Locale::Gettext";
>     Locale::Gettext->import;
>   };
>   if ($@) {
>     # handle
>   }
> }

I wanted to fix it for all scripts that use Dpkg::Gettext (there's dpkg-divert
too) and as such I tried to add the "$ENV{PERL_DL_NONLAZY} = 1;" in
/usr/share/perl5/Dpkg/Gettext.pm:

--- a/scripts/Dpkg/Gettext.pm
+++ b/scripts/Dpkg/Gettext.pm
@@ -7,6 +7,7 @@ use strict;
 use warnings;
 
 BEGIN {
+        local $ENV{PERL_DL_NONLAZY} = 1;
        eval 'use Locale::gettext';
        if ($@) {
                eval q{


This doesn't work and I don't understand why.

However, now I tried to add the line directly to update-alternatives and it 
worked:
--- a/scripts/update-alternatives.pl
+++ b/scripts/update-alternatives.pl
@@ -1,5 +1,9 @@
 #!/usr/bin/perl --
 
+BEGIN {
+    $ENV{PERL_DL_NONLAZY} = 1;
+}
+
 use strict;
 use warnings;


Can anyone explain me why?

To test I simply dpkg --force-depends --unpack
liblocale-gettext-perl_1.05-1_i386.deb (the package from etch) on a sid machine.

Cheers,
-- 
Raphaël Hertzog

Le best-seller français mis à jour pour Debian Etch :
http://www.ouaza.com/livre/admin-debian/



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to