diff options
Diffstat (limited to 'mesonbuild/interpreter.py')
| -rw-r--r-- | mesonbuild/interpreter.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index b586997a3..c92adaf30 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1007,26 +1007,26 @@ class MesonMain(InterpreterObject): }) def add_install_script_method(self, args, kwargs): - if len(args) != 1: - raise InterpreterException('Set_install_script takes exactly one argument.') - check_stringlist(args) + if len(args) < 1: + raise InterpreterException('add_install_script takes one or more arguments') + check_stringlist(args, 'add_install_script args must be strings') scriptbase = args[0] - scriptfile = os.path.join(self.interpreter.environment.source_dir, - self.interpreter.subdir, scriptbase) - if not os.path.isfile(scriptfile): - raise InterpreterException('Can not find install script %s.' % scriptbase) - self.build.install_scripts.append(build.InstallScript([scriptfile])) + search_dir = os.path.join(self.interpreter.environment.source_dir, + self.interpreter.subdir) + script = dependencies.ExternalProgram(scriptbase, search_dir=search_dir) + extras = args[1:] + self.build.install_scripts.append({'exe': script.get_command(), 'args': extras}) def add_postconf_script_method(self, args, kwargs): if len(args) < 1: - raise InterpreterException('Not enough arguments') - check_stringlist(args, 'add_postconf_script arguments must be strings.') + raise InterpreterException('add_postconf_script takes one or more 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) + script = dependencies.ExternalProgram(scriptbase, search_dir=search_dir) extras = args[1:] - self.build.postconf_scripts.append({'exe': exe, 'args': extras}) + self.build.postconf_scripts.append({'exe': script, 'args': extras}) def current_source_dir_method(self, args, kwargs): src = self.interpreter.environment.source_dir @@ -2023,7 +2023,7 @@ requirements use the version keyword argument instead.''') absname = os.path.join(self.environment.get_source_dir(), buildfilename) if not os.path.isfile(absname): self.subdir = prev_subdir - raise InterpreterException('Nonexistant build def file %s.' % buildfilename) + raise InterpreterException('Nonexistent build def file %s.' % buildfilename) with open(absname, encoding='utf8') as f: code = f.read() assert(isinstance(code, str)) |
