qemu-iotests: Ensure GNU sed is used

Various sed regexp from common.filter use sed GNU extensions.
Instead of spending time to write these regex to be POSIX compliant,
verify the GNU sed is available and use it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Philippe Mathieu-Daudé 2019-03-07 15:58:39 +01:00 committed by Kevin Wolf
parent 11a82d1429
commit bde36af1ab
2 changed files with 31 additions and 18 deletions

View file

@ -17,6 +17,19 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
SED=
for sed in sed gsed; do
($sed --version | grep 'GNU sed') > /dev/null 2>&1
if [ "$?" -eq 0 ]; then
SED=$sed
break
fi
done
if [ -z "$SED" ]; then
echo "$0: GNU sed not found"
exit 1
fi
dd()
{
if [ "$HOSTOS" == "Linux" ]