diff options
author | Bernhard Voelker <mail@bernhard-voelker.de> | 2013-09-10 07:56:18 +0200 |
---|---|---|
committer | Bernhard Voelker <mail@bernhard-voelker.de> | 2013-09-12 07:41:28 +0200 |
commit | 321933e14fbe05cd212d78de0beefdde64b5966b (patch) | |
tree | 20e14fcccb6269a04180d4b7a7345c5a3a0d2be2 /man | |
parent | 46f7e05291a22a1f15f839827ed257782138fae0 (diff) | |
download | coreutils-321933e14fbe05cd212d78de0beefdde64b5966b.tar.xz |
maint: use help2man configured with --disable-nls
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.
Diffstat (limited to 'man')
-rw-r--r-- | man/help2man.diff | 8 | ||||
-rwxr-xr-x | man/help2man.in | 41 |
2 files changed, 13 insertions, 36 deletions
diff --git a/man/help2man.diff b/man/help2man.diff index 017f4dc5b..12fa76f22 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 79f686cd7..bfeb98972 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 = (); |