The recently added gnome2_disable_deprecation_warning() unfortunately
triggered maintainer mode and undesirable autoreconf for some packages
like file-roller, leading to build failure (see bug #439602); the
problem had been caused by configure.ac having a higher mtime than
aclocal.m4 and config.h.in.

To prevent the bug, gnome2_disable_deprecation_warning() currently no
longer modifies configure.ac, but it would be desirable to bring back
that functionality. The patch below does so.

People who are well-versed in autotools internals, please review whether
this approach is sane and sufficient.

--- gnome2-utils.eclass 27 Oct 2012 22:24:10 -0000      1.31
+++ gnome2-utils.eclass 27 Oct 2012 22:29:20 -0000
@@ -435,13 +435,22 @@
        local makefile
 
        ebegin "Disabling deprecation warnings"
-       # The sort is important to ensure .am is listed before the respective 
.in for
-       # maintainer mode regeneration not kicking in due to .am being newer 
than .in
+       # The sort is important to ensure .am is listed before the respective 
.in,
+       # and configure.{ac,in} before Makefile.in, to prevent maintainer mode
+       # regeneration from kicking in due to .am being newer than .in
        while read makefile ; do
-               if ! grep -qE "(DISABLE_DEPRECATED|GSEAL_ENABLE)" 
"${makefile}"; then
-                       continue
-               fi
+               if [[ ${makefile%%aclocal.m4} != ${makefile} ||
+                     ${makefile%%config.h.in} != ${makefile} ]]; then
+                       # To avoid maintainer mode, aclocal.m4/config.h.in need 
to have
+                       # mtime after configure.ac and Makefile.am, but before 
configure
+                       # and Makefile.in
+                       debug-print "Touching ${makefile}"
+                       touch "${makefile}" && continue
+               elif ! grep -qE "(DISABLE_DEPRECATED|GSEAL_ENABLE)" 
"${makefile}"; then
+                       continue
+               fi
 
+               debug-print "Disabling deprecation warnings in ${makefile}"
                LC_ALL=C sed -r -i \
                        -e 's:-D[A-Z_]+_DISABLE_DEPRECATED:$(NULL):g' \
                        -e 's:-DGSEAL_ENABLE:$(NULL):g' \
@@ -452,12 +461,10 @@
                        fails+=( "${makefile}" )
                        retval=2
                fi
-       done < <(find "${S}" -name "Makefile.in" \
-               -o -name "Makefile.am" -o -name "Makefile.decl" \
-               | sort; echo configure)
-# TODO: sedding configure.ac can trigger maintainer mode; bug #439602
-#              -o -name "configure.ac" -o -name "configure.in" \
-#              | sort; echo configure)
+       done < <(find "${S}" -name "Makefile.am" -o -name "Makefile.decl" \
+               -o -name "configure.ac" -o -name "configure.in"; \
+               find "${S}" -name "aclocal.m4" -o -name "config.h.in"; \
+               find "${S}" -name "configure" -o -name "Makefile.in")
        eend ${retval}
 
        for makefile in "${fails[@]}" ; do


Reply via email to