2009-02-05 14:46:09 +01:00
|
|
|
/*
|
2008-10-27 18:06:45 +01:00
|
|
|
* Compare package and version strings
|
2008-10-28 16:51:58 +01:00
|
|
|
* @ 2008
|
2008-10-27 18:06:45 +01:00
|
|
|
* Author: pancake <youterm.com>
|
|
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
2008-12-21 23:57:02 +01:00
|
|
|
#include <xbps_api.h>
|
2008-10-27 18:06:45 +01:00
|
|
|
|
2008-12-23 12:28:21 +01:00
|
|
|
int main(int argc, char **argv)
|
2008-10-27 18:06:45 +01:00
|
|
|
{
|
2009-02-17 03:49:02 +01:00
|
|
|
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");
|
2008-12-23 12:28:21 +01:00
|
|
|
return 1;
|
2008-10-27 18:06:45 +01:00
|
|
|
}
|
|
|
|
|
2009-06-07 05:02:58 +02:00
|
|
|
return xbps_cmpver(argv[1], argv[2]);
|
2008-10-27 18:06:45 +01:00
|
|
|
}
|