summaryrefslogtreecommitdiffstats
path: root/apt-pkg/version.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 09:59:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 09:59:37 +0000
commit76e2632459410dec81337edb6a9fee33c9a660f3 (patch)
treea73345df208eede4a4daad340515c9328f34625c /apt-pkg/version.h
parentInitial commit. (diff)
downloadapt-76e2632459410dec81337edb6a9fee33c9a660f3.tar.xz
apt-76e2632459410dec81337edb6a9fee33c9a660f3.zip
Adding upstream version 2.7.12.upstream/2.7.12
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'apt-pkg/version.h')
-rw-r--r--apt-pkg/version.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/apt-pkg/version.h b/apt-pkg/version.h
new file mode 100644
index 0000000..eaf667c
--- /dev/null
+++ b/apt-pkg/version.h
@@ -0,0 +1,57 @@
+// -*- mode: cpp; mode: fold -*-
+// Description /*{{{*/
+/* ######################################################################
+
+ 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>
+
+
+class APT_PUBLIC 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