Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/util/pactree.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-03 15:46:06 -0500
committerDan McGee <dan@archlinux.org>2011-06-07 11:37:05 -0500
commit19755b648c80f637a430ba5c914db76264024c9a (patch)
tree49ff0f6940ca12b5e0160ef0bf1637059218941d /src/util/pactree.c
parentfb4b422fc4567238332050b9a6c8c1cac2a8f091 (diff)
Update utilities for new initialize/release methods
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/util/pactree.c')
-rw-r--r--src/util/pactree.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/util/pactree.c b/src/util/pactree.c
index e9a2816e..e2210ea4 100644
--- a/src/util/pactree.c
+++ b/src/util/pactree.c
@@ -74,6 +74,7 @@ static struct color_choices no_color = {
};
/* globals */
+pmhandle_t *handle = NULL;
pmdb_t *db_local;
alpm_list_t *walked = NULL;
alpm_list_t *provisions = NULL;
@@ -89,21 +90,11 @@ const char *dbpath = DBPATH;
static int alpm_local_init(void)
{
- int ret;
-
- ret = alpm_initialize();
- if(ret != 0) {
- return ret;
- }
+ enum _pmerrno_t err;
- ret = alpm_option_set_root(ROOTDIR);
- if(ret != 0) {
- return ret;
- }
-
- ret = alpm_option_set_dbpath(dbpath);
- if(ret != 0) {
- return ret;
+ handle = alpm_initialize(ROOTDIR, dbpath, &err);
+ if(!handle) {
+ return -1;
}
db_local = alpm_option_get_localdb();
@@ -196,7 +187,7 @@ static void cleanup(void)
{
alpm_list_free(walked);
alpm_list_free(provisions);
- alpm_release();
+ alpm_release(handle);
}
/* pkg provides provision */