diff mbox series

[2/2] meson: error out if qemu_suffix starts with /

Message ID 20200911124248.1088614-2-marcandre.lureau@redhat.com (mailing list archive)
State New, archived
Headers show
Series [1/2] meson: fix MSI rule | expand

Commit Message

Marc-André Lureau Sept. 11, 2020, 12:42 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Since the variable is used for path concatenation, the result would
ignore the prefix directory altogether.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 meson.build | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Paolo Bonzini Sept. 11, 2020, 1:42 p.m. UTC | #1
On 11/09/20 14:42, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Since the variable is used for path concatenation, the result would
> ignore the prefix directory altogether.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  meson.build | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/meson.build b/meson.build
> index 5421eca66a..cbe1cb51b3 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -17,6 +17,11 @@ config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
>  enable_modules = 'CONFIG_MODULES' in config_host
>  enable_static = 'CONFIG_STATIC' in config_host
>  build_docs = 'BUILD_DOCS' in config_host
> +
> +if get_option('qemu_suffix').startswith('/')
> +  error('qemu_suffix cannot start with a /')
> +endif
> +
>  qemu_datadir = get_option('datadir') / get_option('qemu_suffix')
>  qemu_docdir = get_option('docdir') / get_option('qemu_suffix')
>  config_host_data = configuration_data()
> 

Queued both, thanks.

Paolo
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index 5421eca66a..cbe1cb51b3 100644
--- a/meson.build
+++ b/meson.build
@@ -17,6 +17,11 @@  config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
 enable_modules = 'CONFIG_MODULES' in config_host
 enable_static = 'CONFIG_STATIC' in config_host
 build_docs = 'BUILD_DOCS' in config_host
+
+if get_option('qemu_suffix').startswith('/')
+  error('qemu_suffix cannot start with a /')
+endif
+
 qemu_datadir = get_option('datadir') / get_option('qemu_suffix')
 qemu_docdir = get_option('docdir') / get_option('qemu_suffix')
 config_host_data = configuration_data()