vp-build/bin/xbps-cmpver/main.c
Juan RP fda3da1543 Use string version comparator code from FreeBSD.
This fixes all cases that previous code has with no changes...
sorry pancake.

--HG--
extra : convert_revision : 993d0aa060daf36d1b5ffa63725002dda122c091
2009-02-17 03:49:02 +01:00

22 lines
490 B
C

/*
* Compare package and version strings
* @ 2008
* Author: pancake <youterm.com>
*/
#include <stdio.h>
#include <string.h>
#include <xbps_api.h>
int main(int argc, char **argv)
{
if (argc < 3) {
printf("Usage: xbps-cmpver [installed] [required]\n");
printf(" xbps-cmpver foo-1.2 foo-2.2 # $? = 1\n");
printf(" xbps-cmpver foo-1.2 foo-1.1.0 # $? = 0\n");
printf(" xbps-cmpver foo-1.2 foo-1.2 # $? = 0\n");
return 1;
}
return xbps_cmpver_packages(argv[1], argv[2]);
}