From 672244d46644a26f4659376d88a9899663d20d1d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 4 Feb 2025 16:30:29 +0100 Subject: dpkg: Pass --admindir if a different one is specified Otherwise if we set e.g. Dir, we end up with the foreign architectures from the host which is wrong. Fixes: 8e6a86aa3bc6d5a9013bb42fccea9bbce3fd97e2 --- apt-pkg/deb/debsystem.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/deb/debsystem.cc b/apt-pkg/deb/debsystem.cc index 749969759..90b893fee 100644 --- a/apt-pkg/deb/debsystem.cc +++ b/apt-pkg/deb/debsystem.cc @@ -420,6 +420,13 @@ std::vector debSystem::GetDpkgBaseCommand() /*{{{*/ Args.push_back(Opts->Value); } } + auto status = _config->FindFile("Dir::State::status"); + auto admindir = StripDpkgChrootDirectory(flNotFile(status)); + if (admindir != "/var/lib/dpkg/") + { + Args.push_back("--admindir"); + Args.push_back(admindir); + } return Args; } /*}}}*/ -- cgit v1.2.3-70-g09d2