) -> None:
cmd = apivfs_cmd(state.root) if apivfs else []
bwrap(cmd + apt_cmd(state, command) + [operation, *sort_packages(packages)],
- options=flatten(["--bind", d, d] for d in (state.config.workspace_dir, state.config.cache_dir) if d),
+ # dpkg doesn't seem to unset TMPDIR when chrooting so we unset it for dpkg.
+ options=["--unsetenv", "TMPDIR"] + flatten(["--bind", d, d] for d in (state.config.workspace_dir, state.config.cache_dir) if d),
network=True, env=state.config.environment)
LANG="C.UTF-8",
) | env
+ if "TMPDIR" in os.environ:
+ env["TMPDIR"] = os.environ["TMPDIR"]
+
if ARG_DEBUG.get():
env["SYSTEMD_LOG_LEVEL"] = "debug"
"--setenv", "container", "mkosi",
"--setenv", "HOME", "/",
"--setenv", "PATH", "/usr/bin:/usr/sbin",
+ "--unsetenv", "TMPDIR",
]
resolve = Path("etc/resolv.conf")