]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: drop the mawk-incompatible expression
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 17 Jun 2021 12:38:21 +0000 (14:38 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 17 Jun 2021 20:44:32 +0000 (21:44 +0100)
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
test/test-functions

index a82e9f73e8c68c9c5d6142f92be367d37a00b257..b154ace393bd27c0631064737a37ef529f04c73d 100644 (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