diff --git a/bin/xbps-repo/clean.c b/bin/xbps-repo/clean.c index 28007fff..9cb1abfb 100644 --- a/bin/xbps-repo/clean.c +++ b/bin/xbps-repo/clean.c @@ -78,7 +78,7 @@ cachedir_clean(void) * Remove binary pkg if it's not registered in any repository * or if hash doesn't match. */ - repo_pkgd = xbps_repository_pool_find_pkg_exact(pkgver); + repo_pkgd = xbps_rpool_find_pkg_exact(pkgver); if (repo_pkgd) { prop_dictionary_get_cstring_nocopy(repo_pkgd, "filename-sha256", &rsha256); diff --git a/bin/xbps-repo/find-files.c b/bin/xbps-repo/find-files.c index a24e7e4d..7dd16ff7 100644 --- a/bin/xbps-repo/find-files.c +++ b/bin/xbps-repo/find-files.c @@ -124,7 +124,7 @@ repo_find_files_in_packages(int npatterns, char **patterns) ffd->npatterns = npatterns; ffd->patterns = patterns; - rv = xbps_repository_pool_foreach(find_files_in_package, ffd); + rv = xbps_rpool_foreach(find_files_in_package, ffd); free(ffd); return rv; } diff --git a/bin/xbps-repo/main.c b/bin/xbps-repo/main.c index 85889796..c2ba4e5d 100644 --- a/bin/xbps-repo/main.c +++ b/bin/xbps-repo/main.c @@ -150,7 +150,7 @@ main(int argc, char **argv) if (argc != 1) usage(true); - rv = xbps_repository_pool_foreach(repo_list_uri_cb, NULL); + rv = xbps_rpool_foreach(repo_list_uri_cb, NULL); if (rv == ENOTSUP) xbps_error_printf("xbps-repo: no repositories " "currently registered!\n"); @@ -164,7 +164,7 @@ main(int argc, char **argv) if (argc < 1 || argc > 2) usage(true); - rv = xbps_repository_pool_foreach(repo_pkg_list_cb, argv[1]); + rv = xbps_rpool_foreach(repo_pkg_list_cb, argv[1]); if (rv == ENOTSUP) xbps_error_printf("xbps-repo: no repositories " "currently registered!\n"); @@ -186,7 +186,7 @@ main(int argc, char **argv) } rsd->npatterns = argc; rsd->patterns = argv; - rv = xbps_repository_pool_foreach(repo_search_pkgs_cb, rsd); + rv = xbps_rpool_foreach(repo_search_pkgs_cb, rsd); free(rsd); if (rv == ENOTSUP) xbps_error_printf("xbps-repo: no repositories " @@ -231,8 +231,7 @@ main(int argc, char **argv) if (argc != 2) usage(true); - pkgd = xbps_repository_pool_dictionary_metadata_plist(argv[1], - XBPS_PKGFILES); + pkgd = xbps_rpool_dictionary_metadata_plist(argv[1], XBPS_PKGFILES); if (pkgd == NULL) { if (errno == ENOTSUP) { xbps_error_printf("xbps-repo: no repositories " @@ -274,7 +273,7 @@ main(int argc, char **argv) if (argc != 1) usage(true); - rv = xbps_repository_pool_sync(); + rv = xbps_rpool_sync(); if (rv == ENOTSUP) { xbps_error_printf("xbps-repo: no repositories " "currently registered!\n"); diff --git a/bin/xbps-repo/show.c b/bin/xbps-repo/show.c index 060e6238..3665d2d4 100644 --- a/bin/xbps-repo/show.c +++ b/bin/xbps-repo/show.c @@ -49,9 +49,9 @@ show_pkg_info_from_repolist(const char *pattern, const char *option) prop_dictionary_t pkgd; if (xbps_pkgpattern_version(pattern)) - pkgd = xbps_repository_pool_find_pkg(pattern, true, false); + pkgd = xbps_rpool_find_pkg(pattern, true, false); else - pkgd = xbps_repository_pool_find_pkg(pattern, false, true); + pkgd = xbps_rpool_find_pkg(pattern, false, true); if (pkgd == NULL) return errno; @@ -73,9 +73,9 @@ show_pkg_deps_from_repolist(const char *pattern) const char *ver, *repoloc; if (xbps_pkgpattern_version(pattern)) - pkgd = xbps_repository_pool_find_pkg(pattern, true, false); + pkgd = xbps_rpool_find_pkg(pattern, true, false); else - pkgd = xbps_repository_pool_find_pkg(pattern, false, true); + pkgd = xbps_rpool_find_pkg(pattern, false, true); if (pkgd == NULL) return errno; diff --git a/include/xbps_api.h b/include/xbps_api.h index 9eb05444..bb2e9341 100644 --- a/include/xbps_api.h +++ b/include/xbps_api.h @@ -56,7 +56,7 @@ */ #define XBPS_PKGINDEX_VERSION "1.4" -#define XBPS_API_VERSION "20120530" +#define XBPS_API_VERSION "20120530-1" #define XBPS_VERSION "0.16" /** @@ -1514,7 +1514,7 @@ struct repository_pool_index { * @return 0 on success, ENOTSUP if no repositories were found in * the configuration file. */ -int xbps_repository_pool_sync(void); +int xbps_rpool_sync(void); /** * Iterates over the repository pool and executes the \a fn function @@ -1530,7 +1530,7 @@ int xbps_repository_pool_sync(void); * * @return 0 on success, otherwise an errno value. */ -int xbps_repository_pool_foreach( +int xbps_rpool_foreach( int (*fn)(struct repository_pool_index *, void *, bool *), void *arg); @@ -1549,8 +1549,7 @@ int xbps_repository_pool_foreach( * @note When returned dictionary is no longer needed, you must release it * with prop_object_release(3). */ -prop_dictionary_t - xbps_repository_pool_find_pkg(const char *pkg, bool bypattern, bool best); +prop_dictionary_t xbps_rpool_find_pkg(const char *pkg, bool bypattern, bool best); /** * Finds a package dictionary in repository pool by matching its \a pkgver @@ -1562,7 +1561,7 @@ prop_dictionary_t * @note When returned dictionary is no longer needed, you must release it * with prop_object_release(3). */ -prop_dictionary_t xbps_repository_pool_find_pkg_exact(const char *pkgver); +prop_dictionary_t xbps_rpool_find_pkg_exact(const char *pkgver); /** * Finds a package dictionary in repository pool by specifying a @@ -1576,8 +1575,7 @@ prop_dictionary_t xbps_repository_pool_find_pkg_exact(const char *pkgver); * @note When returned dictionary is no longer needed, you must release it * with prop_object_release(3). */ -prop_dictionary_t - xbps_repository_pool_find_virtualpkg(const char *pkg, bool bypattern); +prop_dictionary_t xbps_rpool_find_virtualpkg(const char *pkg, bool bypattern); /** * Finds a package dictionary in repository pool by specifying a @@ -1592,8 +1590,7 @@ prop_dictionary_t * @note When returned dictionary is no longer needed, you must release it * with prop_object_release(3). */ -prop_dictionary_t - xbps_repository_pool_find_virtualpkg_conf(const char *pkg, bool bypattern); +prop_dictionary_t xbps_rpool_find_virtualpkg_conf(const char *pkg, bool bypattern); /** * Iterate over the the repository pool and search for a metadata plist @@ -1613,8 +1610,7 @@ prop_dictionary_t * binary package file has been found but the plist file could not * be found. */ -prop_dictionary_t - xbps_repository_pool_dictionary_metadata_plist(const char *pattern, +prop_dictionary_t xbps_rpool_dictionary_metadata_plist(const char *pattern, const char *plistf); /*@}*/ diff --git a/include/xbps_api_impl.h b/include/xbps_api_impl.h index 3509df36..15e4b51b 100644 --- a/include/xbps_api_impl.h +++ b/include/xbps_api_impl.h @@ -75,8 +75,8 @@ void HIDDEN xbps_pkgdb_release(struct xbps_handle *); * @private * From lib/repository_pool.c */ -int HIDDEN xbps_repository_pool_init(struct xbps_handle *); -void HIDDEN xbps_repository_pool_release(struct xbps_handle *); +int HIDDEN xbps_rpool_init(struct xbps_handle *); +void HIDDEN xbps_rpool_release(struct xbps_handle *); /** * @private diff --git a/lib/initend.c b/lib/initend.c index f7fb3375..8a233a06 100644 --- a/lib/initend.c +++ b/lib/initend.c @@ -218,7 +218,7 @@ xbps_end(void) return; xbps_pkgdb_release(xhp); - xbps_repository_pool_release(xhp); + xbps_rpool_release(xhp); xbps_fetch_unset_cache_connection(); if (xhp->cfg != NULL) diff --git a/lib/repository_finddeps.c b/lib/repository_finddeps.c index 0b940214..bb100ccb 100644 --- a/lib/repository_finddeps.c +++ b/lib/repository_finddeps.c @@ -386,9 +386,9 @@ find_repo_deps(prop_dictionary_t transd, /* transaction dictionary */ * If dependency does not match add pkg into the missing * deps array and pass to next one. */ - if (((curpkgd = xbps_repository_pool_find_virtualpkg_conf(reqpkg, true)) == NULL) && - ((curpkgd = xbps_repository_pool_find_pkg(reqpkg, true, true)) == NULL) && - ((curpkgd = xbps_repository_pool_find_virtualpkg(reqpkg, true)) == NULL)) { + if (((curpkgd = xbps_rpool_find_virtualpkg_conf(reqpkg, true)) == NULL) && + ((curpkgd = xbps_rpool_find_pkg(reqpkg, true, true)) == NULL) && + ((curpkgd = xbps_rpool_find_virtualpkg(reqpkg, true)) == NULL)) { /* pkg not found, there was some error */ if (errno && errno != ENOENT) { xbps_dbg_printf("failed to find pkg " diff --git a/lib/repository_pool.c b/lib/repository_pool.c index 064e4186..337202cb 100644 --- a/lib/repository_pool.c +++ b/lib/repository_pool.c @@ -63,7 +63,7 @@ check_repo_arch(const char *uri) } int HIDDEN -xbps_repository_pool_init(struct xbps_handle *xhp) +xbps_rpool_init(struct xbps_handle *xhp) { prop_dictionary_t d = NULL; prop_array_t array; @@ -146,14 +146,14 @@ xbps_repository_pool_init(struct xbps_handle *xhp) xbps_dbg_printf("[rpool] initialized ok.\n"); out: if (rv != 0) - xbps_repository_pool_release(xhp); + xbps_rpool_release(xhp); return rv; } void HIDDEN -xbps_repository_pool_release(struct xbps_handle *xhp) +xbps_rpool_release(struct xbps_handle *xhp) { prop_array_t idx; prop_dictionary_t d; @@ -176,7 +176,7 @@ xbps_repository_pool_release(struct xbps_handle *xhp) } int -xbps_repository_pool_sync(void) +xbps_rpool_sync(void) { const struct xbps_handle *xhp = xbps_handle_get(); const char *repouri; @@ -222,9 +222,8 @@ xbps_repository_pool_sync(void) } int -xbps_repository_pool_foreach( - int (*fn)(struct repository_pool_index *, void *, bool *), - void *arg) +xbps_rpool_foreach(int (*fn)(struct repository_pool_index *, void *, bool *), + void *arg) { prop_dictionary_t d; struct xbps_handle *xhp = xbps_handle_get(); @@ -235,7 +234,7 @@ xbps_repository_pool_foreach( assert(fn != NULL); /* Initialize repository pool */ - if ((rv = xbps_repository_pool_init(xhp)) != 0) { + if ((rv = xbps_rpool_init(xhp)) != 0) { if (rv == ENOTSUP) { xbps_dbg_printf("[rpool] empty repository list.\n"); } else if (rv != ENOENT && rv != ENOTSUP) { diff --git a/lib/repository_pool_find.c b/lib/repository_pool_find.c index fb72d099..3e9c6348 100644 --- a/lib/repository_pool_find.c +++ b/lib/repository_pool_find.c @@ -215,31 +215,31 @@ repo_find_pkg(const char *pkg, bool bypattern, pkg_repo_type_t type) * Find exact pkg version. */ rpf->exact = true; - rv = xbps_repository_pool_foreach(repo_find_pkg_cb, rpf); + rv = xbps_rpool_foreach(repo_find_pkg_cb, rpf); break; case BEST_PKG: /* * Find best pkg version. */ - rv = xbps_repository_pool_foreach(repo_find_best_pkg_cb, rpf); + rv = xbps_rpool_foreach(repo_find_best_pkg_cb, rpf); break; case VIRTUAL_PKG: /* * Find virtual pkg. */ - rv = xbps_repository_pool_foreach(repo_find_virtualpkg_cb, rpf); + rv = xbps_rpool_foreach(repo_find_virtualpkg_cb, rpf); break; case VIRTUAL_CONF_PKG: /* * Find virtual pkg as specified in configuration file. */ - rv = xbps_repository_pool_foreach(repo_find_virtualpkg_conf_cb, rpf); + rv = xbps_rpool_foreach(repo_find_virtualpkg_conf_cb, rpf); break; case REAL_PKG: /* * Find real pkg. */ - rv = xbps_repository_pool_foreach(repo_find_pkg_cb, rpf); + rv = xbps_rpool_foreach(repo_find_pkg_cb, rpf); break; } if (rv != 0) @@ -249,7 +249,7 @@ repo_find_pkg(const char *pkg, bool bypattern, pkg_repo_type_t type) } prop_dictionary_t -xbps_repository_pool_find_virtualpkg(const char *pkg, bool bypattern) +xbps_rpool_find_virtualpkg(const char *pkg, bool bypattern) { struct repo_pool_fpkg *rpf; prop_dictionary_t pkgd = NULL; @@ -265,7 +265,7 @@ xbps_repository_pool_find_virtualpkg(const char *pkg, bool bypattern) } prop_dictionary_t -xbps_repository_pool_find_virtualpkg_conf(const char *pkg, bool bypattern) +xbps_rpool_find_virtualpkg_conf(const char *pkg, bool bypattern) { struct repo_pool_fpkg *rpf; prop_dictionary_t pkgd = NULL; @@ -281,7 +281,7 @@ xbps_repository_pool_find_virtualpkg_conf(const char *pkg, bool bypattern) } prop_dictionary_t -xbps_repository_pool_find_pkg(const char *pkg, bool bypattern, bool best) +xbps_rpool_find_pkg(const char *pkg, bool bypattern, bool best) { struct repo_pool_fpkg *rpf; prop_dictionary_t pkgd = NULL; @@ -301,7 +301,7 @@ xbps_repository_pool_find_pkg(const char *pkg, bool bypattern, bool best) } prop_dictionary_t -xbps_repository_pool_find_pkg_exact(const char *pkgver) +xbps_rpool_find_pkg_exact(const char *pkgver) { struct repo_pool_fpkg *rpf; prop_dictionary_t pkgd = NULL; @@ -317,8 +317,7 @@ xbps_repository_pool_find_pkg_exact(const char *pkgver) } prop_dictionary_t -xbps_repository_pool_dictionary_metadata_plist(const char *pattern, - const char *plistf) +xbps_rpool_dictionary_metadata_plist(const char *pattern, const char *plistf) { prop_dictionary_t pkgd = NULL, plistd = NULL; const char *repoloc; @@ -336,9 +335,9 @@ xbps_repository_pool_dictionary_metadata_plist(const char *pattern, * libfetch! */ if (xbps_pkgpattern_version(pattern)) - pkgd = xbps_repository_pool_find_pkg(pattern, true, false); + pkgd = xbps_rpool_find_pkg(pattern, true, false); else - pkgd = xbps_repository_pool_find_pkg(pattern, false, true); + pkgd = xbps_rpool_find_pkg(pattern, false, true); if (pkgd == NULL) goto out; diff --git a/lib/transaction_ops.c b/lib/transaction_ops.c index 2b90340f..af25fd16 100644 --- a/lib/transaction_ops.c +++ b/lib/transaction_ops.c @@ -84,9 +84,9 @@ transaction_find_pkg(const char *pkg, bool bypattern, bool bestpkg, int action) /* * Find out if the pkg has been found in repository pool. */ - if (((pkg_repod = xbps_repository_pool_find_virtualpkg_conf(pkg, bypattern)) == NULL) && - ((pkg_repod = xbps_repository_pool_find_pkg(pkg, bypattern, bestpkg)) == NULL) && - ((pkg_repod = xbps_repository_pool_find_virtualpkg(pkg, bypattern)) == NULL)) { + if (((pkg_repod = xbps_rpool_find_virtualpkg_conf(pkg, bypattern)) == NULL) && + ((pkg_repod = xbps_rpool_find_pkg(pkg, bypattern, bestpkg)) == NULL) && + ((pkg_repod = xbps_rpool_find_virtualpkg(pkg, bypattern)) == NULL)) { /* not found */ rv = errno; errno = 0;