qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/3] qemu-iotests: convert `pwd` and $(pwd) t


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 1/3] qemu-iotests: convert `pwd` and $(pwd) to $PWD
Date: Fri, 16 Nov 2018 14:42:47 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0

On 11/16/18 10:53 AM, Eric Blake wrote:
On 10/24/18 4:40 AM, Mao Zhongyi wrote:
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 replac it with the following:

s/replac/replace/


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

This didn't modify anything (the first $ was not escaped).


The remaining small parts are manually modified.

What remaining small parts? With a fixed sed line, I made all of the same edits as you, plus one you missed a comment in scripts/coccinelle/tcg_gen_extract.cocci that could also be updated.


Reviewed-by: Eric Blake <address@hidden>

Here's the updated command line I used:

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

and reordering this to occur second makes it much easier to review (only 6 files outside of tests/qemu-iotests/??? that needed a change).

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]