tests: run-lfs-symbols.sh needs gawk

Message ID 20230719231639.1786109-1-sam@gentoo.org
State Committed
Headers
Series tests: run-lfs-symbols.sh needs gawk |

Commit Message

Sam James July 19, 2023, 11:16 p.m. UTC
  With awk=mawk, I get:
```
FAIL: run-lfs-symbols.sh
========================

First sanity-check that LFS detection works.
checking ./testfile-nolfs
awk: line 3: syntax error at or near /
FAIL run-lfs-symbols.sh (exit status: 2)
```

	* tests/run-lfs-symbols.sh: Call 'gawk' instead of 'awk'.

Signed-off-by: Sam James <sam@gentoo.org>
---
 tests/run-lfs-symbols.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Mark Wielaard July 20, 2023, 10:44 a.m. UTC | #1
Hi Sam,

On Thu, 2023-07-20 at 00:16 +0100, Sam James via Elfutils-devel wrote:
> With awk=mawk, I get:
> ```
> FAIL: run-lfs-symbols.sh
> ========================
> 
> First sanity-check that LFS detection works.
> checking ./testfile-nolfs
> awk: line 3: syntax error at or near /
> FAIL run-lfs-symbols.sh (exit status: 2)
> ```
> 
> 	* tests/run-lfs-symbols.sh: Call 'gawk' instead of 'awk'.

Thanks. We already require gawk for known-dwarf.awk, check for it in
configure and use it for the coverage generation.

Pushed,

Mark
  

Patch

diff --git a/tests/run-lfs-symbols.sh b/tests/run-lfs-symbols.sh
index 762a5d96..88c6270a 100755
--- a/tests/run-lfs-symbols.sh
+++ b/tests/run-lfs-symbols.sh
@@ -42,13 +42,13 @@  LFS_FORMAT='BEGIN {
 LFS=$(printf "$LFS_FORMAT" "${abs_srcdir}/lfs-symbols")
 
 makeprint() {
-  make print-$1 -C $2 |& awk -F= "/^$1=/{ print \$2 }"
+  make print-$1 -C $2 |& gawk -F= "/^$1=/{ print \$2 }"
 }
 
 testrun_lfs() {
   echo "checking $1"
   if [ -e "$1" ]; then
-    bad=$(testrun ${abs_top_builddir}/src/nm -u "$1" | awk "$LFS")
+    bad=$(testrun ${abs_top_builddir}/src/nm -u "$1" | gawk "$LFS")
     if [ -n "$bad" ]; then
       echo "$1 contains non-lfs symbols:" $bad
       exit_status=1