regression tests/prologue: adjust sed to not use ~ as regex separators

prologue.inc:settest() in same cases invokes a sed command that uses
'~' as a pattern separator, on things that can contain filesystem
paths. However, in the debian/ubuntu world, '~' can be used in version
strings, particularly for pre-release versions, and when this happens
and the version is embedded in the path, the sed command breaks
because of the extraneous separator. Fix this by using '#' as a
separator, which has the benefit of being considered a comment if
accidentally interpreted by a shell.

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/599
This commit is contained in:
Steve Beattie 2020-08-27 14:43:09 -07:00
parent 139fac6062
commit efc6590409
Failed to generate hash of commit

View file

@ -579,7 +579,7 @@ settest()
elif [ $# -eq 2 ]
then
test=$bin/$1
testexec=`echo $2 | sed "s~{}~$test~"`
testexec=`echo $2 | sed "s#{}#$test#"`
else
fatalerror "settest, illegal usage"
fi