Merge pull request #134 from kiwix/skip_download

Skip download
This commit is contained in:
Matthieu Gautier 2018-03-21 11:54:33 +01:00 committed by GitHub
commit 9d24bcdf81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -111,6 +111,7 @@ class ReleaseDownload(Source):
return pj(self.buildEnv.source_dir, self.source_dir) return pj(self.buildEnv.source_dir, self.source_dir)
def _download(self, context): def _download(self, context):
context.try_skip(self.buildEnv.archive_dir, self.name)
self.buildEnv.download(self.archive) self.buildEnv.download(self.archive)
def _extract(self, context): def _extract(self, context):

View File

@ -111,7 +111,7 @@ def make_deps_archive(target, full=False):
relative_path = BASE_DIR relative_path = BASE_DIR
if full: if full:
files_to_archive += [ARCHIVE_DIR] files_to_archive += ARCHIVE_DIR.glob(".*_ok")
files_to_archive += BASE_DIR.glob('*/.*_ok') files_to_archive += BASE_DIR.glob('*/.*_ok')
files_to_archive += SOURCE_DIR.glob('*/.*_ok') files_to_archive += SOURCE_DIR.glob('*/.*_ok')
files_to_archive += [SOURCE_DIR/'pugixml-{}'.format( files_to_archive += [SOURCE_DIR/'pugixml-{}'.format(

View File

@ -137,8 +137,10 @@ class Context:
self.force_native_build = force_native_build self.force_native_build = force_native_build
self.autoskip_file = None self.autoskip_file = None
def try_skip(self, path): def try_skip(self, path, extra_name=""):
self.autoskip_file = pj(path, ".{}_ok".format(self.command_name)) if extra_name:
extra_name = "_{}".format(extra_name)
self.autoskip_file = pj(path, ".{}{}_ok".format(self.command_name, extra_name))
if os.path.exists(self.autoskip_file): if os.path.exists(self.autoskip_file):
raise SkipCommand() raise SkipCommand()