Project

General

Profile

« Previous | Next » 

Revision 496d90f7

Added by koszko over 1 year ago

make it easier to reuse/cache foreign package files when building a Hydrilla source package multiple times

View differences:

src/hydrilla/builder/local_apt.py
286 286
        yield setup_local_apt(td, list, keys)
287 287

  
288 288
def download_apt_packages(list: SourcesList, keys: [str], packages: [str],
289
                          destination_dir: Path, with_deps=False) -> [str]:
289
                          destination_dir: Path, with_deps: bool) -> [str]:
290 290
    """
291 291
    Set up a local APT, update it using the specified sources.list configuration
292 292
    and use it to download the specified packages.
......
380 380
        if foreign_packages is None:
381 381
            archives = td / 'archives'
382 382
            archives.mkdir()
383
        else:
384
            archives = foreign_packages / 'apt'
385
            archives.mkdir(exist_ok=True)
383 386

  
387
        if [*archives.glob('*.deb')] == []:
384 388
            sources_list = SourcesList(piggyback_def.get('sources_list', []),
385 389
                                       piggyback_def.get('distribution'))
386 390
            packages = piggyback_def['packages']
......
397 401
                destination_dir=archives,
398 402
                with_deps=with_deps
399 403
            )
400
        else:
401
            archives = foreign_packages / 'apt'
402 404

  
403 405
        for deb in archives.glob('*.deb'):
404 406
            command = ['dpkg-deb', '-x', str(deb), str(root)]

Also available in: Unified diff