diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:53:31 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:53:31 +0000 |
commit | 1fcbfcb8ba78224fd0e4d532d4fa976f0ea00fef (patch) | |
tree | eb6d17fabc08f717f8ba2b4ac24cc2a4253a60a8 /apt-pkg/depcache.cc | |
parent | ee989411b3d28ad7e16aae6b996ee6c803e94d26 (diff) |
Fixed espy's bug with experimental
Author: jgg
Date: 1999-04-12 04:21:20 GMT
Fixed espy's bug with experimental
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r-- | apt-pkg/depcache.cc | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 727f01462..1529eb364 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.15 1999/03/26 07:38:43 jgg Exp $ +// $Id: depcache.cc,v 1.16 1999/04/12 04:21:20 jgg Exp $ /* ###################################################################### Dependency Cache - Caches Dependency information. @@ -99,25 +99,13 @@ bool pkgDepCache::Init(OpProgress *Prog) // --------------------------------------------------------------------- /* The default just returns the target version if it exists or the highest version. */ -pkgDepCache::VerIterator pkgDepCache::GetCandidateVer(PkgIterator Pkg) +pkgDepCache::VerIterator pkgDepCache::GetCandidateVer(PkgIterator Pkg, + bool AllowCurrent) { // Try to use an explicit target - if (Pkg->TargetVer == 0) - { - /* 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; - } - - return VerIterator(*this,0); - } + if (Pkg->TargetVer == 0 || + (AllowCurrent == false && Pkg.TargetVer() == Pkg.CurrentVer())) + return pkgCache::GetCandidateVer(Pkg,AllowCurrent); else return Pkg.TargetVer(); } |