From 6e5a62dd128b6036eaa35f9b010a35120548e3db Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Mon, 16 Jan 2006 22:27:09 +0000 Subject: more code cleanup --- lib/libalpm/add.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'lib/libalpm/add.c') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index d38eed7b..0e0bd899 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -108,13 +108,13 @@ int add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name) return(0); } + _alpm_log(PM_LOG_FLOW2, "loading target %s", name); + if(stat(name, &buf)) { pm_errno = PM_ERR_NOT_A_FILE; goto error; } - _alpm_log(PM_LOG_FLOW2, "loading target %s", name); - if(pkg_splitname(name, pkgname, pkgver) == -1) { pm_errno = PM_ERR_PKG_INVALID_NAME; goto error; @@ -256,10 +256,7 @@ int add_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data) } /* copy the file skiplist into the transaction */ - for(lp = skiplist; lp; lp = lp->next) { - trans->skiplist = pm_list_add(trans->skiplist, lp->data); - } - FREELISTPTR(skiplist); + trans->skiplist = skiplist; EVENT(trans, PM_TRANS_EVT_FILECONFLICTS_DONE, NULL, NULL); } @@ -646,18 +643,17 @@ int add_commit(pmtrans_t *trans, pmdb_t *db) /* use the first one */ depinfo = db_get_pkgfromcache(db, ((pmpkg_t *)provides->data)->name); FREELISTPTR(provides); - if(depinfo == NULL) { - /* wtf */ - continue; - } - } else { + } + if(depinfo == NULL) { + /* wtf */ continue; } } depinfo->requiredby = pm_list_add(depinfo->requiredby, strdup(info->name)); _alpm_log(PM_LOG_DEBUG, "updating 'requiredby' field for package %s", depinfo->name); if(db_write(db, depinfo, INFRQ_DEPENDS)) { - _alpm_log(PM_LOG_ERROR, "could not update 'requiredby' database entry %s/%s-%s", db->treename, depinfo->name, depinfo->version); + _alpm_log(PM_LOG_ERROR, "could not update 'requiredby' database entry %s-%s", + depinfo->name, depinfo->version); } } -- cgit v1.2.3-54-g00ecf