[Po4a-commits] "po4a/scripts po4aman-display-po,1.1,1.2"
Nicolas FRANCOIS
nekral-guest at alioth.debian.org
Fri Apr 7 22:27:33 UTC 2006
- Previous message: [Po4a-commits] "po4a/scripts po4aman-display-po,NONE,1.1"
- Next message: [Po4a-commits] "po4a msguntypot, 1.3, NONE msgsearch, 1.8,
NONE MANIFEST, 1.30, 1.31 Build.PL, 1.24, 1.25"
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/po4a/po4a/scripts
In directory haydn:/tmp/cvs-serv17578/scripts
Modified Files:
po4aman-display-po
Log Message:
Try to detect the original man page according to the references in the PO.
Index: po4aman-display-po
===================================================================
RCS file: /cvsroot/po4a/po4a/scripts/po4aman-display-po,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- po4aman-display-po 7 Apr 2006 22:21:42 -0000 1.1
+++ po4aman-display-po 7 Apr 2006 22:27:30 -0000 1.2
@@ -1,9 +1,14 @@
#!/bin/sh
+#
+# po4aman-display-po permits to see how a manpage translated with po4a
+# will be displayed, without needing to uncompress the original manpage
+# and call po4a-translate.
+#
OPTIONS="";
function usage() {
- echo "Usage: $0 -m MASTER_FILE -p PO_FILE [-o PO4A_OPT]";
+ echo "Usage: $0 -p PO_FILE [-m MASTER_FILE] [-o PO4A_OPT]";
return 0;
}
@@ -30,6 +35,40 @@
esac
done
+if [ -z "$MASTER" ] && [ -n "$PO" ]
+then
+ echo "No manpage specified."
+ echo "Trying to find the manpage according to a line reference in the PO."
+ file=$(grep -m 1 "^#:" $PO | sed -e 's/^.* \(.*\):.*$/\1/')
+ file=$(basename $file)
+ ext=""
+ echo Looking for manpage: $file
+ MASTER=$(man -w $file)
+ if [ $? != "0" ]
+ then
+ ext=$(echo $file | sed -e 's/^.*\.\([1-9].*\)$/\1/' -e 's/\..*//')
+ file=$(echo $file | sed -e 's/\.[1-9].*//')
+ echo looking for manpage $file in section $ext
+ MASTER=$(man -w $ext $file)
+ if [ $? != "0" ]
+ then
+ file=$(echo $file | sed -e 's/\..*//')
+ echo looking for manpage $file in section $ext
+ MASTER=$(man -w $ext $file)
+ if [ $? != "0" ]
+ then
+ echo No manpage found for $PO
+ echo you must provide the manpage with the -m option
+ MASTER=""
+ fi
+ fi
+ fi
+ if [ -n "$MASTER" ]
+ then
+ echo Using: $MASTER as the original manpage
+ fi
+fi
+
# checking mandatory options
if [ -z $MASTER ];
then
- Previous message: [Po4a-commits] "po4a/scripts po4aman-display-po,NONE,1.1"
- Next message: [Po4a-commits] "po4a msguntypot, 1.3, NONE msgsearch, 1.8,
NONE MANIFEST, 1.30, 1.31 Build.PL, 1.24, 1.25"
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Po4a-commits
mailing list