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

@@ -43,13 +43,14 @@ xbps_configure_all_pkgs(void)
int rv = 0;
pkg_state_t state = 0;
d = xbps_prepare_regpkgdb_dict();
if (d == NULL)
return ENODEV;
if ((d = xbps_regpkgs_dictionary_init()) == NULL)
return errno;
iter = xbps_get_array_iter_from_dict(d, "packages");
if (iter == NULL)
return ENOENT;
if (iter == NULL) {
rv = errno;
goto out;
}
while ((obj = prop_object_iterator_next(iter)) != NULL) {
if (!prop_dictionary_get_cstring_nocopy(obj,
@@ -70,6 +71,8 @@ xbps_configure_all_pkgs(void)
break;
}
prop_object_iterator_release(iter);
out:
xbps_regpkgs_dictionary_release();
return rv;
}
@@ -108,7 +111,7 @@ xbps_configure_pkg(const char *pkgname, const char *version, bool check_state)
pkgd = xbps_find_pkg_installed_from_plist(pkgname);
if (pkgd == NULL)
return ENOENT;
return errno;
if (!prop_dictionary_get_cstring_nocopy(pkgd,
"version", &lver)) {
@@ -131,8 +134,10 @@ xbps_configure_pkg(const char *pkgname, const char *version, bool check_state)
if (strcmp(rootdir, "") == 0)
rootdir = "/";
if (chdir(rootdir) == -1)
if (chdir(rootdir) == -1) {
free(buf);
return errno;
}
if (access(buf, X_OK) == 0) {
if ((rv = xbps_file_chdir_exec(rootdir, buf, "post",