From 8cf6c39d11affdfe0d382cc4be6a07d007b69937 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 25 Oct 2023 14:12:05 +0200 Subject: [PATCH] Extend `ReleaseDownload` source to be composed of several archives. --- kiwixbuild/dependencies/base.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/kiwixbuild/dependencies/base.py b/kiwixbuild/dependencies/base.py index 68b8a81b..c0d6e931 100644 --- a/kiwixbuild/dependencies/base.py +++ b/kiwixbuild/dependencies/base.py @@ -110,22 +110,28 @@ def prepare(self): class ReleaseDownload(Source): archive_top_dir = None + @property + def archives(self): + return (self.archive, ) + @property def extract_path(self): return pj(neutralEnv('source_dir'), self.source_dir) def _download(self, context): context.try_skip(neutralEnv('archive_dir'), self.full_name) - neutralEnv('download')(self.archive) + for archive in self.archives: + neutralEnv('download')(archive) def _extract(self, context): context.try_skip(self.extract_path) if os.path.exists(self.extract_path): shutil.rmtree(self.extract_path) - extract_archive(pj(neutralEnv('archive_dir'), self.archive.name), - neutralEnv('source_dir'), - topdir=self.archive_top_dir, - name=self.source_dir) + for archive in self.archives: + extract_archive(pj(neutralEnv('archive_dir'), archive.name), + neutralEnv('source_dir'), + topdir=self.archive_top_dir, + name=self.source_dir) def prepare(self): self.command('download', self._download)