aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/builder/local_apt.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-10-11 10:26:55 +0200
committerWojtek Kosior <koszko@koszko.org>2022-10-11 13:12:11 +0200
commit0c8d70daae4c4dfc989edad465db94ffc665416d (patch)
tree86f1b23e863b2dae1efd00686d46890b4b72ccb2 /src/hydrilla/builder/local_apt.py
parent9074d98f711b6ccc099df8bccb1ed28390bcf0da (diff)
downloadhaketilo-hydrilla-0c8d70daae4c4dfc989edad465db94ffc665416d.tar.gz
haketilo-hydrilla-0c8d70daae4c4dfc989edad465db94ffc665416d.zip
[builder][server] restore compatibility with python 3.7
Diffstat (limited to 'src/hydrilla/builder/local_apt.py')
-rw-r--r--src/hydrilla/builder/local_apt.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/hydrilla/builder/local_apt.py b/src/hydrilla/builder/local_apt.py
index 925fd61..385a533 100644
--- a/src/hydrilla/builder/local_apt.py
+++ b/src/hydrilla/builder/local_apt.py
@@ -143,7 +143,7 @@ class SourcesList:
"""Representation of apt's sources.list contents."""
def __init__(
self,
- list: list[str] = [],
+ list: t.List[str] = [],
codename: t.Optional[str] = None
) -> None:
"""Initialize this SourcesList."""
@@ -187,7 +187,7 @@ pkgCacheGen::Essential "none";
Dir::Etc::Trusted "{directory}/etc/trusted.gpg";
'''
-def apt_keyring(keys: list[str]) -> bytes:
+def apt_keyring(keys: t.List[str]) -> bytes:
"""
Download the requested keys if necessary and export them as a keyring
suitable for passing to APT.
@@ -234,7 +234,8 @@ def cache_apt_root(apt_root: Path, destination_zip: Path) -> None:
if temporary_zip_path is not None and temporary_zip_path.exists():
temporary_zip_path.unlink()
-def setup_local_apt(directory: Path, list: SourcesList, keys: list[str]) -> Apt:
+def setup_local_apt(directory: Path, list: SourcesList, keys: t.List[str]) \
+ -> Apt:
"""
Create files and directories necessary for running APT without root rights
inside 'directory'.
@@ -282,7 +283,7 @@ def setup_local_apt(directory: Path, list: SourcesList, keys: list[str]) -> Apt:
return apt
@contextmanager
-def local_apt(list: SourcesList, keys: list[str]) -> t.Iterator[Apt]:
+def local_apt(list: SourcesList, keys: t.List[str]) -> t.Iterator[Apt]:
"""
Create a temporary directory with proper local APT configuration in it.
Yield an Apt object that can be used to issue apt-get commands.
@@ -296,11 +297,11 @@ def local_apt(list: SourcesList, keys: list[str]) -> t.Iterator[Apt]:
def download_apt_packages(
list: SourcesList,
- keys: list[str],
- packages: list[str],
+ keys: t.List[str],
+ packages: t.List[str],
destination_dir: Path,
with_deps: bool
-) -> list[str]:
+) -> t.List[str]:
"""
Set up a local APT, update it using the specified sources.list configuration
and use it to download the specified packages.