aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2018-04-11 16:51:23 +0200
committerIñigo Martínez <inigomartinez@gmail.com>2018-04-11 17:22:20 +0200
commitb2636ceef9cf838b4368583c41f5583338266eb9 (patch)
treea71eabbfa0fc39c198fc1ad6e57814a534c25bb7 /mesonbuild
parent351b59f03adcdbf5a4efbaba2446c0e40a456ef1 (diff)
downloadmeson-b2636ceef9cf838b4368583c41f5583338266eb9.zip
meson-b2636ceef9cf838b4368583c41f5583338266eb9.tar.gz
meson-b2636ceef9cf838b4368583c41f5583338266eb9.tar.bz2
gnome: Validate docbook parameter is a string
The `docbook` parameter used in `gdbus_codegen` should contain the prefix string in `PREFIX-NAME.xml`. Therefore it has to be validated as a string.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/modules/gnome.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 3e34e34..72cdc39 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -922,7 +922,11 @@ This will become a hard error in the future.''')
targets.append(build.CustomTarget(output, state.subdir, state.subproject, custom_kwargs))
if 'docbook' in kwargs:
- docbook_cmd = cmd + ['--output-directory', '@OUTDIR@', '--generate-docbook', kwargs.pop('docbook'), '@INPUT@']
+ docbook = kwargs.pop('docbook')
+ if not isinstance(docbook, str):
+ raise MesonException('docbook value must be a string.')
+
+ docbook_cmd = cmd + ['--output-directory', '@OUTDIR@', '--generate-docbook', docbook, '@INPUT@']
output = namebase + '-docbook'
custom_kwargs = {'input': xml_file,
@@ -933,7 +937,11 @@ This will become a hard error in the future.''')
targets.append(build.CustomTarget(output, state.subdir, state.subproject, custom_kwargs))
else:
if 'docbook' in kwargs:
- cmd += ['--generate-docbook', kwargs.pop('docbook')]
+ docbook = kwargs.pop('docbook')
+ if not isinstance(docbook, str):
+ raise MesonException('docbook value must be a string.')
+
+ cmd += ['--generate-docbook', docbook]
# https://git.gnome.org/browse/glib/commit/?id=ee09bb704fe9ccb24d92dd86696a0e6bb8f0dc1a
if mesonlib.version_compare(self._get_native_glib_version(state), '>= 2.51.3'):