diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:54:58 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:54:58 +0000 |
commit | d0c59649c2d9194ffb8432e553851322fa3f4933 (patch) | |
tree | cf29ee5a05f90f0f98938e7d87f04c6312243f05 /apt-pkg/depcache.cc | |
parent | 648e3cb48955f82ce2e34c67eb9eefb76138a3b3 (diff) |
Reinstall command
Author: jgg
Date: 1999-10-22 05:58:54 GMT
Reinstall command
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r-- | apt-pkg/depcache.cc | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 7b7d0b29d..707cb93cd 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: depcache.cc,v 1.20 1999/09/09 06:08:45 jgg Exp $ +// $Id: depcache.cc,v 1.21 1999/10/22 05:58:54 jgg Exp $ /* ###################################################################### Dependency Cache - Caches Dependency information. @@ -216,8 +216,9 @@ void pkgDepCache::AddSizes(const PkgIterator &Pkg,long Mult) } // Upgrading - if (Pkg->CurrentVer != 0 && P.InstallVer != (Version *)Pkg.CurrentVer() && - P.InstallVer != 0) + if (Pkg->CurrentVer != 0 && + (P.InstallVer != (Version *)Pkg.CurrentVer() || + (P.iFlags & ReInstall) == ReInstall) && P.InstallVer != 0) { iUsrSize += Mult*((signed)P.InstVerIter(*this)->InstalledSize - (signed)Pkg.CurrentVer()->InstalledSize); @@ -275,9 +276,13 @@ void pkgDepCache::AddStates(const PkgIterator &Pkg,int Add) // Installed, no upgrade if (State.Upgradable() == false) - { + { if (State.Mode == ModeDelete) iDelCount += Add; + else + if ((State.iFlags & ReInstall) == ReInstall) + iInstCount += Add; + return; } @@ -703,7 +708,24 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst) } } /*}}}*/ - +// DepCache::SetReInstall - Set the reinstallation flag /*{{{*/ +// --------------------------------------------------------------------- +/* */ +void pkgDepCache::SetReInstall(PkgIterator const &Pkg,bool To) +{ + RemoveSizes(Pkg); + RemoveStates(Pkg); + + StateCache &P = PkgState[Pkg->ID]; + if (To == true) + P.iFlags |= ReInstall; + else + P.iFlags &= ~ReInstall; + + AddStates(Pkg); + AddSizes(Pkg); +} + /*}}}*/ // StateCache::Update - Compute the various static display things /*{{{*/ // --------------------------------------------------------------------- /* This is called whenever the Candidate version changes. */ |