quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Quilt-dev] [PATCH] Fix ugly test-breaking spam with Perl 5.16+ and


From: Jean Delvare
Subject: Re: [Quilt-dev] [PATCH] Fix ugly test-breaking spam with Perl 5.16+ and Locale::gettext
Date: Thu, 3 Nov 2016 11:06:05 +0100

On Sun, 31 Mar 2013 19:56:56 +0100, Nix wrote:
> Perl 5.16+ has started to complain if you import all symbols from both
> POSIX and Locale::gettext, which quilt does in a couple of places.

I don't see us doing that actually. We only import function setlocale
from the POSIX module.

> This is ugly and breaks 'make check':
> 
> [10] $ quilt refresh -- failed
> Prototype mismatch: sub main::LC_ALL: none vs () at 
> .../quilt/scripts/remove-trailing-ws line 21.            != Refreshed patch 
> patches/test.diff
> Prototype mismatch: sub main::LC_NUMERIC: none vs () at 
> .../quilt/scripts/remove-trailing-ws line 21.        != ~
> Prototype mismatch: sub main::LC_TIME: none vs () at 
> .../quilt/scripts/remove-trailing-ws line 21.           != ~
> Prototype mismatch: sub main::LC_MONETARY: none vs () at 
> .../quilt/scripts/remove-trailing-ws line 21.       != ~
> Prototype mismatch: sub main::LC_CTYPE: none vs () at 
> .../quilt/scripts/remove-trailing-ws line 21.          != ~
> Prototype mismatch: sub main::LC_MESSAGES: none vs () at 
> .../quilt/scripts/remove-trailing-ws line 21.       != ~
> Prototype mismatch: sub main::LC_COLLATE: none vs () at 
> .../quilt/scripts/remove-trailing-ws line 21.        != ~
> Refreshed patch patches/test.diff                                             
>                                != ~

A quick web search suggests that this was a bug in either perl itself
or the Locale::gettext perl module, which has presumably been fixed
since. It was 3 years ago, I'm running perl 5.18 now and have never
encountered this specific problem. Therefore I am NOT applying the
patch below, as it doesn't seem to be needed. Let me know if you still
need it.

A couple notes for the record:
* The fix looks like a hack anyway. I'm no perl expert but it seems
  wrong that changing the order in which modules are imported changes
  the outcome. If anything, the Locale::gettext manual page says to
  load Locale::gettext first and then POSIX.
* The fix breaks if Locale::gettext isn't installed on the system:
  "Subroutine setlocale redefined at (eval 11) line 3." It could be
  fixed by removing our empty stub for this function though (as it is
  then unconditionally defined.)

> Fix trivial.
> 
> Index: quilt/quilt/scripts/edmail.in
> ===================================================================
> --- quilt.orig/quilt/scripts/edmail.in        2013-03-31 19:37:11.190159678 
> +0100
> +++ quilt/quilt/scripts/edmail.in     2013-03-31 19:37:13.129997757 +0100
> @@ -7,6 +7,7 @@
>  #            Message Header Extensions for Non-ASCII Text
>  
>  use Getopt::Long;
> +use POSIX qw(setlocale);
>  use strict;
>  
>  # This ugly trick lets the script work even if gettext support is missing.
> @@ -15,8 +16,6 @@
>  BEGIN {
>      if (eval { require Locale::gettext }) {
>       import Locale::gettext;
> -     require POSIX;
> -     import POSIX, qw(setlocale);
>      } else {
>       eval '
>           use constant LC_MESSAGES => 0;
> Index: quilt/quilt/scripts/remove-trailing-ws.in
> ===================================================================
> --- quilt.orig/quilt/scripts/remove-trailing-ws.in    2013-03-31 
> 19:37:11.190159678 +0100
> +++ quilt/quilt/scripts/remove-trailing-ws.in 2013-03-31 19:37:13.129997757 
> +0100
> @@ -9,6 +9,7 @@
>  use FileHandle;
>  use File::Temp qw( :mktemp );
>  use Getopt::Std;
> +use POSIX qw(setlocale);
>  use vars qw($opt_p $opt_n);
>  
>  # This ugly trick lets the script work even if gettext support is missing.
> @@ -17,8 +18,6 @@
>  BEGIN {
>      if (eval { require Locale::gettext }) {
>       import Locale::gettext;
> -     require POSIX;
> -     import POSIX, qw(setlocale);
>      } else {
>       eval '
>           use constant LC_MESSAGES => 0;

-- 
Jean Delvare
SUSE L3 Support



reply via email to

[Prev in Thread] Current Thread [Next in Thread]