diff --git a/docs/markdown/Release-notes-for-0.48.0.md b/docs/markdown/Release-notes-for-0.48.0.md index d8dbeac19b4f..32b158a95e07 100644 --- a/docs/markdown/Release-notes-for-0.48.0.md +++ b/docs/markdown/Release-notes-for-0.48.0.md @@ -310,7 +310,7 @@ files get exported. To enable this, the following needs to be added to the `.wrap` file: ```ini -clone-recursive=true +clone-recursive = true ``` ## `subproject()` function now supports the `required:` kwarg diff --git a/docs/markdown/Wrap-dependency-system-manual.md b/docs/markdown/Wrap-dependency-system-manual.md index 73358e7cfc2f..5733d1b7e744 100644 --- a/docs/markdown/Wrap-dependency-system-manual.md +++ b/docs/markdown/Wrap-dependency-system-manual.md @@ -135,7 +135,7 @@ case, the directory will be copied into `subprojects/` before applying patches. - `push-url` - alternative url to configure as a git push-url. Useful if the subproject will be developed and changes pushed upstream. *(since 0.37.0)* -- `clone-recursive` - also clone submodules of the repository +- `clone-recursive = true` - also clone submodules of the repository *(since 0.48.0)* ## wrap-file with Meson build patch diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index 7aae1663fd1f..5ed90488dc20 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -600,6 +600,9 @@ def _get_git(self, packagename: str) -> None: if self.wrap.values.get('depth', '') != '': is_shallow = True depth_option = ['--depth', self.wrap.values.get('depth')] + clone_recursive_val = self.wrap.values.get('clone-recursive', '').lower() + if clone_recursive_val and clone_recursive_val not in ['false', 'true']: + raise WrapException(f"clone-recursive: invalid value '{clone_recursive_val}' (use 'true' or 'false')") # for some reason git only allows commit ids to be shallowly fetched by fetch not with clone if is_shallow and self.is_git_full_commit_id(revno): # git doesn't support directly cloning shallowly for commits, @@ -622,7 +625,7 @@ def _get_git(self, packagename: str) -> None: args += ['--branch', revno] args += [self.wrap.get('url'), self.directory] verbose_git(args, self.subdir_root, check=True) - if self.wrap.values.get('clone-recursive', '').lower() == 'true': + if clone_recursive_val == 'true': verbose_git(['submodule', 'update', '--init', '--checkout', '--recursive', *depth_option], self.dirname, check=True) push_url = self.wrap.values.get('push-url')