aboutsummaryrefslogtreecommitdiff
path: root/interpreter.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2014-02-23 22:30:41 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2014-02-23 22:30:41 +0200
commit1f1a3f516e950cc8f49d7983f1127a2737c87a22 (patch)
tree8816573a114a53757db08181c8bdd77efcf4df83 /interpreter.py
parent836c978c94e4a0b94c269cbd10a8eeea0437ff66 (diff)
downloadmeson-1f1a3f516e950cc8f49d7983f1127a2737c87a22.zip
meson-1f1a3f516e950cc8f49d7983f1127a2737c87a22.tar.gz
meson-1f1a3f516e950cc8f49d7983f1127a2737c87a22.tar.bz2
Start of subproject redesign, moved subprojects to the dedicated subdirectory.
Diffstat (limited to 'interpreter.py')
-rw-r--r--interpreter.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/interpreter.py b/interpreter.py
index 3ca425f..3976614 100644
--- a/interpreter.py
+++ b/interpreter.py
@@ -799,7 +799,7 @@ class Interpreter():
raise InterpreterException('Subprojects of subprojects are not yet supported.')
if dirname in self.build.subprojects:
raise InterpreterException('Tried to add the same subproject twice.')
- subdir = os.path.join(self.subproject, self.subdir, dirname)
+ subdir = os.path.join('subprojects', dirname)
abs_subdir = os.path.join(self.build.environment.get_source_dir(), subdir)
if not os.path.isdir(abs_subdir):
raise InterpreterException('Subproject directory does not exist.')
@@ -807,7 +807,7 @@ class Interpreter():
mlog.log('\nExecuting subproject ', mlog.bold(dirname), '.\n', sep='')
subi = Interpreter(self.build, subdir)
subi.run()
- mlog.log('\nSubproject finished.\n')
+ mlog.log('\nSubproject', mlog.bold(dirname), 'finished.')
self.build.subprojects[dirname] = True
self.subprojects[dirname] = SubprojectHolder(subi)
return self.subprojects[dirname]
@@ -995,6 +995,10 @@ class Interpreter():
if len(kwargs) > 0:
raise InvalidArguments('subdir command takes no keyword arguments.')
self.validate_arguments(args, 1, [str])
+ if '..' in args[0]:
+ raise InvalidArguments('Subdir contains ..')
+ if self.subdir == '' and args[0] == 'subprojects':
+ raise InvalidArguments('Must not go into subprojects dir with subdir(), use subproject() instead.')
prev_subdir = self.subdir
subdir = os.path.join(prev_subdir, args[0])
if subdir in self.visited_subdirs: