From 307a6de17a3bca9f8666b33aa3fb9a8dd88c300b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 3 Jun 2011 12:44:01 -0500 Subject: Remove global handle from some package and db code Signed-off-by: Dan McGee --- lib/libalpm/package.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'lib/libalpm/package.c') diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 10ec82f1..d6edca1f 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -37,9 +37,6 @@ #include "handle.h" #include "deps.h" -/* global handle variable */ -extern pmhandle_t *handle; - /** \addtogroup alpm_packages Package Functions * @brief Functions to manipulate libalpm packages * @{ @@ -353,7 +350,7 @@ alpm_list_t SYMEXPORT *alpm_pkg_compute_requiredby(pmpkg_t *pkg) if(db->is_local) { find_requiredby(pkg, db, &reqs); } else { - for(i = handle->dbs_sync; i; i = i->next) { + for(i = pkg->handle->dbs_sync; i; i = i->next) { db = i->data; find_requiredby(pkg, db, &reqs); } @@ -419,7 +416,7 @@ pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg) newpkg->origin_data.db = pkg->origin_data.db; } newpkg->ops = pkg->ops; - newpkg->handle = handle; + newpkg->handle = pkg->handle; return newpkg; } @@ -542,12 +539,12 @@ int _alpm_pkg_should_ignore(pmpkg_t *pkg) alpm_list_t *groups = NULL; /* first see if the package is ignored */ - if(alpm_list_find_str(handle->ignorepkg, alpm_pkg_get_name(pkg))) { + if(alpm_list_find_str(pkg->handle->ignorepkg, alpm_pkg_get_name(pkg))) { return 1; } /* next see if the package is in a group that is ignored */ - for(groups = handle->ignoregrp; groups; groups = alpm_list_next(groups)) { + for(groups = pkg->handle->ignoregrp; groups; groups = alpm_list_next(groups)) { char *grp = (char *)alpm_list_getdata(groups); if(alpm_list_find_str(alpm_pkg_get_groups(pkg), grp)) { return 1; -- cgit v1.2.3-24-g4f1b