Bug 873493

Summary: There should be nls support in help2man (1.40.12-1)
Product: [Fedora] Fedora Reporter: Sébastien Boisvert <sebhtml>
Component: help2manAssignee: Ralf Corsepius <rc040203>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 17CC: ovasik, rc040203, sebhtml, susi.lehtola
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-01 09:18:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sébastien Boisvert 2012-11-06 02:09:45 UTC
Description of problem:

There should be nls support in help2man (1.40.12-1).
Otherwise, help2man --locale en_US.UTF-8  throws 

   "help2man: no locale support (Locale::gettext required)"


Version-Release number of selected component (if applicable):

help2man.noarch 1.40.12-1.fc17 @updates

perl-gettext.x86_64 1.05-24.fc17 @fedora


How reproducible:

program.c is very small and printf é\n. Thus, it needs
unicode support.

Run "bash bugzilla.redhat.com-bug-help2man.sh"

$ cat bugzilla.redhat.com-bug-help2man.sh 
# 1. Install dependencies
sudo yum install -y gcc help2man perl-gettext coreutils bash &> /dev/null

# 2. Create a source code

cat > program.c << EOF
#include <stdio.h>
#include <stdlib.h>

int main(int argc,char**argv){
	printf("é\n");

	return EXIT_SUCCESS;
}
EOF

# 3. Compile the program
gcc program.c -o program

# 4. Run help2man, this calls ./program --help
help2man -L en_US.UTF-8 ./program -o program.1 &> Errors

# 5. Display the error
head -n 1 Errors

if test -f program.1
then
	echo "PASS: man page program.1 generated !"
else
	echo "FAIL: man page program.1 not generated ;-("
fi


Steps to Reproduce:

1. Run "bash bugzilla.redhat.com-bug-help2man.sh"
2. Read the line "help2man: no locale support (Locale::gettext required)"
3. Check in koji for nls support in help2man 1.40.12
   => http://koji.fedoraproject.org/koji/buildinfo?buildID=358087
  

Actual results:

$ bash bugzilla.redhat.com-bug-help2man.sh 
help2man: no locale support (Locale::gettext required)
FAIL: man page program.1 not generated ;-(


Expected results:

$ bash bugzilla.redhat.com-bug-help2man.sh 
PASS: man page program.1 generated !


Additional info:

(3 entries)

1. Information for build help2man-1.40.12-1.fc17
http://koji.fedoraproject.org/koji/buildinfo?buildID=358087

2. help2man in Fedora pkgdb
https://admin.fedoraproject.org/pkgdb/acls/name/help2man

3. A package that needs help2man --locale
Review Request: Ray - Parallel genome assemblies for parallel DNA sequencing
https://bugzilla.redhat.com/show_bug.cgi?id=872783#c18

Comment 1 Susi Lehtola 2012-11-14 11:40:04 UTC
Ping Ralf? Is there any reason this is not turned on by default?

Comment 2 Ralf Corsepius 2012-11-14 15:19:03 UTC
(In reply to comment #1)
> Ping Ralf?
Sorry for not having responded earlier.

> Is there any reason this is not turned on by default?
Yes. It's disabled for security reasons (Help2man uses LD_PRELOAD) ever since the package is in Fedora (many years).

Comment 3 Susi Lehtola 2012-11-14 20:52:59 UTC
But it is not impossible to change the behavior...?
Maybe Sébastien could have a look into it?

Comment 4 Sébastien Boisvert 2012-11-15 12:28:10 UTC
I have looked at the source code (in perl) of GNU help2man. It seems to me that the source code is spliced (with some sort of pre-processor) to remove undesired hunks of code. The --locale feature is therefore totally not available in the Fedora help2man package for any locale using non-ASCII characters.

The specific code in help2man-1.40.12/help2man.PL that seems to do the splicing is


!GROK!THIS!

...

!WITH!GETTEXT!

...

!NO!GETTEXT!

...


The Fedora package only has the hunks for !NO!GETTEXT! and nothing at all for !WITH!GETTEXT!.


If I compare the sizes (1.40.12-1.fc17 and 1.40.12 from upstream):

$ wc -l /usr/bin/help2man
670 /usr/bin/help2man
$ wc -l ~/help2man-1.40.12/help2man.PL 
800 /home/seb/help2man-1.40.12/help2man.PL


If I compare them:

$ diff -u ~/help2man-1.40.12/help2man.PL  /usr/bin/help2man |wc -l
168

$ diff -u ~/help2man-1.40.12/help2man.PL  /usr/bin/help2man |grep ^\-|grep -v ^\-\-\-|wc -l
133

$ diff -u ~/help2man-1.40.12/help2man.PL  /usr/bin/help2man |grep ^+|grep -v ^+++|wc -l
3

800 - 133 + 3 = 670

So during its evolution, help2man has lot all its --locale features for the Fedora ecological niche.

Comment 5 Ralf Corsepius 2012-11-16 04:22:05 UTC
(In reply to comment #4)
> I have looked at the source code (in perl) of GNU help2man. It seems to me
> that the source code is spliced (with some sort of pre-processor) to remove
> undesired hunks of code. The --locale feature is therefore totally not
> available in the Fedora help2man package for any locale using non-ASCII
> characters.

I do not understand (May-be there is a language barrier in effect?)

help2man in Fedora is the original help2man with no patches applied and is configured with --disable-nls.

> So during its evolution, help2man has lot all its --locale features for the
> Fedora ecological niche.
?!? 

nls in help2man is a configuration/build-time parameter. We chose to switch nls off, because the design/approach upstream chose to support nls appears error-prone and risky (c.f. info help2man "Localised man pages").

Comment 6 Sébastien Boisvert 2012-11-19 02:33:44 UTC
> I do not understand (May-be there is a language barrier in effect?)

It just seems to me that the source code of help2man.PL is preprocessed during the packaged process, and that switching off nls eliminates lines during the preprocessing.

Comment 7 Fedora End Of Life 2013-07-04 02:46:00 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Fedora End Of Life 2013-08-01 09:18:57 UTC
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.