From e39c104d13bfb6e2c055c2af3eee41bfa603b13b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 21 Apr 2011 22:09:57 -0500 Subject: cleanup: add_pkg() and remove_pkg() Signed-off-by: Dan McGee --- lib/libalpm/add.c | 7 +++---- lib/libalpm/remove.c | 5 +++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 44e3eb9f..ee56e876 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -63,11 +63,10 @@ int SYMEXPORT alpm_add_pkg(pmpkg_t *pkg) trans = handle->trans; ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1)); ASSERT(trans->state == STATE_INITIALIZED, RET_ERR(PM_ERR_TRANS_NOT_INITIALIZED, -1)); - ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1)); db_local = handle->db_local; - pkgname = alpm_pkg_get_name(pkg); - pkgver = alpm_pkg_get_version(pkg); + pkgname = pkg->name; + pkgver = pkg->version; _alpm_log(PM_LOG_DEBUG, "adding package '%s'\n", pkgname); @@ -100,7 +99,7 @@ int SYMEXPORT alpm_add_pkg(pmpkg_t *pkg) /* add the package to the transaction */ pkg->reason = PM_PKG_REASON_EXPLICIT; - _alpm_log(PM_LOG_DEBUG, "adding package %s-%s to the transaction targets\n", + _alpm_log(PM_LOG_DEBUG, "adding package %s-%s to the transaction add list\n", pkgname, pkgver); trans->add = alpm_list_add(trans->add, pkg); diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 67ad9a6a..cf416d52 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -59,13 +59,14 @@ int SYMEXPORT alpm_remove_pkg(pmpkg_t *pkg) ASSERT(trans->state == STATE_INITIALIZED, RET_ERR(PM_ERR_TRANS_NOT_INITIALIZED, -1)); - pkgname = alpm_pkg_get_name(pkg); + pkgname = pkg->name; if(_alpm_pkg_find(trans->remove, pkgname)) { RET_ERR(PM_ERR_TRANS_DUP_TARGET, -1); } - _alpm_log(PM_LOG_DEBUG, "adding %s in the target list\n", pkgname); + _alpm_log(PM_LOG_DEBUG, "adding package %s to the transaction remove list\n", + pkgname); trans->remove = alpm_list_add(trans->remove, _alpm_pkg_dup(pkg)); return 0; } -- cgit v1.2.3-70-g09d2