Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / po / PotfileUpadte.sh
1 #! /bin/bash
2 set -e
3
4 function errexit() {
5   echo "$0: $@" >&2
6   exit 1
7 }
8
9 test -d "../.git" || errexit "Not a git repository"
10 test "$(git status --porcelain 2>/dev/null| grep '^[^ !?]' | wc -l)" == 0 || errexit "Index not clean: wont't commit"
11
12 BINDIR="${1}"
13 test -z "$BINDIR" && errexit "Missing argument: BINDIR"
14 test -d "$BINDIR" || errexit "Not a directory: BINDIR '$BINDIR'"
15 echo "Updating .pot .po files from $BINDIR..."
16 for F in *.pot *.po; do
17   if [ -f "$BINDIR/$F" ]; then
18     cp "$BINDIR/$F" .
19   else
20     errexit "Missing file $BINDIR/$F (touch CMakeLists.txt?)"
21   fi
22 done
23
24 git add -A *.pot *.po
25 git commit -m 'Translation: updated .pot file'