diff options
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r-- | apt-pkg/depcache.cc | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 085159711..9449c7306 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1240,19 +1240,36 @@ void pkgDepCache::SetReInstall(PkgIterator const &Pkg,bool To) if (unlikely(Pkg.end() == true)) return; + APT::PackageList pkglist; + if (Pkg->CurrentVer != 0 && + (Pkg.CurrentVer()-> MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same) + { + pkgCache::GrpIterator Grp = Pkg.Group(); + for (pkgCache::PkgIterator P = Grp.PackageList(); P.end() == false; P = Grp.NextPkg(P)) + { + if (P->CurrentVer != 0) + pkglist.insert(P); + } + } + else + pkglist.insert(Pkg); + ActionGroup group(*this); - RemoveSizes(Pkg); - RemoveStates(Pkg); - - StateCache &P = PkgState[Pkg->ID]; - if (To == true) - P.iFlags |= ReInstall; - else - P.iFlags &= ~ReInstall; - - AddStates(Pkg); - AddSizes(Pkg); + for (APT::PackageList::const_iterator Pkg = pkglist.begin(); Pkg != pkglist.end(); ++Pkg) + { + RemoveSizes(Pkg); + RemoveStates(Pkg); + + StateCache &P = PkgState[Pkg->ID]; + if (To == true) + P.iFlags |= ReInstall; + else + P.iFlags &= ~ReInstall; + + AddStates(Pkg); + AddSizes(Pkg); + } } /*}}}*/ // DepCache::SetCandidateVersion - Change the candidate version /*{{{*/ |