Commit 7b46c372 authored by Matthias Andree's avatar Matthias Andree

dist-tools/ updates

- add copyright notice and license
- add a terse documentation as header
- add an option -n (dry-run) that only prints what would be done.
parent 4146f3c0
# dist-tools/
# A helper script to commit translation updates into Git.
# Assumes translation updates are visible to git,
# and one directory above.
# © Copyright 2019 by Matthias Andree.
# Licensed under the GNU General Public License V2 or,
# at your choice, any later version.
# Supported options:
# -n: dry-run, only print commands, but do not run them.
set -eu
# see if Perl has Carp::Always available:
cd "$(realpath $(dirname $0))/.."
# see if Perl has Carp::Always available,
# and implicitly fail (set -e) if it hasn't.
perl -MCarp::Always -e ''
while getopts 'n' opt ; do
case $opt in
n) dryrun_pfx=: ;;
?) printf 'Usage: %s [-n]\n' "$0" ;
exit 2 ;
git diff -G ^.Project-Id-Version --name-only po/*.po \
| while read pofile ; do
if ! cmd="$(perl -WT - "$pofile" <<'_EOF'
......@@ -39,5 +63,5 @@ _EOF
cmd="$cmd '$pofile'"
printf '+ %s\n' "$cmd"
eval "$cmd"
$dryrun_pfx eval "$cmd"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment