From a4c0c62d52ad7b9785005302ee88311974b28dde Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Mon, 24 Dec 2012 11:23:06 +0100 Subject: texinfo: remove hack about info files in CLEANFILES variables Automake used to implement an undocumented hack causing '.info' files that appeared to be cleaned (by e.g. being listed in the CLEANFILES variable) to also be built in the builddir rather than in the srcdir; this was for backward compatibility with packages such as Texinfo, which did things like: info_TEXINFOS = texinfo.txi info-stnd.texi info.texi DISTCLEANFILES = texinfo texinfo-* info*.info* # Do not create info files for distribution. dist-info: in order not to distribute .info files. Now that we have the 'info-in-builddir' option that explicitly causes generated '.info' files to be placed in the builddir, this hack is no longer necessary, and we can remove it (after having deprecated it in the Automake 1.14 release already). * bin/automake.in (handle_texinfo_helper): Remove the hack. Adjust comments accordingly. * NEWS: Update. * t/txinfo23.sh: Delete as obsolete. * t/txinfo25.sh: Likewise. * t/txinfo24.sh: Likewise. * t/txinfo28.sh: Delete as mostly obsolete, its only still relevant parts moved ... * t/mdate5.sh: ... into this test. * t/txinfo-clean.sh: Remove references to deleted tests. * t/list-of-tests.mk: Adjust. Signed-off-by: Stefano Lattarini --- NEWS | 22 +++++++++- bin/automake.in | 66 ++++++------------------------ t/list-of-tests.mk | 4 -- t/mdate5.sh | 51 ++++++++++++++--------- t/txinfo-clean.sh | 1 - t/txinfo23.sh | 69 ------------------------------- t/txinfo24.sh | 83 -------------------------------------- t/txinfo25.sh | 116 ----------------------------------------------------- t/txinfo28.sh | 89 ---------------------------------------- 9 files changed, 65 insertions(+), 436 deletions(-) delete mode 100644 t/txinfo23.sh delete mode 100644 t/txinfo24.sh delete mode 100644 t/txinfo25.sh delete mode 100644 t/txinfo28.sh diff --git a/NEWS b/NEWS index 3d8b363b9..bb011a882 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,26 @@ New in 2.0: and later will *unconditionally* behave as older Automake versions did when the 'subdir-objects' option was given. +* Texinfo support: + + - Automake used to implement an undocumented hack causing '.info' files + that appeared to be cleaned (by e.g. being listed in the CLEANFILES + variable) to also be built in the builddir rather than in the srcdir; + this was for backward compatibility with packages such as Texinfo, + which did things like: + + info_TEXINFOS = texinfo.txi info-stnd.texi info.texi + DISTCLEANFILES = texinfo texinfo-* info*.info* + # Do not create info files for distribution. + dist-info: + @: + + in order not to distribute .info files. + + Now that we have the 'info-in-builddir' option that explicitly causes + generated '.info' files to be placed in the builddir, this hack is no + longer necessary. We have thus removed\ it. + * Aclocal search path: - Third-party m4 files located in the system-wide aclocal directory, @@ -308,7 +328,7 @@ 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 removed altogether in Automake 2.0. * Relative directory in Makefile fragments: diff --git a/bin/automake.in b/bin/automake.in index c06fc0fa4..c6bf923a9 100644 --- a/bin/automake.in +++ b/bin/automake.in @@ -2948,15 +2948,6 @@ sub handle_texinfo_helper my $done = 0; my (@mostly_cleans, @texi_cleans, @maint_cleans) = ('', '', ''); - # Build a regex matching user-cleaned files. - my $d = var 'DISTCLEANFILES'; - my $c = var 'CLEANFILES'; - my @f = (); - push @f, $d->value_as_list_recursive (inner_expand => 1) if $d; - push @f, $c->value_as_list_recursive (inner_expand => 1) if $c; - @f = map { s|[^A-Za-z_0-9*\[\]\-]|\\$&|g; s|\*|[^/]*|g; $_; } @f; - my $user_cleaned_files = '^(?:' . join ('|', @f) . ')$'; - foreach my $texi ($info_texinfos->value_as_list_recursive (inner_expand => 1)) { @@ -2996,6 +2987,7 @@ sub handle_texinfo_helper # generic rules. my $outdir = dirname ($texi) . '/'; $outdir = "" if $outdir eq './'; + my $src_outdir = '$(srcdir)/'. $outdir; $out_file = $outdir . $out_file; # Until Automake 1.6.3, .info files were built in the @@ -3086,54 +3078,22 @@ sub handle_texinfo_helper # Consequently, starting with Automake 1.8, .info files are # built in the source tree again. Because we still plan to # support non-distributed .info files at some point, we - # have a single variable ($INSRC) that controls whether + # have a single variable ('$insrc') that controls whether # the current .info file must be built in the source tree # or in the build tree. Actually this variable is switched - # off in two cases: - # (1) For '.info' files that appear to be cleaned; this is for - # backward compatibility with package such as Texinfo, - # which do things like - # info_TEXINFOS = texinfo.txi info-stnd.texi info.texi - # DISTCLEANFILES = texinfo texinfo-* info*.info* - # # Do not create info files for distribution. - # dist-info: - # in order not to distribute .info files. - # (2) When the undocumented option 'info-in-builddir' is given. - # This is done to allow the developers of GCC, GDB, GNU - # binutils and the GNU bfd library to force the '.info' files - # to be generated in the builddir rather than the srcdir, as - # was once done when the (now removed) 'cygnus' option was - # given. See automake bug#11034 for more discussion. - my $insrc = 1; - my $soutdir = '$(srcdir)/' . $outdir; - - if (option 'info-in-builddir') - { - $insrc = 0; - } - elsif ($out_file =~ $user_cleaned_files) - { - $insrc = 0; - msg 'obsolete', "$am_file.am", < $texi, VTI => $vti, - STAMPVTI => "${soutdir}stamp-$vti", - VTEXI => "$soutdir$vtexi", + STAMPVTI => "${src_outdir}stamp-$vti", + VTEXI => "${src_outdir}$vtexi", MDDIR => $conf_dir, DIRSTAMP => $dirstamp); } diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 630417c47..85f58ad29 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -1220,10 +1220,6 @@ t/txinfo-vtexi2.sh \ t/txinfo-vtexi3.sh \ t/txinfo-vtexi4.sh \ t/txinfo-without-info-suffix.sh \ -t/txinfo23.sh \ -t/txinfo24.sh \ -t/txinfo25.sh \ -t/txinfo28.sh \ t/transform.sh \ t/transform2.sh \ t/transform3.sh \ diff --git a/t/mdate5.sh b/t/mdate5.sh index 89ee0c439..108569ea9 100644 --- a/t/mdate5.sh +++ b/t/mdate5.sh @@ -21,25 +21,36 @@ am_create_testdir=empty get_shell_script mdate-sh -set x $(./mdate-sh mdate-sh) -shift -echo "$*" # For debugging. - -# Check that mdate output looks like a date: -test $# = 3 -case $1$3 in *[!0-9]*) exit 1;; esac -test $1 -lt 32 -# Hopefully automake will be obsolete in 80 years ;-) -case $3 in 20[0-9][0-9]) :;; *) exit 1;; esac -case $2 in - January|February|March|April|May|June|July|August) ;; - September|October|November|December) ;; - *) exit 1 -esac - -# Stricter checks on the year required a POSIX date(1) command. -if year=$(date +%Y) && test $year -gt 2010; then - test $year = $3 || exit 1 -fi +year=$(date +%Y) && test $year -gt 2010 || year=NONE + +do_checks () +{ + set x $(./mdate-sh mdate-sh) + shift + echo "$*" # For debugging. + + # Check that mdate output looks like a date. + test $# = 3 || exit 1 + case $1$3 in *[!0-9]*) exit 1;; esac + test $1 -lt 32 || exit 1 + # Hopefully automake will be obsolete in 80 years ;-) + case $3 in 20[0-9][0-9]) :;; *) exit 1;; esac + case $2 in + January|February|March|April|May|June|July|August) ;; + September|October|November|December) ;; + *) exit 1 + esac + + # Stricter checks on the year require a POSIX date(1) command. + test $year = NONE || test $year = $3 || exit 1 +} + +TIME_STYLE=; unset TIME_STYLE +do_checks + +# This setting, when honored by GNU ls, used to cause an infinite +# loop in mdate-sh. +TIME_STYLE="+%Y-%m-%d %H:%M:%S"; export TIME_STYLE +do_checks : diff --git a/t/txinfo-clean.sh b/t/txinfo-clean.sh index b936e410e..f5e874565 100644 --- a/t/txinfo-clean.sh +++ b/t/txinfo-clean.sh @@ -15,7 +15,6 @@ # along with this program. If not, see . # DVIS, PDFS, PSS, HTMLS should not be cleaned upon 'mostlyclean'. -# Similar to txinfo25.sh. required='makeinfo tex texi2dvi dvips' . test-init.sh diff --git a/t/txinfo23.sh b/t/txinfo23.sh deleted file mode 100644 index e71fc5745..000000000 --- a/t/txinfo23.sh +++ /dev/null @@ -1,69 +0,0 @@ -#! /bin/sh -# Copyright (C) 2002-2014 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Check that info files are built in builddir when needed. -# Test with subdir Texinfo. -# (Similar to txinfo13.sh, plus DISTCLEANFILES). -# (See also txinfo24.sh and txinfo25.sh). - -required='makeinfo tex texi2dvi' -. test-init.sh - -cat >> configure.ac << 'END' -AC_OUTPUT -END - -cat > Makefile.am << 'END' -DISTCLEANFILES = subdir/*.info* -info_TEXINFOS = subdir/main.texi -subdir_main_TEXINFOS = subdir/inc.texi - -installcheck-local: - test -f "$(infodir)/main.info" -END - -mkdir subdir - -cat > subdir/main.texi << 'END' -\input texinfo -@setfilename main.info -@settitle main -@node Top -Hello walls. -@include version.texi -@include inc.texi -@bye -END - -cat > subdir/inc.texi << 'END' -I'm included. -END - -$ACLOCAL -$AUTOCONF - -AUTOMAKE_run --add-missing -Wno-error -grep "Makefile\.am:.*undocumented.* automake hack" stderr -grep "Makefile\.am:.*'info-in-builddir' automake option" stderr - -mkdir build -cd build -../configure -$MAKE distcheck -test -f subdir/main.info -test ! -e ../subdir/main.info - -: diff --git a/t/txinfo24.sh b/t/txinfo24.sh deleted file mode 100644 index df202a8fa..000000000 --- a/t/txinfo24.sh +++ /dev/null @@ -1,83 +0,0 @@ -#! /bin/sh -# Copyright (C) 2002-2014 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Check that info files are built in builddir when needed. -# (Similar to txinfo16.sh, plus CLEANFILES). -# (See also txinfo23.sh and txinfo25.sh). - -required='makeinfo tex texi2dvi' -. test-init.sh - -cat >> configure.ac << 'END' -AC_OUTPUT -END - -cat > Makefile.am << 'END' -CLEANFILES = main.info -info_TEXINFOS = main.texi -END - -cat > main.texi << 'END' -\input texinfo -@setfilename main.info -@settitle main -@node Top -Hello walls. -@include version.texi -@bye -END - -$ACLOCAL -$AUTOMAKE --add-missing -Wno-obsolete -$AUTOCONF - -mkdir build -cd build -../configure -$MAKE -test ! -e ../main.info -test -f main.info - -cd .. -rm -rf build -./configure -$MAKE -test -f main.info - -# Make sure stamp-vti is older that version.texi. -# (A common situation in a real tree). -test -f stamp-vti -test -f version.texi -$sleep -touch stamp-vti - -$MAKE distclean -test -f stamp-vti -test -f version.texi - -mkdir build -cd build -../configure -$MAKE -# main.info should be rebuilt in the current directory. -test -f main.info -test ! -e ../main.info -$MAKE dvi -test -f main.dvi - -$MAKE distcheck - -: diff --git a/t/txinfo25.sh b/t/txinfo25.sh deleted file mode 100644 index 8d7f12748..000000000 --- a/t/txinfo25.sh +++ /dev/null @@ -1,116 +0,0 @@ -#! /bin/sh -# Copyright (C) 2003-2014 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Check that info files are built in builddir and in srcdir can safely -# co-exist. This setup is obtained by having two info files, only one -# of which being cleaned. -# (Similar to txinfo16.sh, plus CLEANFILES). -# (See also txinfo23.sh and txinfo24.sh). - -required='makeinfo tex texi2dvi' -. test-init.sh - -cat >> configure.ac << 'END' -AC_OUTPUT -END - -cat > Makefile.am << 'END' -CLEANFILES = [a-m]*.info -info_TEXINFOS = main.texi other.texi -END - -cat > main.texi << 'END' -\input texinfo -@setfilename main.info -@settitle main -@node Top -Hello walls. -@include version.texi -@bye -END - -cat > other.texi << 'END' -\input texinfo -@setfilename other.info -@settitle other -@node Top -Hello walls. -@include version2.texi -@bye -END - -$ACLOCAL -$AUTOCONF - -AUTOMAKE_fails --add-missing -grep "Makefile\.am:.*undocumented.* automake hack" stderr -grep "Makefile\.am:.*'info-in-builddir' automake option" stderr - -$AUTOMAKE --add-missing -Wno-obsolete - -mkdir build -cd build -../configure -$MAKE -test -f main.info -test ! -e ../main.info -test ! -e other.info -test -f ../other.info - -cd .. -rm -rf build -./configure -$MAKE -test -f main.info -test -f other.info - -# Make sure stamp-vti is older that version.texi. -# (A common situation in a real tree). -# This is needed to test the "subtle" issue described below. -test -f stamp-vti -test -f version.texi -test -f stamp-1 -test -f version2.texi -$sleep -touch stamp-vti -touch stamp-1 - -$MAKE distclean -test -f stamp-vti -test -f stamp-1 -test -f version.texi -test -f version2.texi - -mkdir build -cd build -../configure -$MAKE -# other.info should not be rebuilt in the current directory, since -# it's up-to-date in $(srcdir). -# This can be caused by a subtle issue related to VPATH handling -# of version.texi (see also the comment in texi-vers.am): because -# stamp-vti is newer than version.texi, the 'version.texi: stamp-vti' -# rule is always triggered. Still that's not a reason for 'make' -# to think 'version.texi' has been created... -test -f main.info -test ! -e other.info -$MAKE dvi -test -f main.dvi -test -f other.dvi - -$MAKE distcheck - -: diff --git a/t/txinfo28.sh b/t/txinfo28.sh deleted file mode 100644 index 93929c3e3..000000000 --- a/t/txinfo28.sh +++ /dev/null @@ -1,89 +0,0 @@ -#! /bin/sh -# Copyright (C) 2002-2014 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Check that info files are built in builddir when needed. -# Similar to txinfo24.sh, but obfuscating filenames with variable -# references. -# Report from Ralf Corsepius. - -required='makeinfo tex texi2dvi' -. test-init.sh - -# This setting, when honored by GNU ls, used to cause an infinite loop -# in mdate-sh. -TIME_STYLE="+%Y-%m-%d %H:%M:%S" -export TIME_STYLE - -echo AC_OUTPUT >> configure.ac - -cat > Makefile.am << 'END' -MA = ma -IN = in -PROJ = $(MA)$(IN) -include fragment.mk -info_TEXINFOS = ma$(IN).texi -END - -echo 'CLEANFILES = $(PROJ).info' > fragment.mk - -cat > main.texi << 'END' -\input texinfo -@setfilename main.info -@settitle main -@node Top -Hello walls. -@include version.texi -@bye -END - -$ACLOCAL -$AUTOMAKE --add-missing -Wno-error -$AUTOCONF - -mkdir build -cd build -../configure -$MAKE -test -f main.info - -cd .. -rm -rf build -./configure -$MAKE -test -f main.info - -# Make sure stamp-vti is older that version.texi. -# (A common situation in a real tree). -test -f stamp-vti -test -f version.texi -$sleep -touch stamp-vti - -$MAKE distclean -test -f stamp-vti -test -f version.texi - -mkdir build -cd build -../configure -$MAKE -# main.info should be rebuilt in the current directory. -test -f main.info -test ! -e ../main.info -$MAKE dvi -test -f main.dvi - -$MAKE distcheck -- cgit v1.2.1 From 0fae5905f9b676725a7e82c7aa03e8e3cbf5008a Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Sun, 28 Dec 2014 14:02:30 +0100 Subject: tests: make script 'shell-no-trail-bslash' simpler and more robust This solves spurious failure in the 'check-no-trailing-backslash-in-recipes' target for Automake-NG. This is basically a backport of Automake-NG commit v1.14.1-1010-g85aae58; the point is to minimize the amount of spurious diffs between the mainline Automake and the Automake-NG source trees. * t/ax/shell-no-trail-bslash.in: Simplify and fortify. * t/self-check-shell-no-trail-bslash.sh: Enhance. Signed-off-by: Stefano Lattarini --- t/ax/shell-no-trail-bslash.in | 102 +++++++++++++++++----------------- t/self-check-shell-no-trail-bslash.sh | 34 +++++++++++- 2 files changed, 83 insertions(+), 53 deletions(-) diff --git a/t/ax/shell-no-trail-bslash.in b/t/ax/shell-no-trail-bslash.in index f785de8a8..322495824 100644 --- a/t/ax/shell-no-trail-bslash.in +++ b/t/ax/shell-no-trail-bslash.in @@ -1,5 +1,5 @@ #! @AM_TEST_RUNNER_SHELL@ -# Copyright (C) 2012-2013 Free Software Foundation, Inc. +# Copyright (C) 2012-2014 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,63 +14,63 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# A "shell" that chokes on '-c' commands having a trailing '\' character -# (possibly followed by whitespace only). This is to emulate problems -# seen in older bash versions (e.g., bash 2.05b). -# See also automake bug#10436. +# A "shell" that chokes on '-c' commands and/or shell scripts having +# a trailing '\' character (possibly followed by whitespace only). +# This is to emulate problems seen in older bash versions (e.g., bash +# 2.05b). See also automake bug#10436. -set -e set -u am_SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'} -tab=' ' -nl=' +( + set -e + shell_command=; unset shell_command + while test $# -gt 0; do + case $1 in + # The shell might be invoked by make e.g. as "sh -ec" or "sh -ce". + # Be liberal (in the spirit of defensive programming) and accept + # both forms. + -*c*) shell_command=$2; shift;; + -?*) ;; + *) break;; + esac + shift + done + + if test x${shell_command+"set"} != x"set"; then + if test $# -gt 0; then + shell_command=$(cat "$1") + else + # Some make implementations, like *BSD's, pass the recipes to the + # shell through its standard input. Trying to run our extra checks + # in this case would be too tricky, so we just skip them. + exit 0 + fi + fi + + tab=' ' + nl=' ' -am_shell_flags= -am_shell_command=; unset am_shell_command -while test $# -gt 0; do - case $1 in - # If the shell is invoked by make e.g. as "sh -ec" (seen on - # GNU make in POSIX mode) or "sh -ce" (seen on Solaris make). - -*c*) - am_flg=$(printf '%s\n' "$1" | sed -e 's/^-//' -e 's/c//g') - if test x"$am_flg" != x; then - am_shell_flags="$am_shell_flags -$am_flg" - fi - am_shell_command=$2 - shift;; - -?*) - am_shell_flags="$am_shell_flags $1";; - *) - break;; + case "$shell_command" in + *" "|*"$tab"|*"$nl") + shell_command=$(printf '%s\n' "$shell_command" | tr -d " $tab$nl");; esac - shift -done - -if test x${am_shell_command+"set"} != x"set"; then - # Some make implementations, like *BSD's, pass the recipes to the shell - # through its standard input. Trying to run our extra checks in this - # case would be too tricky, so we just skip them. - exec $am_SHELL $am_shell_flags ${1+"$@"} -fi -case $am_shell_command in - *" "|*"$tab"|*"$nl") - am_tweaked_shell_command=$(printf '%s\n' "$am_shell_command" \ - | tr -d " $tab$nl");; - *) - am_tweaked_shell_command=$am_shell_command;; -esac + 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 + exit 1 + ;; + esac +) -case $am_tweaked_shell_command in - *\\) - printf '%s\n' "$0: recipe ends with backslash character" >&2 - printf '%s\n' "=== BEGIN recipe" >&2 - printf '%s\n' "${am_shell_command-}" >&2 - printf '%s\n' "=== END recipe" >&2 - exit 1 - ;; -esac +if test $? -gt 0; then + # Some of our scripts or makefile recipes had invalid contents. + exit 3 +fi -exec $am_SHELL $am_shell_flags -c "$am_shell_command" ${1+"$@"} +exec ${AM_TESTSUITE_SHELL-'@SHELL@'} ${1+"$@"} diff --git a/t/self-check-shell-no-trail-bslash.sh b/t/self-check-shell-no-trail-bslash.sh index 14ee02cdf..19198898b 100644 --- a/t/self-check-shell-no-trail-bslash.sh +++ b/t/self-check-shell-no-trail-bslash.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2012-2013 Free Software Foundation, Inc. +# Copyright (C) 2012-2014 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -34,12 +34,42 @@ bad: END SHELL=$am_testaux_builddir/shell-no-trail-bslash + $SHELL -c 'exit 0' test "$($SHELL -c 'echo is o\k')" = "is ok" +echo 'echo is ok\"' > ok.sh +$SHELL ./ok.sh +test "$($SHELL ./ok.sh)" = "is ok\"" + +tab=' ' +nl=' +' +for sfx in \ + '\' \ + '\\' \ + '\\\\\' \ + '\ ' \ + "\\$tab" \ + "\\ $tab$tab " \ + "\\$nl" \ + "\\ $nl " \ + "\\$nl$nl$nl" \ +; do + for pfx in "" "echo bad" ": a${nl}# multine${nl}: text"; do + cmd=${pfx}${sfx} + printf '%s\n' "$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 + done + done +done + $MAKE good run_make -E -e FAIL bad SHELL="$SHELL" -$FGREP "recipe ends with backslash character" stderr +$FGREP "recipe/script ends with backslash character" stderr : -- cgit v1.2.1