From 0074cadb3bfdf5d89065e69eb93788ebcc9a6b58 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 9 Jun 2011 15:18:47 -0500 Subject: Add handle argument to _alpm_pkg_should_ignore() This allows callers to retrieve it from wherever is convenient, which may or may not be on the package object itself. Signed-off-by: Dan McGee --- lib/libalpm/package.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/package.c') diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 969458ac..61194e91 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -534,21 +534,22 @@ pmpkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle) * Checks if the package is ignored via IgnorePkg, or if the package is * in a group ignored via IgnoreGrp. * + * @param handle the context handle * @param pkg the package to test * * @return 1 if the package should be ignored, 0 otherwise */ -int _alpm_pkg_should_ignore(pmpkg_t *pkg) +int _alpm_pkg_should_ignore(pmhandle_t *handle, pmpkg_t *pkg) { alpm_list_t *groups = NULL; /* first see if the package is ignored */ - if(alpm_list_find_str(pkg->handle->ignorepkg, alpm_pkg_get_name(pkg))) { + if(alpm_list_find_str(handle->ignorepkg, alpm_pkg_get_name(pkg))) { return 1; } /* next see if the package is in a group that is ignored */ - for(groups = pkg->handle->ignoregrp; groups; groups = alpm_list_next(groups)) { + for(groups = 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