aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/wrap/wrap.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/wrap/wrap.py')
-rw-r--r--mesonbuild/wrap/wrap.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py
index ad2e3e4..fcacc16 100644
--- a/mesonbuild/wrap/wrap.py
+++ b/mesonbuild/wrap/wrap.py
@@ -18,6 +18,7 @@ import urllib.request, os, hashlib, shutil
import subprocess
import sys
from pathlib import Path
+from . import WrapMode
try:
import ssl
@@ -94,7 +95,8 @@ class PackageDefinition:
return 'patch_url' in self.values
class Resolver:
- def __init__(self, subdir_root):
+ def __init__(self, subdir_root, wrap_mode=WrapMode(1)):
+ self.wrap_mode = wrap_mode
self.subdir_root = subdir_root
self.cachedir = os.path.join(self.subdir_root, 'packagecache')
@@ -120,6 +122,12 @@ class Resolver:
if self.resolve_git_submodule(dirname):
return packagename
+ # Don't download subproject data based on wrap file if requested.
+ # Git submodules are ok (see above)!
+ if self.wrap_mode is WrapMode.nodownload:
+ m = 'Automatic wrap-based subproject downloading is disabled'
+ raise RuntimeError(m)
+
# Check if there's a .wrap file for this subproject
fname = os.path.join(self.subdir_root, packagename + '.wrap')
if not os.path.isfile(fname):