diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-08-14 16:34:24 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-08-14 16:34:24 +0300 |
commit | 63572626c69fc888b6fa94d00cf1bfcb7bb3c652 (patch) | |
tree | 2fea6b9e743a6f1a315c9e5a871567cdf8344749 | |
parent | a5abcf1fe2a033efd5c79b5220b658aa7d844197 (diff) | |
download | meson-63572626c69fc888b6fa94d00cf1bfcb7bb3c652.zip meson-63572626c69fc888b6fa94d00cf1bfcb7bb3c652.tar.gz meson-63572626c69fc888b6fa94d00cf1bfcb7bb3c652.tar.bz2 |
Copy permission bits from source files and fix a path issue.
-rw-r--r-- | interpreter.py | 7 | ||||
-rw-r--r-- | mesonlib.py | 1 | ||||
-rw-r--r-- | ninjabackend.py | 7 |
3 files changed, 8 insertions, 7 deletions
diff --git a/interpreter.py b/interpreter.py index cbc1e08..91ec6aa 100644 --- a/interpreter.py +++ b/interpreter.py @@ -1595,12 +1595,7 @@ class Interpreter(): raise InterpreterException('Configure_file must have either "configuration" or "command".') if isinstance(kwargs.get('install_dir', None), str): self.build.data.append(Data(False, self.subdir, [output], kwargs)) - # FIXME, HORROR, this is a massive hack to get this working. The correct - # solution is to finally do the refactoring where source files are no - # longer strings but actual objects. This is a major undertaking - # and will only be done after the next release. - outputfile = os.path.join(self.environment.build_dir, self.subdir, output) - return outputfile + return mesonlib.File.from_built_file(self.subdir, output) @stringArgs @noKwargs diff --git a/mesonlib.py b/mesonlib.py index fc51380..c7cf208 100644 --- a/mesonlib.py +++ b/mesonlib.py @@ -232,6 +232,7 @@ def do_conf_file(src, dst, confdata): result.append(line) dst_tmp = dst + '~' open(dst_tmp, 'w').writelines(result) + shutil.copymode(src, dst_tmp) replace_if_different(dst, dst_tmp) diff --git a/ninjabackend.py b/ninjabackend.py index 7364f87..cefed1f 100644 --- a/ninjabackend.py +++ b/ninjabackend.py @@ -276,7 +276,12 @@ class NinjaBackend(backends.Backend): ofilenames = [os.path.join(target.subdir, i) for i in target.output] # FIXME, should not grab element at zero but rather expand all. deps = [os.path.join(i.get_subdir(), self.hackety_hack(i.get_filename())) for i in target.get_dependencies()] - srcs = [os.path.join(self.build_to_src, target.subdir, i) for i in target.sources] + srcs = [] + for i in target.sources: + if isinstance(i, str): + srcs.append(os.path.join(self.build_to_src, target.subdir, i)) + else: + srcs.append(i.rel_to_builddir(self.build_to_src)) deps += srcs if target.build_always: deps.append('PHONY') |