From: sewn Date: Sat, 29 Jul 2023 02:19:53 +0000 (+0300) Subject: tools/all_syscalls: use sh and replace awk with grep & sed X-Git-Tag: v2.40-rc1~285^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a01065546d9613ffc9835398f56756f08a0193be;p=thirdparty%2Futil-linux.git 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. --- 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"