shorten pattern to include multi-line elements (I should use

xmlstarlet here but need to grok xslt); don't report as missing
strings in the common file
This commit is contained in:
eehouse 2010-05-27 02:58:08 +00:00
parent cc984f02ab
commit 6b9c4a4e0f

View file

@ -5,8 +5,10 @@ LOCALES=values
check_add () { check_add () {
STRING=$1 STRING=$1
for VALUES in $LOCALES; do for VALUES in $LOCALES; do
PAT="<string name=\"$STRING\">.*</string>" PAT="<string name=\"$STRING\">"
if [ ! -f "res/$VALUES/strings.xml" ]; then if grep -q "$PAT" res/values/common_rsrc.xml; then
:
elif [ ! -f "res/$VALUES/strings.xml" ]; then
echo "error: res/$VALUES/strings.xml not found" 1>&2 echo "error: res/$VALUES/strings.xml not found" 1>&2
elif ! grep -q "$PAT" res/$VALUES/strings.xml; then elif ! grep -q "$PAT" res/$VALUES/strings.xml; then
echo "<string name=\"$STRING\">$STRING</string>" echo "<string name=\"$STRING\">$STRING</string>"