ths-scripts/pocompare

34 行
1.1 KiB
Bash
可执行文件

#!/bin/bash -e
#
# Copyright 2007, Donatas Glodenis <dgvirtual@akl.lt>
#
# #
# # This script is free software; you can redistribute it and/or modify
# # it under the terms of the GNU General Public License 2 as published by
# # the Free Software Foundation.
#
# # This script is distributed in the hope that it will be useful,
# # but WITHOUT ANY WARRANTY; without even the implied warranty of
# # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# # GNU General Public License for more details.
# #
# # You should have received a copy of the GNU General Public License
# # along with this script; if not, write to the Free Software
# # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# ths-pocompare.sh - compare two translation files using diff, unwrapps first
# for best comparison.
if [ $# -ne 2 ]; then
echo "Usage $(basename "$0") <file1> <file2>"
exit 1
fi
file1=$1
file2=$2
msgmerge --no-wrap "$file1" "$file1" -o "${file1}.for.diff"
msgmerge --no-wrap "$file2" "$file2" -o "${file2}.for.diff"
diff "${file1}.for.diff" "${file2}.for.diff"
rm "${file1}.for.diff" "${file2}.for.diff"