coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] maint: update help2man to 1.43.3


From: Bernhard Voelker
Subject: Re: [PATCH] maint: update help2man to 1.43.3
Date: Tue, 10 Sep 2013 08:03:09 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

On 09/10/2013 04:40 AM, Pádraig Brady wrote:
> http://hydra.nixos.org/build/6038769 is failing with:
> 
> Can't locate Locale/gettext.pm in @INC
> BEGIN failed--compilation aborted at ./man/help2man line 28.

ouch, sorry.
The following patch should fix it.

BTW: do we have a place where to document how to update such
components?

Have a nice day,
Berny


>From cde1ea0ef1d4b26df843538df29bbc8415af3514 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <address@hidden>
Date: Tue, 10 Sep 2013 07:56:18 +0200
Subject: [PATCH] maint: use help2man configured with --disable-nls
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Prompted by the continuous integration build failure at:
http://hydra.nixos.org/build/6038769

The previously committed 'help2man' requires a Perl module
which does not seem to be installed everywhere - and which
is not needed for our purposes:

  Can't locate Locale/gettext.pm in @INC
  BEGIN failed--compilation aborted at ./man/help2man line 28.

This module was pulled in automatically by the default configure call.
Use the NLS-disabled version instead.

* man/help2man.in: Use help2man configured with the --disable-nls
option to avoid the dependency to the above Perl module.
* man/help2man.diff: Adapt the line numbers of the hunks in the
coreutils-specific patch for help2man to apply without fuzz.

Reported by Pádraig Brady.
---
 man/help2man.diff |  8 ++++----
 man/help2man.in   | 41 +++++++++--------------------------------
 2 files changed, 13 insertions(+), 36 deletions(-)

diff --git a/man/help2man.diff b/man/help2man.diff
index 017f4dc..12fa76f 100644
--- a/man/help2man.diff
+++ b/man/help2man.diff
@@ -1,6 +1,6 @@
 --- man/help2man-orig
-+++ man/help2man       2013-08-01 02:37:57.771389937 +0200
-@@ -435,6 +435,7 @@
++++ man/help2man       2013-09-10 07:31:28.352365301 +0200
+@@ -412,6 +412,7 @@
  my $PAT_FILES         = _('Files');
  my $PAT_EXAMPLES      = _('Examples');
  my $PAT_FREE_SOFTWARE = _('This +is +free +software');
@@ -8,7 +8,7 @@

  # Start a new paragraph (if required) for these.
  s/([^\n])\n($PAT_BUGS|$PAT_AUTHOR) /$1\n\n$2 /og;
-@@ -467,6 +468,12 @@
+@@ -444,6 +445,12 @@
        next;
      }

@@ -21,7 +21,7 @@
      # Copyright section
      if (/^Copyright /)
      {
-@@ -645,7 +652,7 @@
+@@ -622,7 +629,7 @@
  .B %s
  programs are properly installed at your site, the command
  .IP
diff --git a/man/help2man.in b/man/help2man.in
index 79f686c..bfeb989 100755
--- a/man/help2man.in
+++ b/man/help2man.in
@@ -25,43 +25,22 @@ use strict;
 use Getopt::Long;
 use Text::Tabs qw(expand);
 use POSIX qw(strftime setlocale LC_ALL);
-use Locale::gettext;
-use Encode qw(decode encode);
-use I18N::Langinfo qw(langinfo CODESET);

 my $this_program = 'help2man';
 my $this_version = '1.43.3';
-my $encoding;

+sub _ { $_[0] }
+sub configure_locale
 {
-    my $gettext = Locale::gettext->domain($this_program);
-    sub _ { $gettext->get($_[0]) }
-
-    my ($user_locale) = grep defined && length,
-       (map $ENV{$_}, qw(LANGUAGE LC_ALL LC_MESSAGES LANG)), 'C';
-
-    my $user_encoding = langinfo CODESET;
-
-    # Set localisation of date and executable's output.
-    sub configure_locale
-    {
-       delete @ENV{qw(LANGUAGE LC_MESSAGES LANG)};
-       setlocale LC_ALL, $ENV{LC_ALL} = shift || 'C';
-       $encoding = langinfo CODESET;
-    }
-
-    sub dec { $encoding ? decode $encoding, $_[0] : $_[0] }
-    sub enc { $encoding ? encode $encoding, $_[0] : $_[0] }
-    sub enc_user { encode $user_encoding, $_[0] }
-    sub kark # die with message formatted in the invoking user's locale
-    {
-       setlocale LC_ALL, $user_locale;
-       my $fmt = $gettext->get(shift);
-       my $errmsg = enc_user sprintf $fmt, @_;
-       die $errmsg, "\n";
-    }
+    my $locale = shift;
+    die "$this_program: no locale support (Locale::gettext required)\n"
+       unless $locale eq 'C';
 }

+sub dec { $_[0] }
+sub enc { $_[0] }
+sub enc_user { $_[0] }
+sub kark { die +(sprintf shift, @_), "\n" }
 sub N_ { $_[0] }

 sub program_basename;
@@ -142,8 +121,6 @@ my %opt_def = (
 Getopt::Long::config('bundling');
 die $help_info unless GetOptions %opt_def and @ARGV == 1;

-configure_locale unless $encoding;
-
 my %include = ();
 my %replace = ();
 my %append = ();
-- 
1.8.3.1




reply via email to

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