qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 1/2] iotests: Use absolute paths for executab


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3 1/2] iotests: Use absolute paths for executables
Date: Mon, 29 May 2017 10:55:00 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 05/29/2017 10:46 AM, Max Reitz wrote:

>> If you switch all of these to $(realpath -- "$(type -p "$QEMU_...")"),
>> you can add:
> 
> I'd love to, but this is what type -p outputs for me:
> 
> $ type -p qemu-img
> qemu-img is /usr/bin/qemu-img

Huh? That's plain 'type' output.  Are you sure you're testing 'type -p'?

$ PATH=$PATH    # to forcefully clear bash's cache
$ type qemu-img
qemu-img is /usr/bin/qemu-img
$ type -p qemu-img
/usr/bin/qemu-img
$ qemu-img --help >/dev/null   # to repopulate qemu-img into the cache
$ type qemu-img
qemu-img is hashed (/usr/bin/qemu-img)
$ type -p qemu-img
/usr/bin/qemu-img

> 
> So I would need to parse the result (and it depends on the locale). If
> that is indeed so, I'd rather stay with which, to be honest...

Plain 'type' does have to be parsed, but 'type -p' is required to be
machine-usable.

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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