aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
diff options
context:
space:
mode:
authorliugang <galen.gang.liu@gmail.com>2017-10-14 22:44:59 +0800
committerJussi Pakkanen <jpakkane@gmail.com>2017-10-14 18:09:13 +0300
commit36d85db5d41b1f3a8e3f13a1680d1758353b23f7 (patch)
tree7fa911875b3532d731634049211c94a746aacd9f /mesonbuild/interpreter.py
parent3f18e3b89f0f7c42c3bb1479d64ea9aa4f75240c (diff)
downloadmeson-36d85db5d41b1f3a8e3f13a1680d1758353b23f7.zip
meson-36d85db5d41b1f3a8e3f13a1680d1758353b23f7.tar.gz
meson-36d85db5d41b1f3a8e3f13a1680d1758353b23f7.tar.bz2
fix all subproject using wrap-file broken
subproject using wrap-file is broken since commit (68bd64c Prevent projects from directly grabbing files from other subprojects. ) subproject with wrap-file usually have version number after name - **sproj_name** is `zlib-1.2.8` according to `directory = zlib-1.2.8` of zlib.wrap - but **self.subproject** `zlib`
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r--mesonbuild/interpreter.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index f4bc11f..bfd946a 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1373,6 +1373,9 @@ class Interpreter(InterpreterBase):
self.coredata = self.environment.get_coredata()
self.backend = backend
self.subproject = subproject
+ # Subproject directory is usually the name of the subproject, but can
+ # be different for dependencies provided by wrap files.
+ self.subproject_directory_name = subdir.split(os.path.sep)[-1]
self.subproject_dir = subproject_dir
self.option_file = os.path.join(self.source_root, self.subdir, 'meson_options.txt')
self.load_root_meson_file()
@@ -2785,7 +2788,6 @@ different subdirectory.
super().run()
mlog.log('Build targets in project:', mlog.bold(str(len(self.build.targets))))
-
# Check that the indicated file is within the same subproject
# as we currently are. This is to stop people doing
# nasty things like:
@@ -2816,7 +2818,7 @@ different subdirectory.
if num_sps > 1:
raise InterpreterException('Sandbox violation: Tried to grab file %s from a nested subproject.' % segments[-1])
sproj_name = segments[segments.index(self.subproject_dir) + 1]
- if sproj_name != self.subproject:
+ if sproj_name != self.subproject_directory_name:
raise InterpreterException('Sandbox violation: Tried to grab file %s from a different subproject.' % segments[-1])
def source_strings_to_files(self, sources):