diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2020-09-09 10:57:32 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2020-09-10 11:39:30 -0400 |
commit | 14c1a6983d8cabd2382b750dd53d004d16449832 (patch) | |
tree | efd1e5881feed53bb97b132069c977e4062805eb /mesonbuild/wrap | |
parent | a3ac25b0c3b1d671090acb14273af7d942bf07ce (diff) | |
download | meson-14c1a6983d8cabd2382b750dd53d004d16449832.zip meson-14c1a6983d8cabd2382b750dd53d004d16449832.tar.gz meson-14c1a6983d8cabd2382b750dd53d004d16449832.tar.bz2 |
msubprojects: Allow comma separated list of types
Diffstat (limited to 'mesonbuild/wrap')
-rw-r--r-- | mesonbuild/wrap/wrap.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index 969c82d..98b30ee 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -49,6 +49,8 @@ REQ_TIMEOUT = 600.0 SSL_WARNING_PRINTED = False WHITELIST_SUBDOMAIN = 'wrapdb.mesonbuild.com' +ALL_TYPES = ['file', 'git', 'hg', 'svn'] + def whitelist_wrapdb(urlstr: str) -> urllib.parse.ParseResult: """ raises WrapException if not whitelisted subdomain """ url = urllib.parse.urlparse(urlstr) @@ -106,6 +108,8 @@ class PackageDefinition: self.directory = self.values.get('directory', self.name) if os.path.dirname(self.directory): raise WrapException('Directory key must be a name and not a path') + if self.type and self.type not in ALL_TYPES: + raise WrapException('Unknown wrap type {!r}'.format(self.type)) def guess_type(self) -> None: if os.path.exists(os.path.join(self.filename, '.git')): |