summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-02-14 00:31:41 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2018-02-14 19:13:42 +0200
commit0d4a9c6a180153cb11422b2b15843abe7e356015 (patch)
tree5574454eda06313b2630e9e6380b7833eacbb886
parentd0f620364f3470e2030606f280d5724e5ef8bdb1 (diff)
downloadmeson-sprojname.tar.gz
Permit path separators in subproject names but with a warning. Closes #2794.sprojname
-rw-r--r--mesonbuild/interpreter.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 38aca7537..047e8201e 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1735,8 +1735,16 @@ external dependencies (including libraries) must go to "dependencies".''')
return self.do_subproject(dirname, kwargs)
def do_subproject(self, dirname, kwargs):
- if '/' in dirname or '\\' in dirname:
- raise InterpreterException('Subproject name must not contain a path separator.')
+ if dirname == '':
+ raise InterpreterException('Subproject dir name must not be empty.')
+ if dirname[0] == '.':
+ raise InterpreterException('Subproject dir name must not start with a period.')
+ if '..' in dirname:
+ raise InterpreterException('Subproject name must not contain a ".." path segment.')
+ if os.path.isabs(dirname):
+ raise InterpreterException('Subproject name must not be an absolute path.')
+ if '\\' in dirname or '/' in dirname:
+ mlog.warning('Subproject name has a path separator. This may cause unexpected behaviour.')
if dirname in self.subproject_stack:
fullstack = self.subproject_stack + [dirname]
incpath = ' => '.join(fullstack)