diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-02-15 19:13:21 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-02-15 19:13:21 +0200 |
commit | 99bb73e6c96655fe335dbeca6ae2f8dc7986d213 (patch) | |
tree | 76a40ac85b13a3a7be14a65202c1ffd9d8ad5faf /interpreter.py | |
parent | 7c074fd9535e8dbe2f32a5b322ce8e25b27cce8a (diff) | |
download | meson-99bb73e6c96655fe335dbeca6ae2f8dc7986d213.zip meson-99bb73e6c96655fe335dbeca6ae2f8dc7986d213.tar.gz meson-99bb73e6c96655fe335dbeca6ae2f8dc7986d213.tar.bz2 |
Changed install_data to get rid of useless and confusing target subdir name.
Diffstat (limited to 'interpreter.py')
-rw-r--r-- | interpreter.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/interpreter.py b/interpreter.py index a00a1ae..7cc938d 100644 --- a/interpreter.py +++ b/interpreter.py @@ -303,17 +303,19 @@ class Headers(InterpreterObject): return self.custom_install_dir class Data(InterpreterObject): - def __init__(self, source_subdir, subdir, sources, kwargs): + def __init__(self, source_subdir, sources, kwargs): InterpreterObject.__init__(self) self.source_subdir = source_subdir - self.install_subdir = subdir self.sources = sources kwsource = kwargs.get('sources', []) if not isinstance(kwsource, list): kwsource = [kwsource] self.sources += kwsource - self.custom_install_dir = kwargs.get('install_dir', None) - if self.custom_install_dir is not None and not isinstance(self.custom_install_dir, str): + for s in self.sources: + if not isinstance(s, str): + raise InterpreterException('Install file name must be a string.') + self.install_dir = kwargs.get('install_dir', None) + if not isinstance(self.install_dir, str): raise InterpreterException('Custom_install_dir must be a string.') def get_install_subdir(self): @@ -325,8 +327,8 @@ class Data(InterpreterObject): def get_sources(self): return self.sources - def get_custom_install_dir(self): - return self.custom_install_dir + def get_install_dir(self): + return self.install_dir class InstallDir(InterpreterObject): def __init__(self, source_subdir, installable_subdir, install_dir): @@ -1264,12 +1266,10 @@ class Interpreter(): self.subdir = prev_subdir def func_install_data(self, node, args, kwargs): - if len(args ) < 1: - raise InvalidArguments('Data function must have at least one argument: the subdirectory.') for a in args: if not isinstance(a, str): raise InvalidArguments('Argument %s is not a string.' % str(a)) - data = Data(self.subdir, args[0], args[1:], kwargs) + data = Data(self.subdir, args, kwargs) self.build.data.append(data) return data |