Explorar el Código

Version compare fixes
Author: jgg
Date: 1998-11-27 00:07:23 GMT
Version compare fixes

Arch Librarian hace 22 años
padre
commit
c980716949
Se han modificado 2 ficheros con 17 adiciones y 4 borrados
  1. 4 3
      apt-pkg/cacheiterators.h
  2. 13 1
      apt-pkg/pkgcache.cc

+ 4 - 3
apt-pkg/cacheiterators.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: cacheiterators.h,v 1.8 1998/11/14 07:20:08 jgg Exp $
+// $Id: cacheiterators.h,v 1.9 1998/11/27 00:07:23 jgg Exp $
 /* ######################################################################
 /* ######################################################################
    
    
    Cache Iterators - Iterators for navigating the cache structure
    Cache Iterators - Iterators for navigating the cache structure
@@ -117,7 +117,7 @@ class pkgCache::VerIterator
    inline Version const &operator *() const {return *Ver;};
    inline Version const &operator *() const {return *Ver;};
    inline operator Version *() {return Ver == Owner.VerP?0:Ver;};
    inline operator Version *() {return Ver == Owner.VerP?0:Ver;};
    inline operator Version const *() const {return Ver == Owner.VerP?0:Ver;};
    inline operator Version const *() const {return Ver == Owner.VerP?0:Ver;};
-
+   
    inline const char *VerStr() const {return Ver->VerStr == 0?0:Owner.StrP + Ver->VerStr;};
    inline const char *VerStr() const {return Ver->VerStr == 0?0:Owner.StrP + Ver->VerStr;};
    inline const char *Section() const {return Ver->Section == 0?0:Owner.StrP + Ver->Section;};
    inline const char *Section() const {return Ver->Section == 0?0:Owner.StrP + Ver->Section;};
    inline PkgIterator ParentPkg() const {return PkgIterator(Owner,Owner.PkgP + Ver->ParentPkg);};
    inline PkgIterator ParentPkg() const {return PkgIterator(Owner,Owner.PkgP + Ver->ParentPkg);};
@@ -126,7 +126,8 @@ class pkgCache::VerIterator
    inline VerFileIterator FileList() const;
    inline VerFileIterator FileList() const;
    inline unsigned long Index() const {return Ver - Owner.VerP;};
    inline unsigned long Index() const {return Ver - Owner.VerP;};
    bool Downloadable() const;
    bool Downloadable() const;
-
+   const char *PriorityType();
+   
    inline VerIterator(pkgCache &Owner,Version *Trg = 0) : Ver(Trg), Owner(Owner) 
    inline VerIterator(pkgCache &Owner,Version *Trg = 0) : Ver(Trg), Owner(Owner) 
    { 
    { 
       if (Ver == 0)
       if (Ver == 0)

+ 13 - 1
apt-pkg/pkgcache.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: pkgcache.cc,v 1.17 1998/11/23 07:03:05 jgg Exp $
+// $Id: pkgcache.cc,v 1.18 1998/11/27 00:07:24 jgg Exp $
 /* ######################################################################
 /* ######################################################################
    
    
    Package Cache - Accessor code for the cache
    Package Cache - Accessor code for the cache
@@ -422,6 +422,18 @@ bool pkgCache::VerIterator::Downloadable() const
    return false;
    return false;
 }
 }
 									/*}}}*/
 									/*}}}*/
+// VerIterator::PriorityType - Return a string describing the priority	/*{{{*/
+// ---------------------------------------------------------------------
+/* */
+const char *pkgCache::VerIterator::PriorityType()
+{
+   const char *Types[] = {"","Important","Required","Standard",
+                          "Optional","Extra"};
+   if (Ver->Priority < 6)
+      return Types[Ver->Priority];
+   return "";
+}
+									/*}}}*/
 // PkgFileIterator::IsOk - Checks if the cache is in sync with the file	/*{{{*/
 // 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
 /* This stats the file and compares its stats with the ones that were