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