From ef86da97f54a90ee4ba3ba8ea7963135e7bae8ed Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 28 Jan 2011 17:41:15 -0600 Subject: Remove need to explicitly register the local DB Perform the cheap struct and string setup of the local DB at handle initialization time to match the teardown we do when releasing the handle. If the local DB is not needed, all real initialization is done lazily after DB paths and other things have been configured anyway. Signed-off-by: Dan McGee --- src/pacman/database.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pacman/database.c') diff --git a/src/pacman/database.c b/src/pacman/database.c index 5fd33ea5..36433f33 100644 --- a/src/pacman/database.c +++ b/src/pacman/database.c @@ -31,8 +31,6 @@ #include "conf.h" #include "util.h" -extern pmdb_t *db_local; - /** * @brief Modify the 'local' package database. * @@ -43,6 +41,7 @@ extern pmdb_t *db_local; int pacman_database(alpm_list_t *targets) { alpm_list_t *i; + pmdb_t *db_local; int retval = 0; pmpkgreason_t reason; @@ -65,6 +64,7 @@ int pacman_database(alpm_list_t *targets) return(1); } + db_local = alpm_option_get_localdb(); for(i = targets; i; i = alpm_list_next(i)) { char *pkgname = i->data; if(alpm_db_set_pkgreason(db_local, pkgname, reason) == -1) { -- cgit v1.2.3-24-g4f1b