Skip to content

Commit

Permalink
Extend ReleaseDownload source to be composed of several archives.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgautierfr committed Nov 2, 2023
1 parent 45c5501 commit 8cf6c39
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions kiwixbuild/dependencies/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8cf6c39

Please sign in to comment.