Add -L option to specify an inclusion list
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 14 Oct 2009 21:11:01 +0000 (21:11 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 14 Oct 2009 21:11:01 +0000 (21:11 +0000)
cp-po

diff --git a/cp-po b/cp-po
index 93d19c34af6fcc6c326b011aac10e0d94ef53bc5..9693e5c65daf146394e380e2bc305ae3cc507ad6 100755 (executable)
--- a/cp-po
+++ b/cp-po
@@ -16,13 +16,14 @@ adjustcvskeywords=true
 force=false
 run=true
 
-TEMP=$(getopt fkn "$@")
+TEMP=$(getopt fkL:n "$@")
 eval set -- "$TEMP"
 
 while true; do
        case $1 in
                -f)     force=true; shift;;
                -k)     adjustcvskeywords=false; shift;;
+               -L) qualfile=$2; shift; shift;;
                -n)     run=false; shift;;
                --)     shift; break;;
        esac
@@ -47,6 +48,10 @@ for srcfile in $(find "$srcdir" -name '*.po'); do
        lang=$(expr $base : '\([a-z][a-zA-Z_]*\)')
        srccat=$(expr $base : '.*/\([^/]*\)\.po$')
 
+       if [ -n "$qualfile" ] && ! grep -q -F "$srccat/$lang" "$qualfile"; then
+               continue
+       fi
+
        if ! msgfmt -o /dev/null -c -v $srcfile 2>/dev/null; then
                echo "$me: $srcfile has errors" 1>&2
                msgfmt -o /dev/null -c -v $srcfile || :