New configuration scheme changes, round 1.

- Configuration file 'xbps-conf.plist' has been splitted off into
  two files: conf.plist and repositories.plist. By default they
  are stored in etc/xbps.
- Changed some members in xbps_handle struct, mostly to make it easy
  to change its value in {cache,root}dir and conffile.
- Made xbps_init() release proplib objects as soon as we don't need
  them, that way it uses 35% less of memory or in some cases even more.

There will be another commit that will implement to read new virtualpkg
settings by the user, as specified in:

	http://code.google.com/p/xbps/issues/detail?id=12
This commit is contained in:
Juan RP
2011-10-17 12:37:15 +02:00
parent b6da7393c1
commit 5642ffa86e
27 changed files with 236 additions and 207 deletions

View File

@@ -73,7 +73,6 @@ int HIDDEN
xbps_repository_pool_init(void)
{
struct xbps_handle *xhp;
prop_array_t array;
prop_object_t obj;
prop_object_iterator_t iter = NULL;
struct repository_pool *rpool;
@@ -84,20 +83,16 @@ xbps_repository_pool_init(void)
bool duprepo;
xhp = xbps_handle_get();
if (xhp->conf_dictionary == NULL)
if (xhp->repos_array == NULL)
return ENOTSUP;
if (repolist_initialized)
return 0;
array = prop_dictionary_get(xhp->conf_dictionary, "repositories");
if (array == NULL)
return errno;
if (prop_array_count(array) == 0)
if (prop_array_count(xhp->repos_array) == 0)
return ENOTSUP;
iter = prop_array_iterator(array);
iter = prop_array_iterator(xhp->repos_array);
if (iter == NULL) {
rv = errno;
goto out;
@@ -189,6 +184,7 @@ xbps_repository_pool_init(void)
}
repolist_initialized = true;
prop_object_release(xhp->repos_array);
xbps_dbg_printf("[rpool] initialized ok.\n");
out:
if (iter)