]> git.saurik.com Git - apt.git/commitdiff
Supports no automatic
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:52:15 +0000 (16:52 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:52:15 +0000 (16:52 +0000)
Author: jgg
Date: 1998-12-14 08:07:28 GMT
Supports no automatic

apt-pkg/cacheiterators.h
apt-pkg/deb/deblistparser.cc
apt-pkg/depcache.cc
apt-pkg/pkgcache.cc
apt-pkg/pkgcache.h

index c5b4b14c093fd573e8b9f1f119db182cab57ef07..1de574634239f741cf1ad4ab8da31768b383b027 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: cacheiterators.h,v 1.10 1998/12/14 02:23:46 jgg Exp $
+// $Id: cacheiterators.h,v 1.11 1998/12/14 08:07:28 jgg Exp $
 /* ######################################################################
    
    Cache Iterators - Iterators for navigating the cache structure
@@ -127,7 +127,10 @@ class pkgCache::VerIterator
    inline unsigned long Index() const {return Ver - Owner.VerP;};
    bool Downloadable() const;
    const char *PriorityType();
-   
+
+   bool Automatic() const;
+   VerFileIterator NewestFile() const;
+      
    inline VerIterator(pkgCache &Owner,Version *Trg = 0) : Ver(Trg), Owner(Owner) 
    { 
       if (Ver == 0)
index 585006451f0df7ccaba2c4f9de97964d1a91675e..669c5cd50e3cdb69fd5bff0126d85bb63504db13 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: deblistparser.cc,v 1.12 1998/12/14 06:54:43 jgg Exp $
+// $Id: deblistparser.cc,v 1.13 1998/12/14 08:07:29 jgg Exp $
 /* ######################################################################
    
    Package Cache Generator - Generator for the cache structure.
@@ -469,10 +469,9 @@ bool debListParser::LoadReleaseInfo(pkgCache::PkgFileIterator FileI,
    if (Section.Find("Architecture",Start,Stop) == true)
       FileI->Architecture = WriteUniqString(Start,Stop - Start);
    
-   unsigned long Fl = 0;
-   if (Section.FindFlag("NotAutomatic",Fl,1) == false)
+   if (Section.FindFlag("NotAutomatic",FileI->Flags,
+                       pkgCache::Flag::NotAutomatic) == false)
       _error->Warning("Bad NotAutomatic flag");
-   FileI->NotAutomatic = Fl;
    
    return !_error->PendingError();
 }
index eb9d5a35be97b1edb9dd412fa19ba5fd3a2a2bec..cd3597ef758db478d1ed308d20274d4b7375f202 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: depcache.cc,v 1.11 1998/12/10 04:22:45 jgg Exp $
+// $Id: depcache.cc,v 1.12 1998/12/14 08:07:29 jgg Exp $
 /* ######################################################################
 
    Dependency Cache - Caches Dependency information.
@@ -104,14 +104,15 @@ pkgDepCache::VerIterator pkgDepCache::GetCandidateVer(PkgIterator Pkg)
    // Try to use an explicit target
    if (Pkg->TargetVer == 0)
    {
-      /* Not source versions cannot be a candidate version unless they
-         are already installed */
+      /* 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)
+           if ((J.File()->Flags & Flag::NotSource) == 0 &&
+               (J.File()->Flags & Flag::NotAutomatic) == 0)
                return I;
       }
         
index ac1de021aafce35dba9cacee02524db08d4de29a..8ad501e96ff4bc3fc4fc23200e15216b6cfca1cd 100644 (file)
@@ -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
index f959f42333fc2d1a2192eb3298e755e7fd1f5b4b..2d174cc0103f9d5cb84c55982c11a9be28f69b40 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: pkgcache.h,v 1.14 1998/12/14 03:39:15 jgg Exp $
+// $Id: pkgcache.h,v 1.15 1998/12/14 08:07:29 jgg Exp $
 /* ######################################################################
    
    Cache - Structure definitions for the cache file
@@ -82,7 +82,7 @@ class pkgCache
    {
       enum PkgFlags {Auto=(1<<0),New=(1<<1),Obsolete=(1<<2),Essential=(1<<3),
         ImmediateConf=(1<<4)};
-      enum PkgFFlags {NotSource=(1<<0)};
+      enum PkgFFlags {NotSource=(1<<0),NotAutomatic=(1<<1)};
    };
    
    protected:
@@ -207,13 +207,11 @@ struct pkgCache::PackageFile
    __apt_ptrloc Label;           // Stringtable
    __apt_ptrloc Architecture;    // Stringtable
    unsigned long Size;            
-   unsigned char NotAutomatic;   // Bool
-
+   unsigned long Flags;
    
    // Linked list
    __apt_ptrloc NextFile;        // PackageFile
    unsigned short ID;
-   unsigned long Flags;
    time_t mtime;                  // Modification time for the file
 };