autoconf-2.69-bash-5-LINENO.patch 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. From 4c1f7a361f4fd6180b7b46b950e3bfe389b5b831 Mon Sep 17 00:00:00 2001
  2. From: Ondrej Dubaj <odubaj@redhat.com>
  3. Date: Wed, 28 Aug 2019 07:39:50 +0200
  4. Subject: [PATCH] Port tests to Bash 5
  5. * tests/local.at (AT_CHECK_ENV, AT_CONFIG_CMP):
  6. Add BASH_ARGC, BASH_ARGV to list of variables to be ignored when
  7. comparing variable space dumps.
  8. (AT_CONFIG_CMP): Also ignore LINENO.
  9. * tests/m4sh.at: Also unset LINENO in 'reference' and 'test/test-1'.
  10. ---
  11. tests/local.at | 5 ++++-
  12. tests/m4sh.at | 4 ++--
  13. 2 files changed, 6 insertions(+), 3 deletions(-)
  14. diff --git a/tests/local.at b/tests/local.at
  15. index 40b7318..f3ad2b5 100644
  16. --- a/tests/local.at
  17. +++ b/tests/local.at
  18. @@ -324,7 +324,7 @@ if test -f state-env.before && test -f state-env.after; then
  19. [AWK|LEX|LEXLIB|LEX_OUTPUT_ROOT|LN_S|M4|MKDIR_P|RANLIB|SET_MAKE|YACC],
  20. [GREP|[EF]GREP|SED],
  21. [[_@]|.[*#?$].],
  22. - [argv|ARGC|LINENO|OLDPWD|PIPESTATUS|RANDOM|SECONDS]))=' \
  23. + [argv|ARGC|LINENO|BASH_ARGC|BASH_ARGV|OLDPWD|PIPESTATUS|RANDOM|SECONDS]))=' \
  24. $act_file ||
  25. test $? -eq 1 || echo failed >&2
  26. ) 2>stderr-$act_file |
  27. @@ -381,6 +381,9 @@ do
  28. /'\'\\\$\''=/ d
  29. /^argv=/ d
  30. /^ARGC=/ d
  31. + /^BASH_ARGC=/ d
  32. + /^BASH_ARGV=/ d
  33. + /^LINENO=/ d
  34. ' $act_file >at_config_vars-$act_file
  35. done
  36. AT_CMP([at_config_vars-$1], [at_config_vars-$2])[]dnl
  37. diff --git a/tests/m4sh.at b/tests/m4sh.at
  38. index 4e4da5d..80684ca 100644
  39. --- a/tests/m4sh.at
  40. +++ b/tests/m4sh.at
  41. @@ -254,7 +254,7 @@ AT_CHECK([autom4te -l m4sh $1.as -o $1])
  42. # `_oline_', once processed and ran, produces our reference.
  43. # We check that we find ourselves by looking at a string which is
  44. # available only in the original script: `_oline_'.
  45. -AT_DATA_LINENO([reference], [false], [__OLINE__], [_oline__])
  46. +AT_DATA_LINENO([reference], [true], [__OLINE__], [_oline__])
  47. AT_CHECK([./reference], 0, [stdout])
  48. # The reference:
  49. @@ -264,7 +264,7 @@ mv stdout expout
  50. # Be sure to be out of the PATH.
  51. AT_CHECK([mkdir test || exit 77])
  52. -AT_DATA_LINENO([test/test-1], [false], [__LINENO__], [LINENO])
  53. +AT_DATA_LINENO([test/test-1], [true], [__LINENO__], [LINENO])
  54. AT_CHECK([./test/test-1], 0, [expout])
  55. AT_CHECK([(PATH=test$PATH_SEPARATOR$PATH; export PATH; exec test-1)],
  56. 0, [expout])
  57. --
  58. 2.19.1