diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-01-31 11:21:02 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-01-31 11:21:02 +0100 |
commit | c7ed2c0e34546e12a035e4c4c2f034a6ee765748 (patch) | |
tree | dcfd5eb735b8ea547142be68f993a3f555ecb0b0 /apt-pkg/depcache.cc | |
parent | 3102af74e7ffaab3f47741c05451ce7f0e3b38fe (diff) | |
parent | b9ed63d39e8771f42ec74e3ad401b7c1e846b206 (diff) |
merged from lp:~donkult/apt/experimental/
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 /*{{{*/ |