diff options
author | Philippe Mathieu-Daudé <philmd@redhat.com> | 2019-03-07 15:58:39 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2019-03-08 12:26:45 +0100 |
commit | bde36af1ab4f476d38bfbcc1d890b08b7164a8f4 (patch) | |
tree | 824705bd46716a346f9021b7ad305ec046715805 /tests/qemu-iotests/common.rc | |
parent | 11a82d14293cd66f428f535741717ff338c0722b (diff) |
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>
Diffstat (limited to 'tests/qemu-iotests/common.rc')
-rw-r--r-- | tests/qemu-iotests/common.rc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index f21020eba6..a543e546c2 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -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" ] |