From: Daan De Meyer Date: Tue, 18 Apr 2023 14:53:46 +0000 (+0200) Subject: debian: Stop setting DPkg::Path X-Git-Tag: v15~237^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7efc75001e37d29c898573943297b71e5d25cb1;p=thirdparty%2Fmkosi.git debian: Stop setting DPkg::Path While this achieved the desired effect of dpkg being looked up in the PATH, it also modified the PATH variable for everything executed by dpkg, which we don't want. Let's just lookup dpkg in PATH before running apt and put the result in Dir::Bin::dpkg which looks up dpkg in the PATH without modifying the PATH used by dpkg itself. Fixes #1456 --- diff --git a/mkosi/distributions/debian.py b/mkosi/distributions/debian.py index 6d1101320..3ca907759 100644 --- a/mkosi/distributions/debian.py +++ b/mkosi/distributions/debian.py @@ -1,6 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1+ import os +import shutil import subprocess import tempfile from collections.abc import Sequence @@ -202,8 +203,7 @@ def setup_apt(state: MkosiState, repos: Sequence[str]) -> None: Dir::Etc::trusted "/usr/share/keyrings/{state.config.release}-archive-keyring"; Dir::Etc::trustedparts "/usr/share/keyrings"; Dir::Log "{state.workspace / "apt/log"}"; - Dir::Bin::dpkg "dpkg"; - DPkg::Path "{os.environ["PATH"]}"; + Dir::Bin::dpkg "{shutil.which("dpkg")}"; DPkg::Options:: "--root={state.root}"; DPkg::Options:: "--log={state.workspace / "apt/dpkg.log"}"; DPkg::Options:: "--force-unsafe-io";