Imported Upstream version 16.3.1
[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 trap " [ -f \"$OLDTMP\" ] && /bin/rm -f -- \"$OLDTMP\" " 0 1 2 3 13 15
7 extract "$1" >"$OLDTMP"
8
9 NEWTMP=$(mktemp)
10 trap " [ -f \"$NEWTMP\" ] && /bin/rm -f -- \"$NEWTMP\" " 0 1 2 3 13 15
11 extract "$2" >"$NEWTMP"
12
13 shift 2 # additional args for diff
14 diff -u0 "$@" "$OLDTMP" "$NEWTMP"