diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 02:48:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 02:48:09 +0000 |
commit | 4d72383e52dc7708fe5e3d9911733c1a10b27949 (patch) | |
tree | 1ca877f9fa4d082c476f24b83d3dde386e5993c7 /apt-private/private-install.cc | |
parent | Adding upstream version 2.9.3. (diff) | |
download | apt-4d72383e52dc7708fe5e3d9911733c1a10b27949.tar.xz apt-4d72383e52dc7708fe5e3d9911733c1a10b27949.zip |
Adding upstream version 2.9.4.upstream/2.9.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'apt-private/private-install.cc')
-rw-r--r-- | apt-private/private-install.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 4f71f18..599caac 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -658,6 +658,24 @@ bool DoAutomaticRemove(CacheFile &Cache) if (not Cache->VS().CheckDep(PVerStr, R->CompareOp, R.TargetVer())) continue; } + // ignore new providers if we have installed providers + if (Pkg->CurrentVer == 0) + { + std::unique_ptr<pkgCache::Version *[]> VList(R.AllTargets()); + bool has_installed_alt_prov = false; + for (pkgCache::Version **V = VList.get(); *V != 0; ++V) + { + pkgCache::VerIterator Ver(Cache, *V); + auto const P = Ver.ParentPkg(); + if (not P.end() && P->CurrentVer != 0 && Cache[P].InstallVer == *V) + { + has_installed_alt_prov = true; + break; + } + } + if (has_installed_alt_prov) + continue; + } if (Debug == true) std::clog << "Save " << APT::PrettyPkg(Cache, Pkg) << " as another installed package depends on it: " << APT::PrettyPkg(Cache, RP) << std::endl; Cache->MarkInstall(Pkg, false, 0, false); |