Blame SOURCES/kvm-qemu-iotests-convert-pwd-and-pwd-to-PWD.patch

7711c0
From 2da89bf5ccc55e0535fecc5b507bacac5c6ad3b4 Mon Sep 17 00:00:00 2001
7711c0
From: John Snow <jsnow@redhat.com>
7711c0
Date: Fri, 22 Mar 2019 03:22:27 +0100
7711c0
Subject: [PATCH 060/163] qemu-iotests: convert `pwd` and $(pwd) to $PWD
7711c0
7711c0
RH-Author: John Snow <jsnow@redhat.com>
7711c0
Message-id: <20190322032241.8111-15-jsnow@redhat.com>
7711c0
Patchwork-id: 85097
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 14/28] qemu-iotests: convert `pwd` and $(pwd) to $PWD
7711c0
Bugzilla: 1691563
7711c0
RH-Acked-by: Max Reitz <mreitz@redhat.com>
7711c0
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
7711c0
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
7711c0
From: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
7711c0
7711c0
POSIX requires $PWD to be reliable, and we expect all
7711c0
shells used by qemu scripts to be relatively close to
7711c0
POSIX.  Thus, it is smarter to avoid forking the pwd
7711c0
executable for something that is already available in
7711c0
the environment.
7711c0
7711c0
So replace it with the following:
7711c0
7711c0
sed -i 's/\(`pwd`\|\$(pwd)\)/$PWD/g' $(git grep -l pwd)
7711c0
7711c0
Then delete a pointless line assigning PWD to itself.
7711c0
7711c0
Cc: kwolf@redhat.com
7711c0
Cc: mreitz@redhat.com
7711c0
Cc: eblake@redhat.com
7711c0
Suggested-by: Eric Blake <eblake@redhat.com>
7711c0
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
7711c0
Message-Id: <20181024094051.4470-2-maozhongyi@cmss.chinamobile.com>
7711c0
Reviewed-by: Eric Blake <eblake@redhat.com>
7711c0
[eblake: touch up commit message, reorder series, tweak a couple more files]
7711c0
Signed-off-by: Eric Blake <eblake@redhat.com>
7711c0
(cherry picked from commit e8d81a61e1b9e28267164f751dee5b9b59444e71)
7711c0
Signed-off-by: John Snow <jsnow@redhat.com>
7711c0
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 configure                                | 2 +-
7711c0
 scripts/coccinelle/tcg_gen_extract.cocci | 2 +-
7711c0
 tests/check-block.sh                     | 6 +++---
7711c0
 tests/qemu-iotests/check                 | 2 +-
7711c0
 tests/qemu-iotests/common.config         | 2 --
7711c0
 tests/qemu-iotests/common.rc             | 2 +-
7711c0
 6 files changed, 7 insertions(+), 9 deletions(-)
7711c0
7711c0
diff --git a/configure b/configure
7711c0
index f9c8365..285fd47 100755
7711c0
--- a/configure
7711c0
+++ b/configure
7711c0
@@ -821,7 +821,7 @@ Linux)
7711c0
   vhost_crypto="yes"
7711c0
   vhost_scsi="yes"
7711c0
   vhost_vsock="yes"
7711c0
-  QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$(pwd)/linux-headers $QEMU_INCLUDES"
7711c0
+  QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$PWD/linux-headers $QEMU_INCLUDES"
7711c0
   supported_os="yes"
7711c0
 ;;
7711c0
 esac
7711c0
diff --git a/scripts/coccinelle/tcg_gen_extract.cocci b/scripts/coccinelle/tcg_gen_extract.cocci
7711c0
index 81e66a3..c10c863 100644
7711c0
--- a/scripts/coccinelle/tcg_gen_extract.cocci
7711c0
+++ b/scripts/coccinelle/tcg_gen_extract.cocci
7711c0
@@ -17,7 +17,7 @@
7711c0
 //     --keep-comments --in-place \
7711c0
 //     --use-gitgrep --dir target
7711c0
 //
7711c0
-// $ docker run --rm -v `pwd`:`pwd` -w `pwd` philmd/coccinelle \
7711c0
+// $ docker run --rm -v $PWD:$PWD -w $PWD philmd/coccinelle \
7711c0
 //     --macro-file scripts/cocci-macro-file.h \
7711c0
 //     --sp-file scripts/coccinelle/tcg_gen_extract.cocci \
7711c0
 //     --keep-comments --in-place \
7711c0
diff --git a/tests/check-block.sh b/tests/check-block.sh
7711c0
index c3de378..f3d12fd 100755
7711c0
--- a/tests/check-block.sh
7711c0
+++ b/tests/check-block.sh
7711c0
@@ -5,9 +5,9 @@ if [ "$#" -ne 0 ]; then
7711c0
     FORMAT_LIST="$@"
7711c0
 fi
7711c0
 
7711c0
-export QEMU_PROG="$(pwd)/x86_64-softmmu/qemu-system-x86_64"
7711c0
-export QEMU_IMG_PROG="$(pwd)/qemu-img"
7711c0
-export QEMU_IO_PROG="$(pwd)/qemu-io"
7711c0
+export QEMU_PROG="$PWD/x86_64-softmmu/qemu-system-x86_64"
7711c0
+export QEMU_IMG_PROG="$PWD/qemu-img"
7711c0
+export QEMU_IO_PROG="$PWD/qemu-io"
7711c0
 
7711c0
 if [ ! -x $QEMU_PROG ]; then
7711c0
     echo "'make check-block' requires qemu-system-x86_64"
7711c0
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
7711c0
index aa94c6c..b377132 100755
7711c0
--- a/tests/qemu-iotests/check
7711c0
+++ b/tests/qemu-iotests/check
7711c0
@@ -99,7 +99,7 @@ set_prog_path()
7711c0
 }
7711c0
 
7711c0
 if [ -z "$TEST_DIR" ]; then
7711c0
-        TEST_DIR=`pwd`/scratch
7711c0
+        TEST_DIR=$PWD/scratch
7711c0
 fi
7711c0
 
7711c0
 if [ ! -e "$TEST_DIR" ]; then
7711c0
diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
7711c0
index 102aa68..3cda0fe 100644
7711c0
--- a/tests/qemu-iotests/common.config
7711c0
+++ b/tests/qemu-iotests/common.config
7711c0
@@ -25,8 +25,6 @@ HOSTOS=`uname -s`
7711c0
 arch=`uname -m`
7711c0
 [[ "$arch" =~ "ppc64" ]] && qemu_arch=ppc64 || qemu_arch="$arch"
7711c0
 
7711c0
-export PWD=`pwd`
7711c0
-
7711c0
 # make sure we have a standard umask
7711c0
 umask 022
7711c0
 
7711c0
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
7711c0
index 1e567b0..bb03a4b 100644
7711c0
--- a/tests/qemu-iotests/common.rc
7711c0
+++ b/tests/qemu-iotests/common.rc
7711c0
@@ -159,7 +159,7 @@ fi
7711c0
 ORIG_TEST_IMG="$TEST_IMG"
7711c0
 
7711c0
 if [ -z "$TEST_DIR" ]; then
7711c0
-        TEST_DIR=`pwd`/scratch
7711c0
+        TEST_DIR=$PWD/scratch
7711c0
 fi
7711c0
 
7711c0
 QEMU_TEST_DIR="${TEST_DIR}"
7711c0
-- 
7711c0
1.8.3.1
7711c0