diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-03-25 04:03:03 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-03-25 06:47:04 +0530 |
commit | a60d688973e8903015f6e4b157332c5c98562f55 (patch) | |
tree | 1fdc8b108bc5af9944d81571f0b8dc8dd053f571 /mesonbuild/interpreter.py | |
parent | fb809e79e55160e519be6bafc222c6ba00573793 (diff) | |
download | meson-a60d688973e8903015f6e4b157332c5c98562f55.zip meson-a60d688973e8903015f6e4b157332c5c98562f55.tar.gz meson-a60d688973e8903015f6e4b157332c5c98562f55.tar.bz2 |
wrap: Initialize subprojects that are git submodules
This will benefit projects such as GNOME Recipes that prefer using
submodules over wraps because it's easier to maintain since git is
aware of it, and because it integrates with their existing
workflow. Without this, these projects have to manually initialize
the submodules which is completely unnecessary.
Closes https://github.com/mesonbuild/meson/issues/1449
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 79a531d..f9c1579 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1498,11 +1498,13 @@ class Interpreter(InterpreterBase): raise InvalidCode('Recursive include of subprojects: %s.' % incpath) if dirname in self.subprojects: return self.subprojects[dirname] - r = wrap.Resolver(os.path.join(self.build.environment.get_source_dir(), self.subproject_dir)) - resolved = r.resolve(dirname) - if resolved is None: - msg = 'Subproject directory {!r} does not exist and cannot be downloaded.' - raise InterpreterException(msg.format(os.path.join(self.subproject_dir, dirname))) + subproject_dir_abs = os.path.join(self.environment.get_source_dir(), self.subproject_dir) + r = wrap.Resolver(subproject_dir_abs) + try: + resolved = r.resolve(dirname) + except RuntimeError as e: + msg = 'Subproject directory {!r} does not exist and cannot be downloaded:\n{}' + raise InterpreterException(msg.format(os.path.join(self.subproject_dir, dirname), e)) subdir = os.path.join(self.subproject_dir, resolved) os.makedirs(os.path.join(self.build.environment.get_build_dir(), subdir), exist_ok=True) self.args_frozen = True |