From: Bruno Haible Date: Mon, 11 Aug 2003 12:05:34 +0000 (+0000) Subject: Create a .diff file containing the local modifications. X-Git-Tag: v0.13~372 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12fd2799f66704c4e0465dfe3e7e5fedc2aba9a6;p=thirdparty%2Fgettext.git Create a .diff file containing the local modifications. --- diff --git a/gettext-tools/misc/ChangeLog b/gettext-tools/misc/ChangeLog index 909ce31aa..02b99f9fb 100644 --- a/gettext-tools/misc/ChangeLog +++ b/gettext-tools/misc/ChangeLog @@ -1,3 +1,9 @@ +2003-08-11 Bruno Haible + + * autopoint.in: When local files have been modified, create a .diff + file for the user's convenience. + Suggested by Denis Barbier . + 2003-08-07 Bruno Haible * autopoint.in: Fix the regular expression used to parse intl/VERSION. diff --git a/gettext-tools/misc/autopoint.in b/gettext-tools/misc/autopoint.in index 41bd208b4..ee9075c5e 100644 --- a/gettext-tools/misc/autopoint.in +++ b/gettext-tools/misc/autopoint.in @@ -375,6 +375,8 @@ func_destfile () # original - too great risk of version mismatch. if test -z "$force"; then mismatch= + mismatchfile="${TMPDIR-/tmp}"/autopoint$$.diff + rm -f "$mismatchfile" for file in `find "$work_dir/archive" -type f -print | sed -e "s,^$work_dir/archive/,," | LC_ALL=C sort`; do func_destfile "$file" if test -n "$destfile"; then @@ -382,15 +384,16 @@ if test -z "$force"; then if cmp -s "$work_dir/archive/$file" "$destfile"; then : else - echo "autopoint: File $destfile has been locally modified." + echo "autopoint: File $destfile has been locally modified." 1>&2 mismatch=yes + diff -c "$work_dir/archive/$file" "$destfile" | sed -e "1s,$work_dir/archive/,," >> "$mismatchfile" fi fi fi done if test -n "$mismatch"; then rm -rf "$cvs_dir" "$work_dir" - func_fatal_error "Some files have been locally modified. Not overwriting them because --force has not been specified." + func_fatal_error "Some files have been locally modified. Not overwriting them because --force has not been specified. For your convenience, you find the local modifications in the file '$mismatchfile'." fi fi