(context.root / d).symlink_to(f"usr/{d}")
(context.root / f"usr/{d}").mkdir(parents=True, exist_ok=True)
- invoke_apt(context, "apt-get", "update", apivfs=False)
+ invoke_apt(context, "update", apivfs=False)
# Next, we invoke apt-get install to download all the essential packages. With DPkg::Pre-Install-Pkgs,
# we specify a shell command that will receive the list of packages that will be installed on stdin.
with tempfile.NamedTemporaryFile(mode="r") as f:
invoke_apt(
context,
- "apt-get",
"install",
[
"-oDebug::pkgDPkgPm=1",
with umask(~0o644):
policyrcd.write_text("#!/bin/sh\nexit 101\n")
- invoke_apt(context, "apt-get", "update", apivfs=False)
- invoke_apt(context, "apt-get", "install", packages, apivfs=apivfs)
+ invoke_apt(context, "update", apivfs=False)
+ invoke_apt(context, "install", packages, apivfs=apivfs)
install_apt_sources(context, cls.repositories(context, local=False))
policyrcd.unlink()
@classmethod
def remove_packages(cls, context: Context, packages: Sequence[str]) -> None:
- invoke_apt(context, "apt-get", "purge", packages)
+ invoke_apt(context, "purge", packages)
@classmethod
def architecture(cls, arch: Architecture) -> str:
def invoke_apt(
context: Context,
- command: str,
operation: str,
packages: Sequence[str] = (),
*,
) -> None:
with finalize_ephemeral_source_mounts(context.config) as sources:
run(
- apt_cmd(context, command) + [operation, *sort_packages(packages)],
+ apt_cmd(context, "apt-get") + [operation, *sort_packages(packages)],
sandbox=(
context.sandbox(
network=True,
return cmdline
-def invoke_dnf(context: Context, command: str, packages: Iterable[str], apivfs: bool = True) -> None:
+def invoke_dnf(context: Context, operation: str, packages: Iterable[str], apivfs: bool = True) -> None:
with finalize_ephemeral_source_mounts(context.config) as sources:
run(
- dnf_cmd(context) + [command, *sort_packages(packages)],
+ dnf_cmd(context) + [operation, *sort_packages(packages)],
sandbox=(
context.sandbox(
network=True,
def invoke_zypper(
context: Context,
- verb: str,
+ operation: str,
packages: Sequence[str] = (),
*,
options: Sequence[str] = (),
) -> None:
with finalize_ephemeral_source_mounts(context.config) as sources:
run(
- zypper_cmd(context) + [verb, *options, *sort_packages(packages)],
+ zypper_cmd(context) + [operation, *options, *sort_packages(packages)],
sandbox=(
context.sandbox(
network=True,