test: drop the mawk-incompatible expression

The three-argument match() is a GNU AWK extension, thus breaking the
compatibility with mawk (used on Ubuntu/Debian, for example). Let's
replace it with a (hopefully) more portable sed expression to drop the
inadvertently introduced gawk dependency.

Fixes: #19957
This commit is contained in:
Frantisek Sumsal 2021-06-17 14:38:21 +02:00 committed by Luca Boccassi
parent c1b8c966ec
commit 29bff80b5c

View file

@ -2036,7 +2036,7 @@ inst_rule_programs() {
local rule="${1:?}"
local prog bin
awk 'match($0, /PROGRAM==?"([^ "]+)/, m) { print m[1]; }' "$rule" | while read -r prog; do
sed -rn 's/^.*?PROGRAM==?"([^ "]+).*$/\1/p' "$rule" | while read -r prog; do
if [ -x "/lib/udev/$prog" ]; then
bin="/lib/udev/$prog"
else