txinfo-makeinfo-error-no-clobber.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #! /bin/sh
  2. # Copyright (C) 2003-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. # Make sure info files survive makeinfo errors.
  17. required=makeinfo
  18. . test-init.sh
  19. echo AC_OUTPUT >> configure.ac
  20. cat > Makefile.am << 'END'
  21. info_TEXINFOS = main.texi sub/main.texi
  22. END
  23. mkdir sub
  24. cat > main.texi << 'END'
  25. \input texinfo
  26. @setfilename main.info
  27. @settitle main
  28. @node Top
  29. Hello walls.
  30. @bye
  31. END
  32. cp main.texi sub/main.texi
  33. $ACLOCAL
  34. $AUTOMAKE --add-missing
  35. $AUTOCONF
  36. ./configure
  37. $MAKE
  38. # Feign more info files.
  39. : > main.info-1
  40. : > sub/main.info-1
  41. # Break main.texi.
  42. $sleep
  43. cp main.texi main.old
  44. cat > main.texi << 'END'
  45. \input texinfo
  46. @setfilename main.info
  47. @settitle main
  48. @node Top
  49. @unknown_macro{Hello walls.}
  50. @bye
  51. END
  52. # makeinfo will bail out, but we should conserve the old info files.
  53. $MAKE && exit 1
  54. test -f main.info
  55. test -f main.info-1
  56. # Restore main.texi, and break sub/main.texi.
  57. cp main.texi sub/main.texi
  58. mv main.old main.texi
  59. $MAKE && exit 1
  60. test -f main.info
  61. test ! -e main.info-1
  62. test -f sub/main.info
  63. test -f sub/main.info-1
  64. :