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
This commit is contained in:
Juan RP 2009-02-17 03:49:02 +01:00
parent fb998feacf
commit fda3da1543
4 changed files with 295 additions and 70 deletions

View file

@ -48,7 +48,7 @@ xbps_check_is_installed_pkg(const char *pkg)
plist = xbps_append_full_path(true, NULL, XBPS_REGPKGDB);
if (plist == NULL)
return EINVAL;
return -1;
pkgname = xbps_get_pkg_name(pkg);
reqver = xbps_get_pkg_version(pkg);
@ -77,7 +77,7 @@ xbps_check_is_installed_pkg(const char *pkg)
assert(instver != NULL);
/* Compare installed and required version. */
rv = xbps_cmpver_versions(instver, reqver) > 0 ? 1 : 0;
rv = xbps_cmpver_versions(instver, reqver);
free(pkgname);
free(plist);