build script: avoid downloading when source path is specified explicitly

This commit is contained in:
alexey.lysiuk 2021-01-09 11:37:15 +02:00
parent 562c4b5343
commit 0db9b43984

View file

@ -1832,9 +1832,11 @@ class Builder(object):
if arguments.target: if arguments.target:
self.target = self.targets[arguments.target] self.target = self.targets[arguments.target]
self.source_path = self.root_source_path + self.target.name + os.sep self.source_path = self.root_source_path + self.target.name + os.sep
self.external_source = False
else: else:
assert arguments.source_path assert arguments.source_path
self.source_path = arguments.source_path + os.sep self.source_path = arguments.source_path + os.sep
self.external_source = True
self._detect_target() self._detect_target()
if not self.build_path: if not self.build_path:
@ -2259,6 +2261,9 @@ class Builder(object):
subprocess.check_call(args, cwd=extract_path) subprocess.check_call(args, cwd=extract_path)
def download_source(self, url: str, checksum: str): def download_source(self, url: str, checksum: str):
if self.external_source:
return
os.makedirs(self.source_path, exist_ok=True) os.makedirs(self.source_path, exist_ok=True)
data, filepath = self._read_source_package(url) data, filepath = self._read_source_package(url)