libcdio-devel
[Top][All Lists]
Advanced

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

[Libcdio-devel] Work around "lt-" prefix bug in help2man


From: Eric Shattow
Subject: [Libcdio-devel] Work around "lt-" prefix bug in help2man
Date: Mon, 27 May 2013 21:08:50 -0700

libcdio-0.90 (as was 0.83) have incorrect text from help2man generated
output:

libcdio-0.90$ head src/cd-drive.1
.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.40.4.
.TH CD-DRIVE "1" "October 2012" "lt-cd-drive version 0.90
i686-pc-linux-gnu" "User Commands"
.SH NAME
cd-drive \- manual page for lt-cd-drive version 0.90 i686-pc-linux-gnu
.SH SYNOPSIS
.B cd-drive
\fIOPTION\fR...
.TP
Shows CD-ROM drive characteristics.
.SH DESCRIPTION

The problem with this text is "lt-" prefix which is ugly and wrong besides.
The Debian package of libcdio includes patches to remove this mistake from
the text of generated files, so we should fix this. This is what we find
now in libcdio-0.90:

$ help2man --version
GNU help2man 1.41.1

libcdio-0.90$ make distclean; aclocal && autoconf && automake &&
./configure --enable-maintainer-mode && make all
Making all in src
make[2]: Entering directory `/path/to/libcdio-0.90/src'
/bin/bash /path/to/libcdio-0.90/missing --run help2man
--opt-include=./cd-drive.help2man --no-info ./cd-drive | /bin/sed -r -e
's/[lL][tT]-//' >cd-drive.1

So our workaround is wrong, it only catches the first of multiple "lt-"
prefixes.  Anyway, why does there need to be a workaround;   it is because
of this bug in help2man:

 -l, --libtool           exclude the `lt-' from the program name

The above feature was added in help2man (1.39.1), so now we try it:

diff -uprN ./libcdio-0.90~orig/src/Makefile.am
./libcdio-0.90/src/Makefile.am
--- ./libcdio-0.90~orig/src/Makefile.am    2012-10-21 15:51:27.000000000
-0700
+++ ./libcdio-0.90/src/Makefile.am    2013-05-27 20:40:27.970456076 -0700
@@ -86,6 +86,6 @@ EXTRA_DIST = cd-drive.help2man cd-info.h
 if MAINTAINER_MODE
 $(man_MANS): %.1: %$(EXEEXT) %.help2man
-    -$(HELP2MAN) --opt-include=$(srcdir)/$(<:.exe=).help2man --no-info
./$< | @SED@ @SED_EXTENDED_RE_FLAG@ -e 's/[lL][tT]-//' >$@
+    -$(HELP2MAN) --opt-include=$(srcdir)/$(<:.exe=).help2man --no-info
--libtool -o $@ ./$<
 endif

libcdio-0.90$ make distclean; aclocal && autoconf && automake &&
./configure --enable-maintainer-mode && make all
Making all in src
make[2]: Entering directory `/path/to/libcdio-0.90/src'
/bin/bash /path/to/libcdio-0.90/missing --run help2man
--opt-include=./cd-drive.help2man --no-info --libtool -o cd-drive.1
./cd-drive

libcdio-0.90$ head src/cd-drive.1
.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.41.1.
.TH LT-CD-DRIVE "1" "May 2013" "lt-cd-drive version 0.90 i686-pc-linux-gnu"
"User Commands"
.SH NAME
lt-cd-drive \- manual page for lt-cd-drive version 0.90 i686-pc-linux-gnu
.SH SYNOPSIS
.B cd-drive
\fIOPTION\fR...
.TP
Shows CD-ROM drive characteristics.
.SH DESCRIPTION

Well, that means help2man did not work as advertised. So fix that with a
one-liner...

####

diff -uprN help2man-1.41.1~orig/help2man.PL help2man-1.41.1/help2man.PL
--- help2man-1.41.1~orig/help2man.PL    2012-12-30 18:38:59.000000000 -0800
+++ help2man-1.41.1/help2man.PL    2013-05-27 20:08:50.825048640 -0700
@@ -383,6 +383,7 @@ else
 }

 $program =~ s!.*/!!;
+$program =~ s!^lt-!! if $opt_libtool;

 # No info for `info' itself.
 $opt_no_info = 1 if $program eq 'info';

####

libcdio-0.90$ make distclean; aclocal && autoconf && automake &&
./configure --enable-maintainer-mode && make all
Making all in src
make[2]: Entering directory `/path/to/libcdio-0.90/src'
/bin/bash /path/to/libcdio-0.90/missing --run help2man
--opt-include=./cd-drive.help2man --no-info --libtool -o cd-drive.1
./cd-drive

libcdio-0.90$ head src/cd-drive.1
.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.41.1.
.TH CD-DRIVE "1" "May 2013" "cd-drive version 0.90 i686-pc-linux-gnu" "User
Commands"
.SH NAME
cd-drive \- manual page for cd-drive version 0.90 i686-pc-linux-gnu
.SH SYNOPSIS
.B cd-drive
\fIOPTION\fR...
.TP
Shows CD-ROM drive characteristics.
.SH DESCRIPTION


Is that the right fix for help2man?  Should we change the sed hack in
libcdio or include a copy of the modified help2man (perl script) ?

Though, this is only needed for new releases. What do you say, Rocky?


reply via email to

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