Hello Florentin,

On Sun, Aug 06, 2006 at 11:10:08PM +0200, [EMAIL PROTECTED] wrote:
> On 19:47 Sat 05 Aug, Nicolas François wrote:
> > 
> > I don't really like this regexp (I will have to add a lot of them, e.g.
> > what about md5sum.1.gz and md5sum.textutils.1.gz; dpkg-scanpackages.8.gz
> > and dpkg-scanpackages.dpkg.8.gz; etc.)
> >
> 
> % man --all --where --locale=C md5sum.textutils
> /usr/share/man/man1/md5sum.1.gz
> 
> % man --all --where --locale=C md5sum
> /usr/share/man/man1/md5sum.1.gz
> 
> Where is the problem?
> 
> The -e, --extension option of man program provides some informations
> about posix naming manpages.

There are no exaustive list of extension, so I would prefer to avoid
adding them manually.

Does the attached patch works for you?
It finds the man page if only one page matches exactly the section.

Kind Regards,
-- 
Nekral
Index: scripts/po4aman-display-po
===================================================================
RCS file: /cvsroot/po4a/po4a/scripts/po4aman-display-po,v
retrieving revision 1.12
diff -u -r1.12 po4aman-display-po
--- scripts/po4aman-display-po  17 Jul 2006 20:56:15 -0000      1.12
+++ scripts/po4aman-display-po  6 Aug 2006 23:25:57 -0000
@@ -70,7 +70,15 @@
   then
     return 1
   elif [ "$MAN_NUMBER" != "1" ]; then
-    error "Too many possible manpages: $(man -aw -L C $section "$man"), you 
must specify the manpage or the section"
+    MAN_NUMBER=`man --all --where --locale=C $section "$man" 2> /dev/null | \
+                grep "\/$man\.$section\(.gz\)\?$" | wc -l`
+    if [ "$MAN_NUMBER" = "1" ]
+    then
+      MASTER=`man --where --locale=C "$section" "$man" | grep 
"\/$man\.$section\(.gz\)\?$"`
+      echo "Multiple manpages in section $section: $(man -aw -L C $section 
"$man"), only one exactly matches the section."
+    else
+      error "Too many possible manpages: $(man -aw -L C $section "$man"), you 
must specify the manpage or the section"
+    fi
   else
     MASTER=`man --where --locale=C "$section" "$man"`
   fi

Reply via email to