use positional instead of keyword args for add_postconf_script

pull/426/head
Nicolas Schneider 9 years ago
parent 9f9f73fa52
commit 5e1fdb8b97
  1. 8
      mesonbuild/interpreter.py
  2. 2
      test cases/common/108 postconf with args/meson.build

@ -812,14 +812,14 @@ class MesonMain(InterpreterObject):
self.build.install_scripts.append(build.InstallScript([scriptfile]))
def add_postconf_script_method(self, args, kwargs):
if len(args) != 1:
raise InterpreterException('Set_postconf_script takes exactly one argument.')
check_stringlist(args)
if len(args) < 1:
raise InterpreterException('Not enough arguments')
check_stringlist(args, 'add_postconf_script arguments must be strings.')
scriptbase = args[0]
search_dir = os.path.join(self.interpreter.environment.source_dir,
self.interpreter.subdir)
exe = dependencies.ExternalProgram(scriptbase, search_dir=search_dir)
extras = mesonlib.stringlistify(kwargs.get('args', []))
extras = args[1:]
self.build.postconf_scripts.append({'exe': exe, 'args': extras})
def current_source_dir_method(self, args, kwargs):

@ -1,5 +1,5 @@
project('postconf script', 'c')
meson.add_postconf_script('postconf.py', args: ['5', '33'])
meson.add_postconf_script('postconf.py', '5', '33')
test('post', executable('prog', 'prog.c'))

Loading…
Cancel
Save