Fix some issues while matching for required pkgdeps.
--HG-- extra : convert_revision : xtraeme%40gmail.com-20091107154159-riikhswt1h3mm9xn
This commit is contained in:
parent
79d3f446fe
commit
795c2a58f5
@ -279,12 +279,23 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
|
||||
/*
|
||||
* Check if required dep is satisfied and installed.
|
||||
*/
|
||||
if (xbps_check_is_installed_pkg(reqpkg))
|
||||
rv = xbps_check_is_installed_pkg(reqpkg);
|
||||
if (rv == -1) {
|
||||
/* There was an error checking it... */
|
||||
break;
|
||||
} else if (rv == 1) {
|
||||
/* pkgdep is satisfied */
|
||||
continue;
|
||||
}
|
||||
|
||||
pkgname = xbps_get_pkgdep_name(reqpkg);
|
||||
if (pkgname == NULL) {
|
||||
rv = EINVAL;
|
||||
break;
|
||||
}
|
||||
reqvers = xbps_get_pkgdep_version(reqpkg);
|
||||
if (pkgname == NULL || reqvers == NULL) {
|
||||
if (reqvers == NULL) {
|
||||
free(pkgname);
|
||||
rv = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
@ -113,6 +113,8 @@ xbps_pkgdep_match(const char *instpkg, char *pattern)
|
||||
char basefname[PATH_MAX], condchar = '\0', *condition;
|
||||
int rv = 0;
|
||||
|
||||
memset(&basefname, 0, sizeof(basefname));
|
||||
|
||||
condition = strpbrk(pattern, "><=");
|
||||
if (condition) {
|
||||
const char *ch;
|
||||
|
@ -141,16 +141,16 @@ xbps_check_is_installed_pkg(const char *pkg)
|
||||
free(pkgname);
|
||||
return -1;
|
||||
}
|
||||
free(pkgname);
|
||||
|
||||
if (state != XBPS_PKG_STATE_INSTALLED) {
|
||||
prop_object_release(dict);
|
||||
return 0;
|
||||
free(pkgname);
|
||||
return 0; /* not fully installed */
|
||||
}
|
||||
|
||||
/* Get version from installed package */
|
||||
prop_dictionary_get_cstring_nocopy(dict, "version", &instver);
|
||||
instpkg = xbps_xasprintf("%s-%s", pkgname, instver);
|
||||
free(pkgname);
|
||||
if (instpkg == NULL) {
|
||||
prop_object_release(dict);
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user