Imported Upstream version 17.4.0
[platform/upstream/libzypp.git] / po / PotfileDiff.sh
1 #! /bin/bash
2 set -e
3 function extract() { grep '^\(msgid\|"\)' "$1" | grep -v "POT-Creation-Date" | sort -u; }
4
5 OLDTMP=$(mktemp)
6 NEWTMP=$(mktemp)
7 trap "/bin/rm -f -- \"$OLDTMP\" \"$NEWTMP\"" 0 1 2 3 13 15
8
9 extract "$1" >"$OLDTMP"
10 extract "$2" >"$NEWTMP"
11
12 shift 2 # additional args for diff
13 diff -u0 "$@" "$OLDTMP" "$NEWTMP"