OSDN Git Service

iptables: (Makefile) Move embeded shell script to separate files
[linuxjm/jm.git] / manual / iptables / tools / generatepot.sh
diff --git a/manual/iptables/tools/generatepot.sh b/manual/iptables/tools/generatepot.sh
new file mode 100755 (executable)
index 0000000..405a305
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash -e
+
+target=$1
+
+p=$(echo $target | sed -E -e 's|(.*\.([1-8]))|man\2/\1|')
+
+pofile=po4a/$p.ja.po
+potfile=po4a/$p.pot
+master=original/$p
+if sed -e '1,3!d' $master | grep -q '^\.so '; then
+  echo "Skip link file $master"
+else
+  echo "po4a-gettextize $potfile <- $master"
+  po4a-gettextize -f man -p $potfile -m $master
+fi