sanitize-bison.patch 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. Author: Andreas Beckmann <anbe@debian.org>
  2. Description: sanitize bison usage
  3. use
  4. %define api.prefix {...}
  5. instead of crude
  6. sed -e 's/[yY][yY]/.../g'
  7. Thanks to Akim Demaille for the hint! (#960608)
  8. --- a/codegen/gram.y
  9. +++ b/codegen/gram.y
  10. @@ -17,6 +17,8 @@
  11. * with this program. If not, see <http://www.gnu.org/licenses/>.
  12. */
  13. +%define api.prefix {gram_}
  14. +
  15. %{
  16. #include <libexplain/ac/stdio.h>
  17. --- a/libexplain/acl_grammar.y
  18. +++ b/libexplain/acl_grammar.y
  19. @@ -17,6 +17,8 @@
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. */
  22. +%define api.prefix {acl_grammar_}
  23. +
  24. %{
  25. #include <libexplain/ac/ctype.h>
  26. --- a/libexplain/parse_bits.y
  27. +++ b/libexplain/parse_bits.y
  28. @@ -17,6 +17,8 @@
  29. along with this program. If not, see <http://www.gnu.org/licenses/>.
  30. */
  31. +%define api.prefix {parse_bits_}
  32. +
  33. %{
  34. #include <libexplain/ac/ctype.h>
  35. --- a/libexplain/printf_format.y
  36. +++ b/libexplain/printf_format.y
  37. @@ -17,6 +17,8 @@
  38. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  39. */
  40. +%define api.prefix {printf_format_}
  41. +
  42. %{
  43. #include <libexplain/ac/assert.h>
  44. --- a/Makefile.in
  45. +++ b/Makefile.in
  46. @@ -357,9 +357,9 @@ codegen/get_user_name.$(OBJEXT) codegen/
  47. codegen/gram.yacc.c codegen/gram.yacc.h: codegen/gram.y
  48. $(YACC) -d $(YFLAGS) codegen/gram.y
  49. - sed -e 's/[yY][yY]/gram_/g' -e '/<stdio.h>/d' -e '/<stdlib.h>/d' -e \
  50. + sed -e '/<stdio.h>/d' -e '/<stdlib.h>/d' -e \
  51. '/<stddef.h>/d' y.tab.c > codegen/gram.yacc.c
  52. - sed -e 's/[yY][yY]/gram_/g' -e 's/Y_TAB_H/codegen_gram_YACC_H/g' \
  53. + sed -e '' \
  54. y.tab.h > codegen/gram.yacc.h
  55. test -f y.output && mv y.output codegen/gram.output || true
  56. rm -f y.tab.c y.tab.h y.output || true
  57. @@ -4016,11 +4016,10 @@ libexplain/acl_get_file_or_die.$(OBJEXT)
  58. libexplain/acl_grammar.yacc.c libexplain/acl_grammar.yacc.h: \
  59. libexplain/acl_grammar.y
  60. $(YACC) -d $(YFLAGS) libexplain/acl_grammar.y
  61. - sed -e 's/[yY][yY]/acl_grammar_/g' -e '/<stdio.h>/d' -e \
  62. + sed -e '/<stdio.h>/d' -e \
  63. '/<stdlib.h>/d' -e '/<stddef.h>/d' y.tab.c > \
  64. libexplain/acl_grammar.yacc.c
  65. - sed -e 's/[yY][yY]/acl_grammar_/g' -e \
  66. - 's/Y_TAB_H/libexplain_acl_grammar_YACC_H/g' y.tab.h > \
  67. + sed -e '' y.tab.h > \
  68. libexplain/acl_grammar.yacc.h
  69. test -f y.output && mv y.output libexplain/acl_grammar.output || true
  70. rm -f y.tab.c y.tab.h y.output || true
  71. @@ -31058,10 +31057,9 @@ libexplain/output/warning.$(OBJEXT) libe
  72. libexplain/parse_bits.yacc.c libexplain/parse_bits.yacc.h: \
  73. libexplain/parse_bits.y
  74. $(YACC) -d $(YFLAGS) libexplain/parse_bits.y
  75. - sed -e 's/[yY][yY]/parse_bits_/g' -e '/<stdio.h>/d' -e '/<stdlib.h>/d' \
  76. + sed -e '/<stdio.h>/d' -e '/<stdlib.h>/d' \
  77. -e '/<stddef.h>/d' y.tab.c > libexplain/parse_bits.yacc.c
  78. - sed -e 's/[yY][yY]/parse_bits_/g' -e \
  79. - 's/Y_TAB_H/libexplain_parse_bits_YACC_H/g' y.tab.h > \
  80. + sed -e '' y.tab.h > \
  81. libexplain/parse_bits.yacc.h
  82. test -f y.output && mv y.output libexplain/parse_bits.output || true
  83. rm -f y.tab.c y.tab.h y.output || true
  84. @@ -31418,11 +31416,10 @@ $(includedir)/libexplain/printf.h: .mkdi
  85. libexplain/printf_format.yacc.c libexplain/printf_format.yacc.h: \
  86. libexplain/printf_format.y
  87. $(YACC) -d $(YFLAGS) libexplain/printf_format.y
  88. - sed -e 's/[yY][yY]/printf_format_/g' -e '/<stdio.h>/d' -e \
  89. + sed -e '/<stdio.h>/d' -e \
  90. '/<stdlib.h>/d' -e '/<stddef.h>/d' y.tab.c > \
  91. libexplain/printf_format.yacc.c
  92. - sed -e 's/[yY][yY]/printf_format_/g' -e \
  93. - 's/Y_TAB_H/libexplain_printf_format_YACC_H/g' y.tab.h > \
  94. + sed -e '' y.tab.h > \
  95. libexplain/printf_format.yacc.h
  96. test -f y.output && mv y.output libexplain/printf_format.output || true
  97. rm -f y.tab.c y.tab.h y.output || true