From: Ruediger Meier Date: Wed, 3 Feb 2016 22:44:42 +0000 (+0100) Subject: tests: minor cleanup ts_fdisk_clean() X-Git-Tag: v2.28-rc1~110^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=23d8c556848c8121e50ff77b16254f1802aa681a;p=thirdparty%2Futil-linux.git tests: minor cleanup ts_fdisk_clean() Signed-off-by: Ruediger Meier --- diff --git a/tests/functions.sh b/tests/functions.sh index 1f4d51878b..8f6c877249 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -610,18 +610,18 @@ function ts_fdisk_clean { local DEVNAME=$1 # remove non comparable parts of fdisk output - if [ x"${DEVNAME}" != x"" ]; then - sed -i -e "s:${DEVNAME}::g;" $TS_OUTPUT - fi - - sed -i -e 's/Disk identifier:.*/Disk identifier: /g' \ - -e 's/Created a new.*/Created a new ./g' \ - -e 's/^Device[[:blank:]]*Start/Device Start/g' \ - -e 's/^Device[[:blank:]]*Boot/Device Boot/g' \ - -e 's/^Device[[:blank:]]*Flag/Device Flag/g' \ - -e 's/Welcome to fdisk.*/Welcome to fdisk ./g' \ - -e 's/typescript file.*/typescript file ./g' \ - $TS_OUTPUT + if [ -n "${DEVNAME}" ]; then + sed -i -e "s@${DEVNAME}@@;" $TS_OUTPUT + fi + + sed -i \ + -e 's/Disk identifier:.*/Disk identifier: /' \ + -e 's/Created a new.*/Created a new ./' \ + -e 's/^Device[[:blank:]]*Start/Device Start/' \ + -e 's/^Device[[:blank:]]*Boot/Device Boot/' \ + -e 's/Welcome to fdisk.*/Welcome to fdisk ./' \ + -e 's/typescript file.*/typescript file ./' \ + $TS_OUTPUT } function ts_scsi_debug_init {