From b8aa9fc0ce8d411be4451022e4b14d0f4238a9d9 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Tue, 30 Dec 2014 14:28:52 +0100 Subject: shell-no-trail-bslash: improve diagnostic in case of failure * t/ax/shell-no-trail-bslash.in: Here, by fixing a typo in a variable name and a logic error. * t/self-check-shell-no-trail-bslash.sh: Enhance to catch the issue. Signed-off-by: Stefano Lattarini --- t/ax/shell-no-trail-bslash.in | 19 ++++++++++++++----- t/self-check-shell-no-trail-bslash.sh | 8 +++++++- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/t/ax/shell-no-trail-bslash.in b/t/ax/shell-no-trail-bslash.in index 322495824..26979b617 100644 --- a/t/ax/shell-no-trail-bslash.in +++ b/t/ax/shell-no-trail-bslash.in @@ -26,6 +26,7 @@ am_SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'} ( set -e shell_command=; unset shell_command + shell_script=; unset shell_script while test $# -gt 0; do case $1 in # The shell might be invoked by make e.g. as "sh -ec" or "sh -ce". @@ -40,7 +41,8 @@ am_SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'} if test x${shell_command+"set"} != x"set"; then if test $# -gt 0; then - shell_command=$(cat "$1") + shell_script=$1 + shell_command=$(cat <"$shell_script") else # Some make implementations, like *BSD's, pass the recipes to the # shell through its standard input. Trying to run our extra checks @@ -48,6 +50,7 @@ am_SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'} exit 0 fi fi + original_shell_command=$shell_command tab=' ' nl=' @@ -59,10 +62,16 @@ am_SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'} case "$shell_command" in *\\) - printf '%s\n' "$0: recipe/script ends with backslash character" >&2 - printf '%s\n' "=== BEGIN recipe/script" >&2 - printf '%s\n' "${am_shell_command-}" >&2 - printf '%s\n' "=== END recipe/script" >&2 + { + printf '%s\n' "$0: recipe/script ends with backslash character" + printf '%s\n' "=== BEGIN recipe/script" + if test x${shell_script+"set"} = x"set"; then + cat <"$shell_script" + else + printf '%s\n' "$original_shell_command" + fi + printf '%s\n' "=== END recipe/script" + } >&2 exit 1 ;; esac diff --git a/t/self-check-shell-no-trail-bslash.sh b/t/self-check-shell-no-trail-bslash.sh index 19198898b..8b7afa5c5 100644 --- a/t/self-check-shell-no-trail-bslash.sh +++ b/t/self-check-shell-no-trail-bslash.sh @@ -58,11 +58,17 @@ for sfx in \ ; do for pfx in "" "echo bad" ": a${nl}# multine${nl}: text"; do cmd=${pfx}${sfx} - printf '%s\n' "$cmd" > bad.sh + printf '%s' "$cmd" > bad.sh for args in '-c "$cmd"' './bad.sh'; do eval "\$SHELL $args 2>stderr && { cat stderr >&2; exit 1; }; :" cat stderr >&2 $FGREP "recipe/script ends with backslash character" stderr + cmd="$cmd" $PERL -w -e ' + undef $/; + $_ = <>; + index($_, $ENV{cmd}) >= 0 or exit 1; + ' Date: Tue, 30 Dec 2014 15:20:00 +0100 Subject: NEWS: improve and adjust in light of the oncoming 1.15 release Signed-off-by: Stefano Lattarini --- NEWS | 63 ++++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/NEWS b/NEWS index 2649698ac..dcbf65716 100644 --- a/NEWS +++ b/NEWS @@ -97,16 +97,43 @@ New in 1.15: extra useless "make all" recursive invocation in some corner cases (automake bug#16302). -* Bugs fixed: +* Distribution: - - The expansion of AM_INIT_AUTOMAKE ends once again with a trailing - newline (bug#16841). Regression introduced in Automake 1.14. + - Automake bug#18286: "make distcheck" could sometimes fail to detect + missing files in the distribution tarball, especially in those cases + where both the generated files and their dependencies are explicitly + in $(srcdir). An important example of this are *generated* makefile + fragments included at Automake time in Makefile.am; e.g.: - - The user can now extend the special .PRECIOUS target, the same way - he could already do with the .MAKE .and .PHONY targets. + ... + $(srcdir)/fragment.am: $(srcdir)/data.txt $(srcdir)/preproc.sh + cd $(srcdir) && $(SHELL) preproc.sh fragment.am + include $(srcdir)/fragment.am + ... - - Fixed confusing typos in the manual and in some warning messages - (automake bug#16827 and bug#16997). + If the use forgot to add data.txt and/or preproc.sh in the distribution + tarball, "make distcheck" would have erroneously succeeded! This issue + is now fixed. + + - As a consequence of the previous change, "make distcheck" will run + using '$(distdir)/_build/sub' as the build directory, rather than + simply '$(distdir)/_build' (as it was with Automake 1.14 and earlier). + Consequently, the './configure' and 'make' invocations issued by the + distcheck recipe will have $(srcdir) equal to '../..', rather than to + just '..' (as it was with Automake 1.14 and earlier). Dependent and + similar variables (e.g., top_srcdir) are also changed accordingly. + + Thus, Makefiles that made assumptions about the exact values of the + build and source directories used by "make distcheck" will have to + be adjusted. Notice that making such assumptions was a bad and + unsupported practice anyway, since the exact locations of those + directories should be considered implementation details, and we + reserve the right to change them at any time. + +* Miscellaneous bugs fixed: + + - The expansion of AM_INIT_AUTOMAKE ends once again with a trailing + newline (bug#16841). Regression introduced in Automake 1.14. - We no longer risk to use '$ac_aux_dir' before it's defined (see automake bug#15981). Bug introduced in Automake 1.14. @@ -127,21 +154,11 @@ New in 1.15: something like "... overrides Automake target '$(srcdir)/foo.am". This bug is now fixed. - - Automake bug#18286: "make distcheck" could sometimes fail to detect - missing files in the distribution tarball, especially in those cases - where both the generated files and their dependencies are explicitly - in $(srcdir). An important example of this are *generated* makefile - fragments included at Automake time in Makefile.am; e.g.: - - ... - $(srcdir)/fragment.am: $(srcdir)/data.txt $(srcdir)/preproc.sh - cd $(srcdir) && $(SHELL) preproc.sh fragment.am - include $(srcdir)/fragment.am - ... + - The user can now extend the special .PRECIOUS target, the same way + he could already do with the .MAKE .and .PHONY targets. - If the use forgot to add data.txt and/or preproc.sh in the distribution - tarball, "make distcheck" would have erroneously succeeded! This issue - is now fixed. + - Fixed confusing typos in the manual and in some warning messages + (automake bug#16827 and bug#16997). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -249,8 +266,8 @@ New in 1.14: Now that we have the 'info-in-builddir' option that explicitly causes generated '.info' files to be placed in the builddir, this hack should - be longer necessary, so we deprecate it with runtime warnings. It will - likely be removed altogether in Automake 2.0. + be longer necessary, so we deprecate it with runtime warnings. + It will be removed altogether in Automake 2.0. * Relative directory in Makefile fragments: -- cgit v1.2.1 From 4cb0327adc1f085f4b9bacd0e6e1c2d7a88b92f6 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Tue, 30 Dec 2014 20:45:48 +0100 Subject: docs: "make distcheck" implementation details are not to be abused * doc/automake.texi: State explicitly and in detail that the exact location and the exact structure of the subdirectory used by "make distcheck" is to be considered an implementation detail, which can change at any time. Signed-off-by: Stefano Lattarini --- doc/automake.texi | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/automake.texi b/doc/automake.texi index fb6c05f1c..383a8116c 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -1242,8 +1242,12 @@ uninstall} do not omit any file (@pxref{Standard Targets}), and it checks that @code{DESTDIR} installations work (@pxref{DESTDIR}). @end itemize -All of these actions are performed in a temporary subdirectory, so -that no root privileges are required. +All of these actions are performed in a temporary directory, so that no +root privileges are required. Please note that the exact location and the +exact structure of such a subdirectory (where the extracted sources are +placed, how the temporary build and install directories are named and how +deeply they are nested, etc.) is to be considered an implementation detail, +which can change at any time; so do not rely on it. Releasing a package that fails @code{make distcheck} means that one of the scenarios we presented will not work and some users will be @@ -8555,6 +8559,13 @@ finally, makes another tarball to ensure the distribution is self-contained. @end itemize +All of these actions are performed in a temporary directory. Please +note that the exact location and the exact structure of such a directory +(where the read-only sources are placed, how the temporary build and +install directories are named and how deeply they are nested, etc.) is +to be considered an implementation detail, which can change at any time; +so do not reply on it. + @vindex AM_DISTCHECK_CONFIGURE_FLAGS @vindex DISTCHECK_CONFIGURE_FLAGS @subheading DISTCHECK_CONFIGURE_FLAGS -- cgit v1.2.1