2
0

distlinksbrk.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #! /bin/sh
  2. # Copyright (C) 2010-2017 Free Software Foundation, Inc.
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. # Check that distributed broken symlinks cause 'make dist' to fail, and
  17. # to do so with (mostly) meaningful diagnostic.
  18. . test-init.sh
  19. # We need, for our broken symlinks, names that make it hard to get false
  20. # positives when grepping make output to look for them.
  21. lnk_base=BrknSymlnk
  22. lnk1=${lnk_base}__001
  23. lnk2=${lnk_base}__002
  24. lnka=${lnk_base}__aaa
  25. lnkb=${lnk_base}__bbb
  26. ln -s nonesuch $lnk1 || skip_ "cannot create broken symlinks"
  27. ln -s "$(pwd)/nonesuch" $lnk2
  28. ln -s $lnk1 $lnka
  29. ln -s $lnka $lnkb
  30. # Sanity checks.
  31. test ! -e $lnk1
  32. test ! -e $lnk2
  33. test ! -e $lnka
  34. test ! -e $lnkb
  35. test -h $lnk1
  36. test -h $lnk2
  37. test -h $lnka
  38. test -h $lnkb
  39. cat >> configure.ac <<'END'
  40. AC_OUTPUT
  41. END
  42. $ACLOCAL
  43. $AUTOCONF
  44. ls -l # For debugging.
  45. # Don't try to use "make -k", because some botched make implementations
  46. # (HP-UX, IRIX) might still exit on the first error in this situations.
  47. for lnk in $lnk1 $lnk2 $lnka $lnkb; do
  48. echo "EXTRA_DIST = $lnk" > Makefile.am
  49. $AUTOMAKE
  50. ./configure
  51. # Distribution must fail, with a decent error message.
  52. run_make -M -e FAIL distdir
  53. $FGREP $lnk output
  54. done
  55. :