API break: simplify xbps_repository_pool_find_virtualpkg().

This commit is contained in:
Juan RP
2012-01-18 08:25:28 +01:00
parent 454e164116
commit dfc7ff4232
5 changed files with 17 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2008-2011 Juan Romero Pardines.
* Copyright (c) 2008-2012 Juan Romero Pardines.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -362,7 +362,7 @@ find_repo_deps(prop_dictionary_t transd, /* transaction dictionary */
* Pass 3: if required dependency is not in repository,
* add pkg into the missing deps array and pass to next one.
*/
curpkgd = xbps_repository_pool_find_virtualpkg(reqpkg, true, false);
curpkgd = xbps_repository_pool_find_virtualpkg(reqpkg, true);
if (curpkgd == NULL) {
curpkgd = xbps_repository_pool_find_pkg(reqpkg, true, false);
if (curpkgd == NULL) {

View File

@@ -234,14 +234,14 @@ repo_find_pkg(const char *pkg, bool bypattern, bool best, bool exact,
}
prop_dictionary_t
xbps_repository_pool_find_virtualpkg(const char *pkg, bool bypattern, bool best)
xbps_repository_pool_find_virtualpkg(const char *pkg, bool bypattern)
{
struct repo_pool_fpkg *rpf;
prop_dictionary_t pkgd = NULL;
assert(pkg != NULL);
rpf = repo_find_pkg(pkg, bypattern, best, false, true);
rpf = repo_find_pkg(pkg, bypattern, false, false, true);
if (prop_object_type(rpf->pkgd) == PROP_TYPE_DICTIONARY)
pkgd = prop_dictionary_copy(rpf->pkgd);
free(rpf);

View File

@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2009-2011 Juan Romero Pardines.
* Copyright (c) 2009-2012 Juan Romero Pardines.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -92,10 +92,8 @@ transaction_find_pkg(const char *pattern, int action)
pkg_repod = xbps_repository_pool_find_pkg(pattern,
bypattern, bestpkg);
if (pkg_repod == NULL) {
if (!bestpkg) {
pkg_repod = xbps_repository_pool_find_virtualpkg(
pattern, bypattern, bestpkg);
}
pkg_repod =
xbps_repository_pool_find_virtualpkg(pattern, bypattern);
if (pkg_repod == NULL) {
/* not found */
rv = errno;