]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qemu-iotests: convert `pwd` and $(pwd) to $PWD
authorMao Zhongyi <maozhongyi@cmss.chinamobile.com>
Fri, 16 Nov 2018 20:33:03 +0000 (14:33 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 19 Nov 2018 16:08:19 +0000 (10:08 -0600)
POSIX requires $PWD to be reliable, and we expect all
shells used by qemu scripts to be relatively close to
POSIX.  Thus, it is smarter to avoid forking the pwd
executable for something that is already available in
the environment.

So replace it with the following:

sed -i 's/\(`pwd`\|\$(pwd)\)/$PWD/g' $(git grep -l pwd)

Then delete a pointless line assigning PWD to itself.

Cc: kwolf@redhat.com
Cc: mreitz@redhat.com
Cc: eblake@redhat.com
Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Message-Id: <20181024094051.4470-2-maozhongyi@cmss.chinamobile.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: touch up commit message, reorder series, tweak a couple more files]
Signed-off-by: Eric Blake <eblake@redhat.com>
configure
scripts/coccinelle/tcg_gen_extract.cocci
tests/check-block.sh
tests/qemu-iotests/check
tests/qemu-iotests/common.config
tests/qemu-iotests/common.rc

index 5b1d83ea26232462f960dc699bde350ed7aaba68..0a3c6a72c3b7f82298f71ccb5fb4af0cc2954d5c 100755 (executable)
--- a/configure
+++ b/configure
@@ -878,7 +878,7 @@ Linux)
   vhost_crypto="yes"
   vhost_scsi="yes"
   vhost_vsock="yes"
-  QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$(pwd)/linux-headers $QEMU_INCLUDES"
+  QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$PWD/linux-headers $QEMU_INCLUDES"
   supported_os="yes"
   libudev="yes"
 ;;
index 81e66a35ae14bb86bcbf0c1888282283f208a8ad..c10c86348270cb04d828852d1d5764c1327dc5aa 100644 (file)
@@ -17,7 +17,7 @@
 //     --keep-comments --in-place \
 //     --use-gitgrep --dir target
 //
-// $ docker run --rm -v `pwd`:`pwd` -w `pwd` philmd/coccinelle \
+// $ docker run --rm -v $PWD:$PWD -w $PWD philmd/coccinelle \
 //     --macro-file scripts/cocci-macro-file.h \
 //     --sp-file scripts/coccinelle/tcg_gen_extract.cocci \
 //     --keep-comments --in-place \
index c3de3789c484b43f953df5e68f8e8303d431cdc8..f3d12fd602d07b4a097a2e7e23ec1aa1c41cbc3c 100755 (executable)
@@ -5,9 +5,9 @@ if [ "$#" -ne 0 ]; then
     FORMAT_LIST="$@"
 fi
 
-export QEMU_PROG="$(pwd)/x86_64-softmmu/qemu-system-x86_64"
-export QEMU_IMG_PROG="$(pwd)/qemu-img"
-export QEMU_IO_PROG="$(pwd)/qemu-io"
+export QEMU_PROG="$PWD/x86_64-softmmu/qemu-system-x86_64"
+export QEMU_IMG_PROG="$PWD/qemu-img"
+export QEMU_IO_PROG="$PWD/qemu-io"
 
 if [ ! -x $QEMU_PROG ]; then
     echo "'make check-block' requires qemu-system-x86_64"
index aa94c6c7ea906e592a33fe53ab04c12de1cd7b00..b37713277d1907a4a08721993a5b04f7f97560df 100755 (executable)
@@ -99,7 +99,7 @@ set_prog_path()
 }
 
 if [ -z "$TEST_DIR" ]; then
-        TEST_DIR=`pwd`/scratch
+        TEST_DIR=$PWD/scratch
 fi
 
 if [ ! -e "$TEST_DIR" ]; then
index 102aa6878a96f8d7bf2d65d3f727a17ad992d83b..3cda0fe56962485f2a535e891b7fd39a95078558 100644 (file)
@@ -25,8 +25,6 @@ HOSTOS=`uname -s`
 arch=`uname -m`
 [[ "$arch" =~ "ppc64" ]] && qemu_arch=ppc64 || qemu_arch="$arch"
 
-export PWD=`pwd`
-
 # make sure we have a standard umask
 umask 022
 
index 70ca65b49b3dee17f8ec39146ec14221ebf32a4e..e15e7a7c8e693c56ff0efa8894b30aa535851347 100644 (file)
@@ -160,7 +160,7 @@ fi
 ORIG_TEST_IMG="$TEST_IMG"
 
 if [ -z "$TEST_DIR" ]; then
-        TEST_DIR=`pwd`/scratch
+        TEST_DIR=$PWD/scratch
 fi
 
 QEMU_TEST_DIR="${TEST_DIR}"