2
0

distcheck-pr9579.sh 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #! /bin/sh
  2. # Copyright (C) 2011-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 against automake bug#9579: distcheck does not always detect
  17. # incomplete uninstall as advertised.
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. AC_OUTPUT
  21. END
  22. # NOTE: the use of 'dir' as the name of the data file installed by hand
  23. # is deliberate, and enhances coverage -- see definition and comments of
  24. # lib/am/distdir.am:$(am__distuninstallcheck_listfiles).
  25. cat > Makefile.am << 'END'
  26. dist_data_DATA = foo
  27. EXTRA_DIST = dir
  28. install-data-local:
  29. $(MKDIR_P) '$(DESTDIR)$(datadir)'
  30. cp '$(srcdir)/dir' '$(DESTDIR)$(datadir)/dir'
  31. END
  32. : > foo
  33. : > dir
  34. $ACLOCAL
  35. $AUTOMAKE
  36. $AUTOCONF
  37. ./configure --prefix="$(pwd)/inst"
  38. # Sanity checks.
  39. $MAKE install
  40. find inst -type f
  41. test -f inst/share/foo
  42. test -f inst/share/dir
  43. # We expect the uninstall target of our Makefile to be definitely broken.
  44. $MAKE uninstall
  45. test -f inst/share/dir
  46. rm -rf inst
  47. run_make -M -e FAIL distcheck
  48. $FGREP 'ERROR: files left after uninstall:' output
  49. grep '/share/dir *$' output
  50. # A few trickier corner cases.
  51. cat > Makefile.am << 'END'
  52. EXTRA_DIST = dir
  53. install-data-local:
  54. install-data-local:
  55. $(MKDIR_P) '$(DESTDIR)$(prefix)/mu/share/info'
  56. cp '$(srcdir)/dir' '$(DESTDIR)$(prefix)/mu/share/info'
  57. $(MKDIR_P) '$(DESTDIR)$(infodir)/more'
  58. cp '$(srcdir)/dir' '$(DESTDIR)$(infodir)/more'
  59. END
  60. $AUTOMAKE
  61. ./config.status Makefile
  62. # Sanity checks, again.
  63. $MAKE install
  64. find inst -type f
  65. test -f inst/mu/share/info/dir
  66. test -f inst/share/info/more/dir
  67. # We expect the uninstall target of our Makefile to be definitely broken.
  68. $MAKE uninstall
  69. test -f inst/mu/share/info/dir
  70. test -f inst/share/info/more/dir
  71. rm -rf inst
  72. run_make -M -e FAIL distcheck
  73. $FGREP 'ERROR: files left after uninstall:' output
  74. grep '/mu/share/info/dir *$' output
  75. grep '/share/info/more/dir *$' output
  76. :