diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:52:15 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:52:15 +0000 |
commit | 3c124dde9567dd8c45d271bf2eaadffa5754f7d9 (patch) | |
tree | 0cefe5aba28047b08601f43a0f964b9a34cd9cdc /apt-pkg/pkgcache.cc | |
parent | 0dbb95d810308d8dd102fba0303eed657f9f1cd2 (diff) |
Supports no automatic
Author: jgg
Date: 1998-12-14 08:07:28 GMT
Supports no automatic
Diffstat (limited to 'apt-pkg/pkgcache.cc')
-rw-r--r-- | apt-pkg/pkgcache.cc | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index ac1de021a..8ad501e96 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: pkgcache.cc,v 1.21 1998/12/14 03:39:15 jgg Exp $ +// $Id: pkgcache.cc,v 1.22 1998/12/14 08:07:29 jgg Exp $ /* ###################################################################### Package Cache - Accessor code for the cache @@ -438,6 +438,36 @@ const char *pkgCache::VerIterator::PriorityType() return ""; } /*}}}*/ +// VerIterator::Automatic - Check if this version is 'automatic' /*{{{*/ +// --------------------------------------------------------------------- +/* This checks to see if any of the versions files are not NotAutomatic. + True if this version is selectable for automatic installation. */ +bool pkgCache::VerIterator::Automatic() const +{ + VerFileIterator Files = FileList(); + for (; Files.end() == false; Files++) + if ((Files.File()->Flags & pkgCache::Flag::NotAutomatic) != pkgCache::Flag::NotAutomatic) + return true; + return false; +} + /*}}}*/ +// VerIterator::NewestFile - Return the newest file version relation /*{{{*/ +// --------------------------------------------------------------------- +/* This looks at the version numbers associated with all of the sources + this version is in and returns the highest.*/ +pkgCache::VerFileIterator pkgCache::VerIterator::NewestFile() const +{ + VerFileIterator Files = FileList(); + VerFileIterator Highest = Files; + for (; Files.end() == false; Files++) + { + if (pkgVersionCompare(Files.File().Version(),Highest.File().Version()) > 0) + Highest = Files; + } + + return Highest; +} + /*}}}*/ // PkgFileIterator::IsOk - Checks if the cache is in sync with the file /*{{{*/ // --------------------------------------------------------------------- /* This stats the file and compares its stats with the ones that were |