From: Bruno Haible Date: Mon, 7 Mar 2005 19:57:48 +0000 (+0000) Subject: A locally modified 'mkinstalldirs' is not an error. X-Git-Tag: v0.14.3~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05c34b271118503232efa4044dae702b12f0cb73;p=thirdparty%2Fgettext.git A locally modified 'mkinstalldirs' is not an error. --- diff --git a/gettext-tools/misc/ChangeLog b/gettext-tools/misc/ChangeLog index ab3dd7c96..4cacb10cf 100644 --- a/gettext-tools/misc/ChangeLog +++ b/gettext-tools/misc/ChangeLog @@ -1,3 +1,9 @@ +2005-03-06 Bruno Haible + + * autopoint.in (func_destfile): Also set a variable 'sharedowner'. + For files with shared ownership, treat local modification as a warning. + Suggested by Alexandre Duret-Lutz . + 2005-03-05 Bruno Haible * gettextize.in: When a po/POTFILES.in does not exist, create an diff --git a/gettext-tools/misc/autopoint.in b/gettext-tools/misc/autopoint.in index caacc51ad..691d21ed5 100644 --- a/gettext-tools/misc/autopoint.in +++ b/gettext-tools/misc/autopoint.in @@ -416,9 +416,11 @@ cd .. # func_destfile file # determines the destination file, relative to the package's top level # directory, for a given file name, relative to archive. -# Sets variable +# Sets variables # - destfile relative destination file name, or # empty if the file shall be omitted +# - sharedowner yes if the file is not only owned by GNU gettext but may +# be installed by automake or other tools, otherwise empty func_destfile () { # There are five categories of files: @@ -427,10 +429,12 @@ func_destfile () # m4/* -> $m4dir/ # intl/* -> intl/ # po/* -> po/ + sharedowner= case `echo "$1" | sed -e 's,[^/]*$,,'` in "" ) case "$1" in - config.rpath | mkinstalldirs ) destfile="$auxdir$1" ;; + config.rpath ) destfile="$auxdir$1" ;; + mkinstalldirs ) destfile="$auxdir$1" sharedowner=yes ;; * ) destfile="$1" ;; esac ;; @@ -455,9 +459,13 @@ if test -z "$force"; then if cmp -s "$work_dir/archive/$file" "$destfile"; then : else - 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" + if test -n "$sharedowner"; then + echo "autopoint: warning: File $destfile has been locally modified." 1>&2 + else + 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 fi @@ -521,8 +529,12 @@ for file in `find "$work_dir/archive" -type f -print | sed -e "s,^$work_dir/arch if cmp -s "$work_dir/archive/$file" "$destfile"; then : else - # Overwrite locally modified file. - mustcopy=yes + if test -n "$force"; then + # Overwrite locally modified file. + mustcopy=yes + fi + # If --force is not specified, don't overwrite locally modified files + # for which GNU gettext is a shared owner. fi else mustcopy=yes