[Po4a-commits] "po4a/scripts po4aman-display-po,1.12,1.13"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Mon Aug 7 19:23:07 UTC 2006


Update of /cvsroot/po4a/po4a/scripts
In directory haydn:/tmp/cvs-serv10154/scripts

Modified Files:
	po4aman-display-po 
Log Message:
If man -aw find multiple manpages (e.g. ls.1 and ls.1posix), but only one
exactly matches the given section, use this page. Thanks to Florentin
Duneau for reporting.


Index: po4aman-display-po
===================================================================
RCS file: /cvsroot/po4a/po4a/scripts/po4aman-display-po,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- po4aman-display-po	17 Jul 2006 20:56:15 -0000	1.12
+++ po4aman-display-po	7 Aug 2006 19:23:05 -0000	1.13
@@ -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




More information about the Po4a-commits mailing list