chiark / gitweb /
revert r2430; still useful on chiark
[bin.git] / grab-string
1 #! /bin/sh
2
3 if [ $# -lt 2 ]; then
4         echo "Usage: $0 OLD-TREE STRING" >&2
5         exit 1
6 fi
7
8 if ! [ -d debian/po-new ]; then
9         cp -a debian/po debian/po-new
10 fi
11
12 for x in $1/debian/po/*.po; do
13         base=$(basename $x)
14         msgconv -t UTF-8 $x | \
15                 msgattrib --translated - | \
16                 msggrep -K -e "$2" - | \
17                 msgconv -t $(po-charset debian/po-new/$base) - | \
18                 msgcat --use-first debian/po-new/$base - | \
19                 sponge debian/po-new/$base
20 done
21
22 exit 0