From 8f72ffbc4521008897fff0819cae4c80f8405391 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 6 Jul 2011 13:37:18 -0500 Subject: Make alpm_db_set_pkgreason() arguments more sane This can only ever operate on the local database, and a local package at that. Change the function signature to take a handle and package object, add the relevant asserts, and ensure the frontend can detect the package not found condition when finding packages to pass to this method. Signed-off-by: Dan McGee --- lib/libalpm/alpm.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/alpm.h') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index c7cab043..6e1e4bc4 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -476,12 +476,13 @@ alpm_list_t *alpm_db_get_groupcache(alpm_db_t *db); alpm_list_t *alpm_db_search(alpm_db_t *db, const alpm_list_t* needles); /** Set install reason for a package in db. - * @param db pointer to the package database - * @param name the name of the package + * @param handle the context handle + * @param pkg the package to update * @param reason the new install reason * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int alpm_db_set_pkgreason(alpm_db_t *db, const char *name, alpm_pkgreason_t reason); +int alpm_db_set_pkgreason(alpm_handle_t *handle, alpm_pkg_t *pkg, + alpm_pkgreason_t reason); /** @} */ -- cgit v1.2.3-24-g4f1b