xbps-bin: don't make false positives detecting pkgmatches vs pkgnames

while installing packages.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100114030001-0m1cb3m1cf7oc7un
This commit is contained in:
Juan RP 2010-01-14 04:00:01 +01:00
parent 023841b060
commit 37008d3c75

View File

@ -330,11 +330,23 @@ xbps_install_new_pkg(const char *pkg)
* Check if 'pkg' string is a pkgmatch valid pattern or it
* is just a pkgname.
*/
if ((pkgname = xbps_get_pkgdep_name(pkg)))
if ((pkgname = xbps_get_pkgdep_name(pkg))) {
if (xbps_cmpver("0.0", pkgname) <= 0)
pkgmatch = true;
else if ((pkgname = xbps_get_pkg_name(pkg)))
else {
free(pkgname);
pkgname = NULL;
}
}
if (pkgname == NULL && (pkgname = xbps_get_pkg_name(pkg))) {
if (xbps_cmpver("0.0", pkgname) <= 0)
pkgmatch = true;
else
else {
free(pkgname);
pkgname = NULL;
}
}
if (pkgname == NULL)
pkgname = __UNCONST(pkg);
/*