summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/package.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-03 19:44:01 +0200
committerDan McGee <dan@archlinux.org>2011-06-03 19:44:01 +0200
commit307a6de17a3bca9f8666b33aa3fb9a8dd88c300b (patch)
treee6d4c595be6dec9b4fe286a6733eb866c9a5df50 /lib/libalpm/package.c
parent4015b23e8ef1e5a0e8d103ffefca0ffc4ad9e6c0 (diff)
downloadpacman-307a6de17a3bca9f8666b33aa3fb9a8dd88c300b.tar.gz
pacman-307a6de17a3bca9f8666b33aa3fb9a8dd88c300b.tar.xz
Remove global handle from some package and db code
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/package.c')
-rw-r--r--lib/libalpm/package.c11
1 files changed, 4 insertions, 7 deletions
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;