summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:52:20 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:52:20 +0000
commit9df5e357dc87b0567e0bc8691cd830e27080d7cb (patch)
tree1c7423625c95141b6c1ec80df81b783a3cc48c0c /apt-pkg
parent54db103455f0601d4c81e0bb368e602f2e77115c (diff)
Undid bad checkin
Author: jgg Date: 1998-12-22 08:01:04 GMT Undid bad checkin
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/depcache.cc47
1 files changed, 11 insertions, 36 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 19f30b2c1..81127efb9 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.13 1998/12/22 07:58:50 jgg Exp $
+// $Id: depcache.cc,v 1.14 1998/12/22 08:01:04 jgg Exp $
/* ######################################################################
Dependency Cache - Caches Dependency information.
@@ -12,7 +12,6 @@
#pragma implementation "apt-pkg/depcache.h"
#endif
#include <apt-pkg/depcache.h>
-#include <apt-pkg/configuration.h>
#include <apt-pkg/version.h>
#include <apt-pkg/error.h>
@@ -105,40 +104,18 @@ pkgDepCache::VerIterator pkgDepCache::GetCandidateVer(PkgIterator Pkg)
// Try to use an explicit target
if (Pkg->TargetVer == 0)
{
- string DistHack = _config->Find("to");
-
- /* If disthack is set then we look for a dist by that name to install
- from */
- if (DistHack.empty() == false)
- {
- for (VerIterator I = Pkg.VersionList(); I.end() == false; I++)
- {
- for (VerFileIterator J = I.FileList(); J.end() == false; J++)
- if ((J.File()->Flags & Flag::NotSource) == 0 &&
- (J.File()->Flags & Flag::NotAutomatic) == 0 &&
- J.File().Archive() == DistHack)
- return I;
- }
-
- // Hmm, target is current if there is no alternative.
- if (Pkg->CurrentVer != 0)
- return Pkg.CurrentVer();
- }
- else
+ /* Not source/not automatic versions cannot be a candidate version
+ unless they are already installed */
+ for (VerIterator I = Pkg.VersionList(); I.end() == false; I++)
{
- /* Not source/not automatic versions cannot be a candidate version
- unless they are already installed */
- for (VerIterator I = Pkg.VersionList(); I.end() == false; I++)
- {
- if (Pkg.CurrentVer() == I)
- return I;
- for (VerFileIterator J = I.FileList(); J.end() == false; J++)
- if ((J.File()->Flags & Flag::NotSource) == 0 &&
- (J.File()->Flags & Flag::NotAutomatic) == 0)
- return I;
- }
+ if (Pkg.CurrentVer() == I)
+ return I;
+ for (VerFileIterator J = I.FileList(); J.end() == false; J++)
+ if ((J.File()->Flags & Flag::NotSource) == 0 &&
+ (J.File()->Flags & Flag::NotAutomatic) == 0)
+ return I;
}
-
+
return VerIterator(*this,0);
}
else
@@ -311,8 +288,6 @@ void pkgDepCache::AddStates(const PkgIterator &Pkg,int Add)
{
if (State.Mode == ModeDelete)
iDelCount += Add;
- if (State.Mode == ModeInstall)
- iInstCount += Add;
return;
}