diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2025-02-04 16:30:29 +0100 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2025-02-07 19:58:00 +0000 |
| commit | 672244d46644a26f4659376d88a9899663d20d1d (patch) | |
| tree | 7ab9b4a7a461caf29b0a00dd0d1bf431308f8c65 /apt-pkg | |
| parent | 4608f1601c7eb6f6363399fdf58462c7edb077be (diff) | |
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
Diffstat (limited to 'apt-pkg')
| -rw-r--r-- | apt-pkg/deb/debsystem.cc | 7 |
1 files changed, 7 insertions, 0 deletions
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<std::string> 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; } /*}}}*/ |
