aboutsummaryrefslogtreecommitdiff
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 23:59:20 +0200
commit9dc995b3e92a029fb1e563d1ca19365ac5fec804 (patch)
tree398276b2bf93ad6305c5f941354c7b7685fc93d7
parentabd6db24f9878c178730865d81b4601e690190f5 (diff)
downloadmeson-9dc995b3e92a029fb1e563d1ca19365ac5fec804.zip
meson-9dc995b3e92a029fb1e563d1ca19365ac5fec804.tar.gz
meson-9dc995b3e92a029fb1e563d1ca19365ac5fec804.tar.bz2
Permit path separators in subproject names but with a warning. Closes #2794.
-rw-r--r--mesonbuild/interpreter.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 8d64cc4..c2c4fe3 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)