From 848fd2a65fa2aef296d44c9a19b89ac272ca12fe Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 27 Aug 2015 00:28:47 +0200 Subject: install: Set a local deb as the candidate for that package This ensures that we can install .deb files that are not the candidate for a given package. --- apt-private/private-install.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'apt-private') diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index 844fcbc7e..3647ca99d 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -675,6 +675,18 @@ bool DoInstall(CommandLine &CmdL) std::map verset; + for (const char **I = CmdL.FileList; *I != 0; I++) { + // Check for local pkgs like in the loop above. + if(!FileExists(*I) || flExtension(*I) != "deb") + continue; + + pkgCache::PkgIterator pkg = Cache->FindPkg(*I); + + // Set any version providing the .deb as the candidate. + for (auto Prv = pkg.ProvidesList(); Prv.end() == false; Prv++) + Cache.GetDepCache()->SetCandidateVersion(Prv.OwnerVer()); + } + if(!DoCacheManipulationFromCommandLine(CmdL, Cache, verset, 0)) return false; -- cgit v1.2.3