chiark / gitweb /
helper for grabbing strings from debian/po directories in other trees
authorColin Watson <cjwatson@chiark.greenend.org.uk>
Tue, 17 Jan 2006 23:13:44 +0000 (23:13 +0000)
committerColin Watson <cjwatson@chiark.greenend.org.uk>
Tue, 17 Jan 2006 23:13:44 +0000 (23:13 +0000)
grab-string [new file with mode: 0755]

diff --git a/grab-string b/grab-string
new file mode 100755 (executable)
index 0000000..d011637
--- /dev/null
@@ -0,0 +1,22 @@
+#! /bin/sh
+
+if [ $# -lt 2 ]; then
+       echo "Usage: $0 OLD-TREE STRING" >&2
+       exit 1
+fi
+
+if ! [ -d debian/po-new ]; then
+       cp -a debian/po debian/po-new
+fi
+
+for x in $1/debian/po/*.po; do
+       base=$(basename $x)
+       msgconv -t UTF-8 $x | \
+               msgattrib --translated - | \
+               msggrep -K -e "$2" - | \
+               msgconv -t $(po-charset debian/po-new/$base) - | \
+               msgcat --use-first debian/po-new/$base - | \
+               sponge debian/po-new/$base
+done
+
+exit 0