cryptonas-archive/v0.3.4.1/scripts/revert_unchanged_po_files.sh

16 lines
534 B
Bash
Raw Normal View History

#!/bin/sh
#
# run this script whenever you used update_po_files.sh to remove all changes of files.
# It reverts all po-files where just the POT-Creation-Date header line was changed (not new translations)
#
BASE_DIR=$(cd $(dirname "$0")/..; pwd)
cd "$BASE_DIR"
svn stat intl plugins | grep "\.po$" | cut -d " " -f 2- | while read po_file
do test -z "$(svn diff $po_file)" && continue
diff=$(svn diff "$po_file" | grep "^\+" | grep -v "^\+\{3\}" | grep -v "POT-Creation-Date")
test -z "$diff" && svn revert "$po_file"
done