Index: gettext-tools/misc/autopoint.in =================================================================== RCS file: /sources/gettext/gettext/gettext-tools/misc/autopoint.in,v retrieving revision 1.40 diff -p -u -r1.40 autopoint.in --- gettext-tools/misc/autopoint.in 7 Dec 2008 16:20:56 -0000 1.40 +++ gettext-tools/misc/autopoint.in 17 Mar 2009 02:06:23 -0000 @@ -352,6 +352,7 @@ fi # Check in which directory the *.m4 macros belong. m4dir=m4 +all_m4dirs= if test -f Makefile.am; then # A package using automake. # Extract the macro directory name from Makefile.am. @@ -359,8 +360,11 @@ if test -f Makefile.am; then m4dir_is_next= for arg in $aclocal_amflags; do if test -n "$m4dir_is_next"; then - m4dir="$arg" - break + if [ -z "$m4dir" ]; then + m4dir="$arg" + fi + all_m4dirs="$all_m4dirs $arg" + m4dir_is_next= else if test "X$arg" = "X-I"; then m4dir_is_next=yes @@ -505,6 +509,30 @@ func_compare () fi } +# func_compare_all gettextfile +# searches for all files in the package with the same name as gettextfile, +# and runs func_compare on each. Returns 0 if the file from gettext can be +# used, or 1 if it should be skipped. +func_compare_all () +{ + case "$1" in + *.m4) + base=`echo "$1" | sed -e 's,.*/,,'` + for dir in $all_m4dirs; do + if test -f "$dir/$base"; then + if ! func_compare "$dir/$base" "$1"; then + return 1 + fi + fi + done + true + ;; + *) + true + ;; + esac +} + # If some files have been locally modified and we have not been requested # to overwrite them, then bail out. This is better than leaving a source # package around where half of the files are locally modified and half are @@ -514,10 +542,10 @@ if test -z "$force"; then func_tmpdir mismatchfile="$tmp"/autopoint.diff 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 - if test -f "$destfile"; then - if func_compare "$destfile" "$work_dir/archive/$file"; then + if func_compare_all "$work_dir/archive/$file"; then + func_destfile "$file" + if test -n "$destfile"; then + if test -f "$destfile"; then if test -n "$sharedowner"; then echo "autopoint: warning: File $destfile has been locally modified." 1>&2 else @@ -581,11 +609,11 @@ func_backup () # Now copy the files. for file in `find "$work_dir/archive" -type f -print | sed -e "s,^$work_dir/archive/,," | LC_ALL=C sort`; do - func_destfile "$file" mustcopy= - if test -n "$destfile"; then - if test -f "$destfile"; then - if func_compare "$destfile" "$work_dir/archive/$file"; then + if func_compare_all "$work_dir/archive/$file"; then + func_destfile "$file" + if test -n "$destfile"; then + if test -f "$destfile"; then if test -n "$force"; then # Overwrite locally modified file. mustcopy=yes