From a01065546d9613ffc9835398f56756f08a0193be Mon Sep 17 00:00:00 2001 From: sewn Date: Sat, 29 Jul 2023 05:19:53 +0300 Subject: [PATCH] tools/all_syscalls: use sh and replace awk with grep & sed using sh removes the bash dependencies, for those who don't have bash on their system, and replaced the GNU awk with a portable grep and sed. --- tools/all_syscalls | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/all_syscalls b/tools/all_syscalls index 9c147786cf..aa068a3f20 100755 --- a/tools/all_syscalls +++ b/tools/all_syscalls @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -e @@ -9,7 +9,9 @@ SYSCALL_INCLUDES=" trap 'rm $OUTPUT $OUTPUT.deps' ERR -"$@" -MD -MF "$OUTPUT.deps" <<< "$SYSCALL_INCLUDES" -dM -E - \ - | gawk 'match($0, /^#define __NR_([^ ]+)/, res) { print "UL_SYSCALL(\"" res[1] "\", __NR_" res[1] ")" }' \ +echo "$SYSCALL_INCLUDES" \ + | "$@" -MD -MF "$OUTPUT.deps" -dM -E - \ + | grep '^#define __NR_' \ + | sed 's/#define __NR_\([^[:space:]]*\).*/UL_SYSCALL("\1", __NR_\1)/' \ | sort \ > "$OUTPUT" -- 2.47.3