Procházet zdrojové kódy

check in the DepCache::SetCandidateVersion that the package is marked to
be installed before setting the InstallVer as otherwise the Sizes states
will be confused in some cases - this can happen now as SetCandidateRelease
works also on packages which are not installed now (or will never in the
final solution)

David Kalnischkies před 15 roky
rodič
revize
758729c808
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      apt-pkg/depcache.cc

+ 2 - 1
apt-pkg/depcache.cc

@@ -1523,7 +1523,7 @@ void pkgDepCache::SetCandidateVersion(VerIterator TargetVer, bool const &Pseudo)
    RemoveSizes(Pkg);
    RemoveStates(Pkg);
 
-   if (P.CandidateVer == P.InstallVer)
+   if (P.CandidateVer == P.InstallVer && P.Install() == true)
       P.InstallVer = (Version *)TargetVer;
    P.CandidateVer = (Version *)TargetVer;
    P.Update(Pkg,*this);
@@ -1570,6 +1570,7 @@ bool pkgDepCache::SetCandidateRelease(pkgCache::VerIterator TargetVer,
 					std::string const &TargetRel,
 					std::list<std::pair<pkgCache::VerIterator, pkgCache::VerIterator> > &Changed)
 {
+   ActionGroup group(*this);
    SetCandidateVersion(TargetVer);
 
    if (TargetRel == "installed" || TargetRel == "candidate") // both doesn't make sense in this context