[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] configure: disallow spaces and colons in source
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] configure: disallow spaces and colons in source path |
Date: |
Fri, 15 Mar 2019 13:46:58 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 |
On 3/15/19 12:50 PM, Antonio Ospite wrote:
> From: Antonio Ospite <address@hidden>
>
> The configure script breaks when the qemu source directory is in a path
> containing white spaces, in particular the list of targets is not
> correctly generated when calling "./configure --help".
>
> To avoid this issue, refuse to run the configure script if there are
> spaces or colons in the source path, this is also what kbuild from linux
> does.
>
> Buglink: https://bugs.launchpad.net/qemu/+bug/1817345
>
> Signed-off-by: Antonio Ospite <address@hidden>
> ---
> configure | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/configure b/configure
> index 7071f52584..fbd70a0f51 100755
> --- a/configure
> +++ b/configure
> @@ -295,6 +295,11 @@ libs_qga=""
> debug_info="yes"
> stack_protector=""
>
> +if printf "%s" "$(realpath "$source_path")" | grep -q "[[:space:]:]";
Why realpath? If my sources live in "/home/me/bad dir" but I have a
symlink "/home/me/good", this prevents me from building even though I
won't trip the problem.
Also, grep is not required to operate on non-text files (the POSIX
definition states that if your input does not end in a newline, it is
not a text file, and grep can skip that line) - better is to use "%s\n"
in some form.
So I'd rather see this just use:
if printf %s\\n "$PWD" | grep -q "[[:space:]:]"
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature