summaryrefslogtreecommitdiff
path: root/src/hydrilla
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-05-11 12:33:31 +0200
committerWojtek Kosior <koszko@koszko.org>2022-05-11 12:33:31 +0200
commit496d90f70a58c0040f8493aa8a5e4e2f106bfac7 (patch)
treeaf6ace104ad9a02f2fb15820dd6ea3469d4577d5 /src/hydrilla
parent9e2cd3a25b6ff5addd7109414fdf5a535b9cbce3 (diff)
downloadhydrilla-builder-496d90f70a58c0040f8493aa8a5e4e2f106bfac7.tar.gz
hydrilla-builder-496d90f70a58c0040f8493aa8a5e4e2f106bfac7.zip
make it easier to reuse/cache foreign package files when building a Hydrilla source package multiple times
Diffstat (limited to 'src/hydrilla')
-rw-r--r--src/hydrilla/builder/local_apt.py8
1 files changed, 5 insertions, 3 deletions
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)]