From c0a00c82853ac76283ea6a20c909a87cad5b4efb Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:57:49 +0000 Subject: RPM version compare test program Author: jgg Date: 2001-05-03 05:25:04 GMT RPM version compare test program --- apt-pkg/deb/debversion.h | 8 ++++---- test/makefile | 5 +++++ test/rpmver.cc | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 test/rpmver.cc diff --git a/apt-pkg/deb/debversion.h b/apt-pkg/deb/debversion.h index d313f78a6..00a8832a8 100644 --- a/apt-pkg/deb/debversion.h +++ b/apt-pkg/deb/debversion.h @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: debversion.h,v 1.2 2001/02/20 07:03:17 jgg Exp $ +// $Id: debversion.h,v 1.3 2001/05/03 05:25:04 jgg Exp $ /* ###################################################################### Debian Version - Versioning system for Debian @@ -19,12 +19,12 @@ #include class debVersioningSystem : public pkgVersioningSystem -{ +{ + public: + static int CmpFragment(const char *A, const char *AEnd, const char *B, const char *BEnd); - public: - // Compare versions.. virtual int DoCmpVersion(const char *A,const char *Aend, const char *B,const char *Bend); diff --git a/test/makefile b/test/makefile index 541f23834..9ad6233c2 100644 --- a/test/makefile +++ b/test/makefile @@ -62,3 +62,8 @@ SLIBS = -lapt-pkg SOURCE = hash.cc include $(PROGRAM_H) +# Program for checking rpm versions +PROGRAM=rpmver +SLIBS = -lapt-pkg -lrpm +SOURCE = rpmver.cc +include $(PROGRAM_H) diff --git a/test/rpmver.cc b/test/rpmver.cc new file mode 100644 index 000000000..be982603b --- /dev/null +++ b/test/rpmver.cc @@ -0,0 +1,18 @@ +#include +#include +#include +#include + +int main(int argc,const char *argv[]) +{ + printf("'%s' <> '%s': ",argv[1],argv[2]); + printf("rpm: %i deb: %i\n",rpmvercmp(argv[1],argv[2]), + debVS.CmpFragment(argv[1],argv[1]+strlen(argv[1]), + argv[2],argv[2]+strlen(argv[2]))); + + printf("'%s' <> '%s': ",argv[2],argv[1]); + printf("rpm: %i deb: %i\n",rpmvercmp(argv[2],argv[1]), + debVS.CmpFragment(argv[2],argv[2]+strlen(argv[2]), + argv[1],argv[1]+strlen(argv[1]))); + return 0; +} -- cgit v1.2.3