From 496d90f70a58c0040f8493aa8a5e4e2f106bfac7 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Wed, 11 May 2022 12:33:31 +0200 Subject: make it easier to reuse/cache foreign package files when building a Hydrilla source package multiple times --- src/hydrilla/builder/local_apt.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/hydrilla/builder/local_apt.py b/src/hydrilla/builder/local_apt.py index 1bdc347..3bec08b 100644 --- a/src/hydrilla/builder/local_apt.py +++ b/src/hydrilla/builder/local_apt.py @@ -286,7 +286,7 @@ def local_apt(list: SourcesList, keys: [str]) -> Iterable[Apt]: yield setup_local_apt(td, list, keys) def download_apt_packages(list: SourcesList, keys: [str], packages: [str], - destination_dir: Path, with_deps=False) -> [str]: + destination_dir: Path, with_deps: bool) -> [str]: """ Set up a local APT, update it using the specified sources.list configuration and use it to download the specified packages. @@ -380,7 +380,11 @@ def piggybacked_system(piggyback_def: dict, foreign_packages: Optional[Path]) \ if foreign_packages is None: archives = td / 'archives' archives.mkdir() + else: + archives = foreign_packages / 'apt' + archives.mkdir(exist_ok=True) + if [*archives.glob('*.deb')] == []: sources_list = SourcesList(piggyback_def.get('sources_list', []), piggyback_def.get('distribution')) packages = piggyback_def['packages'] @@ -397,8 +401,6 @@ def piggybacked_system(piggyback_def: dict, foreign_packages: Optional[Path]) \ destination_dir=archives, with_deps=with_deps ) - else: - archives = foreign_packages / 'apt' for deb in archives.glob('*.deb'): command = ['dpkg-deb', '-x', str(deb), str(root)] -- cgit v1.2.3