From fe9033c3091f168e2b0a8625ee34d93073174c35 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 22 Nov 2007 08:42:32 +0100 Subject: Make it easier to diagnose PATH-induced "make distcheck" failures. * Makefile.maint (write_loser): Define. (my-distcheck): Use an always-failing wrapper script, that gives a diagnostic, not "false". Run only "make -C tests check" with the restrictive PATH. Run the new gnulib-tests/ with the usual PATH. --- ChangeLog | 7 +++++++ Makefile.maint | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b47da4b4..8affb8ebd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2007-11-22 Jim Meyering + Make it easier to diagnose PATH-induced "make distcheck" failures. + * Makefile.maint (write_loser): Define. + (my-distcheck): Use an always-failing wrapper script, that gives + a diagnostic, not "false". + Run only "make -C tests check" with the restrictive PATH. + Run the new gnulib-tests/ with the usual PATH. + cp: by default, refuse to copy through a dangling destination symlink * NEWS: Mention this change. * doc/coreutils.texi (cp invocation): Describe the new behavior. diff --git a/Makefile.maint b/Makefile.maint index 906d7295e..5671f292a 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -567,6 +567,8 @@ built_programs = $$(cd src && MAKEFLAGS= $(MAKE) -s built_programs.list) warn_cflags = -Dlint -O -Werror -Wall -Wformat -Wshadow -Wpointer-arith bin=bin-$$$$ +write_loser = printf '\#!%s\necho $$0: bad path 1>&2; exit 1\n' '$(SHELL)' + # Use -Wformat -Werror to detect format-string/arg-list mismatches. # Also, check for shadowing problems with -Wshadow, and for pointer # arithmetic problems with -Wpointer-arith. @@ -591,15 +593,18 @@ my-distcheck: $(local-check) $(release_archive_dir)/$(prev-tgz) AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \ && $(MAKE) dvi \ && mkdir $(bin) \ + && ($(write_loser)) > $(bin)/loser \ + && chmod a+x $(bin)/loser \ && for i in $(built_programs); do \ case $$i in \ rm|expr|basename|echo|sort|ls|tr);; \ mv|dirname);; \ - *) ln -s ../src/false $(bin)/$$i;; \ + *) ln $(bin)/loser $(bin)/$$i;; \ esac; \ done \ && ln -sf ../src/true $(bin)/false \ - && PATH=`pwd`/$(bin):$$PATH $(MAKE) check \ + && PATH=`pwd`/$(bin):$$PATH $(MAKE) -C tests check \ + && $(MAKE) -C gnulib-tests check \ && rm -rf $(bin) \ && $(MAKE) distclean (cd $(t) && mv $(distdir) $(distdir).old \ -- cgit v1.2.3-70-g09d2