index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-06-03 15:46:06 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-06-07 11:37:05 -0500 |
commit | 19755b648c80f637a430ba5c914db76264024c9a (patch) | |
tree | 49ff0f6940ca12b5e0160ef0bf1637059218941d /src/util/pactree.c | |
parent | fb4b422fc4567238332050b9a6c8c1cac2a8f091 (diff) |
-rw-r--r-- | src/util/pactree.c | 21 |
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 */ |