apt-key del: Ignore case when checking if a keyid exists in a keyring.
[ntk/apt.git] / apt-pkg / version.h
dissimilarity index 71%
index a302469..d98809f 100644 (file)
@@ -1,45 +1,61 @@
-// -*- mode: cpp; mode: fold -*-
-// Description                                                         /*{{{*/
-// $Id: version.h,v 1.1 1998/07/02 02:58:13 jgg Exp $
-/* ######################################################################
-
-   Version - Version string 
-   
-   This class implements storage and operators for version strings.
-
-   The client is responsible for stripping epochs should it be desired.
-   
-   ##################################################################### */
-                                                                       /*}}}*/
-// Header section: pkglib
-#ifndef PKGLIB_VERSION_H
-#define PKGLIB_VERSION_H
-
-#include <string>
-
-class pkgVersion
-{
-   string Value;
-   
-   public:
-
-   inline operator string () const {return Value;};
-
-   // Assignmnet
-   void operator =(string rhs) {Value = rhs;};
-   
-   // Comparitors. STL will provide the rest
-   bool operator ==(const pkgVersion &rhs) const;
-   bool operator <(const pkgVersion &rhs) const;
-   
-   pkgVersion();
-   pkgVersion(string Version) : Value(Version) {};
-};
-
-int pkgVersionCompare(const char *A, const char *B);
-int pkgVersionCompare(const char *A, const char *AEnd, const char *B, 
-                  const char *BEnd);
-int pkgVersionCompare(string A,string B);
-bool pkgCheckDep(const char *DepVer,const char *PkgVer,int Op);
-
-#endif
+// -*- mode: cpp; mode: fold -*-
+// Description                                                         /*{{{*/
+// $Id: version.h,v 1.8 2001/05/27 05:55:27 jgg Exp $
+/* ######################################################################
+
+   Version - Versioning system..
+
+   The versioning system represents how versions are compared, represented
+   and how dependencies are evaluated. As a general rule versioning
+   systems are not compatible unless specifically allowed by the 
+   TestCompatibility query.
+   
+   The versions are stored in a global list of versions, but that is just
+   so that they can be queried when someone does 'apt-get -v'. 
+   pkgSystem provides the proper means to access the VS for the active
+   system.
+   
+   ##################################################################### */
+                                                                       /*}}}*/
+#ifndef PKGLIB_VERSION_H
+#define PKGLIB_VERSION_H
+
+#include <apt-pkg/strutl.h>
+#include <string>
+
+#ifndef APT_8_CLEANER_HEADERS
+using std::string;
+#endif
+
+class pkgVersioningSystem
+{
+   public:
+   // Global list of VS's
+   static pkgVersioningSystem **GlobalList;
+   static unsigned long GlobalListLen;
+   static pkgVersioningSystem *GetVS(const char *Label) APT_PURE;
+   
+   const char *Label;
+   
+   // Compare versions..
+   virtual int DoCmpVersion(const char *A,const char *Aend,
+                         const char *B,const char *Bend) = 0;   
+
+   virtual bool CheckDep(const char *PkgVer,int Op,const char *DepVer) = 0;
+   virtual int DoCmpReleaseVer(const char *A,const char *Aend,
+                              const char *B,const char *Bend) = 0;
+   virtual std::string UpstreamVersion(const char *A) = 0;
+   
+   // See if the given VS is compatible with this one.. 
+   virtual bool TestCompatibility(pkgVersioningSystem const &Against) 
+                {return this == &Against;};
+
+   // Shortcuts
+   APT_MKSTRCMP(CmpVersion,DoCmpVersion);
+   APT_MKSTRCMP(CmpReleaseVer,DoCmpReleaseVer);
+   
+   pkgVersioningSystem();
+   virtual ~pkgVersioningSystem() {};
+};
+
+#endif