Major changes in libxbps to implement caching in some cases.

libxbps:
 - Moved repolist code to lib/repository_pool.c.
 - Renamed xbps_{prepare,release}_repolist_data() to
   xbps_repository_pool_{init,release} respectively.
 - Moved regpkgdb dict code to lib/regpkgs_dictionary.c.
 - Renamed xbps_{prepare,release}_regpkgdb_dict() to
   xbps_regpkgs_dictionary_{init,release} respectively.
 - Use a global reference count for repository_pool and regpkgs_dictionary,
   this gives a substantial performance gain while looking for dependencies
   in repository pool, among other things.
 - Make xbps_find_pkg_* functions return errno and use it to detect
   for spurious errors in code using them.
 - Add code to detect when a dependency is already unpacked.

xbps-bin:
 - Do not set pkg state to unpacked in the transaction, it's set already
   while a package is unpacked.
 - While installing or updating packages, it now knows when a dependency
   is already unpacked and shows it as "unconfigured".

Bump XBPS_RELVER to 20091126.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091126022250-uu8x0fa86l4scb5x
This commit is contained in:
Juan RP
2009-11-26 02:22:50 +00:00
parent fa7e3a3a7e
commit 87a216fd11
24 changed files with 495 additions and 334 deletions

View File

@@ -200,7 +200,7 @@ xbps_get_pkg_plist_dict_from_repo(const char *pkgname, const char *plistf)
char *url = NULL;
int rv = 0;
if ((rv = xbps_prepare_repolist_data()) != 0) {
if ((rv = xbps_repository_pool_init()) != 0) {
errno = rv;
return NULL;
}
@@ -215,9 +215,13 @@ xbps_get_pkg_plist_dict_from_repo(const char *pkgname, const char *plistf)
* libfetch!
*/
SIMPLEQ_FOREACH(rdata, &repodata_queue, chain) {
if ((pkgd = xbps_find_pkg_in_dict(rdata->rd_repod,
"packages", pkgname)) == NULL)
pkgd = xbps_find_pkg_in_dict(rdata->rd_repod,
"packages", pkgname);
if (pkgd == NULL) {
if (errno != ENOENT)
break;
continue;
}
url = xbps_get_path_from_pkg_dict_repo(pkgd, rdata->rd_uri);
if (url == NULL)
break;
@@ -229,7 +233,7 @@ xbps_get_pkg_plist_dict_from_repo(const char *pkgname, const char *plistf)
free(url);
}
xbps_release_repolist_data();
xbps_repository_pool_release();
if (plistd == NULL)
errno = ENOENT;