diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:57:49 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:57:49 +0000 |
commit | c0a00c82853ac76283ea6a20c909a87cad5b4efb (patch) | |
tree | 13aaaa6ee518217af2cd78cc9ec63084d175a6d4 /test | |
parent | 9b2e67ebe6ba24063d675f0c321098427fabe05b (diff) |
RPM version compare test program
Author: jgg
Date: 2001-05-03 05:25:04 GMT
RPM version compare test program
Diffstat (limited to 'test')
-rw-r--r-- | test/makefile | 5 | ||||
-rw-r--r-- | test/rpmver.cc | 18 |
2 files changed, 23 insertions, 0 deletions
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 <apt-pkg/debversion.h> +#include <rpm/rpmio.h> +#include <rpm/misc.h> +#include <stdlib.h> + +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; +} |