From 44131226761913bba297a0cf5d20d37d9408d02e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 3 May 2017 11:36:00 +1000 Subject: Check for input and output to exist in vcs_tag Provide a proper error message, rather than the current "Command cannot have '@INPUT0@', since no input files were specified" which doesn't actually tell us where things are going wrong. --- mesonbuild/interpreter.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mesonbuild') diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index d8f3b2b..fed3e10 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -2022,6 +2022,8 @@ class Interpreter(InterpreterBase): raise InterpreterException('Unknown target_type.') def func_vcs_tag(self, node, args, kwargs): + if 'input' not in kwargs or 'output' not in kwargs: + raise InterpreterException('Keyword arguments input and output must exist') fallback = kwargs.pop('fallback', None) if not isinstance(fallback, str): raise InterpreterException('Keyword argument fallback must exist and be a string.') -- cgit v1.1 From 7a3be163cbceb9f569ff454dc23fdfecadc166cc Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 4 May 2017 09:06:00 +1000 Subject: Default to project_version() in vcs_tag fallback --- mesonbuild/interpreter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index fed3e10..0e3f039 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -2024,9 +2024,9 @@ class Interpreter(InterpreterBase): def func_vcs_tag(self, node, args, kwargs): if 'input' not in kwargs or 'output' not in kwargs: raise InterpreterException('Keyword arguments input and output must exist') - fallback = kwargs.pop('fallback', None) + fallback = kwargs.pop('fallback', self.project_version) if not isinstance(fallback, str): - raise InterpreterException('Keyword argument fallback must exist and be a string.') + raise InterpreterException('Keyword argument fallback must be a string.') replace_string = kwargs.pop('replace_string', '@VCS_TAG@') regex_selector = '(.*)' # default regex selector for custom command: use complete output vcs_cmd = kwargs.get('command', None) -- cgit v1.1