summaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/primitives/string.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-03-14 20:40:42 -0400
committerEli Schwartz <eschwartz@archlinux.org>2022-04-13 17:28:01 -0400
commitdf3f064c81cf9053a2ba9fa7b62298de6c5d7625 (patch)
treec5c4ad73bedb0588687a956270a7bf19945e4d4c /mesonbuild/interpreter/primitives/string.py
parent0e3ed2f6559ff97e4ba85a4d723597017630d150 (diff)
downloadmeson-df3f064c81cf9053a2ba9fa7b62298de6c5d7625.tar.gz
dependencies: move DependencyVariableString handling to declare_dependency
This allows tracking which subproject it came from at the time of definition, rather than the time of use. As a result, it is no longer possible for one subproject which knows that another subproject installs some data files, to expose those data files via its own declare_dependency.
Diffstat (limited to 'mesonbuild/interpreter/primitives/string.py')
-rw-r--r--mesonbuild/interpreter/primitives/string.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/mesonbuild/interpreter/primitives/string.py b/mesonbuild/interpreter/primitives/string.py
index bf213ef8e..1fd6e920f 100644
--- a/mesonbuild/interpreter/primitives/string.py
+++ b/mesonbuild/interpreter/primitives/string.py
@@ -189,5 +189,8 @@ class DependencyVariableString(str):
pass
class DependencyVariableStringHolder(StringHolder):
- def op_div(self, other: str) -> DependencyVariableString:
- return DependencyVariableString(super().op_div(other))
+ def op_div(self, other: str) -> T.Union[str, DependencyVariableString]:
+ ret = super().op_div(other)
+ if '..' in other:
+ return ret
+ return DependencyVariableString(ret)