summaryrefslogtreecommitdiff
path: root/lib/libalpm/trans.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-03-03 09:43:16 +0000
committerDan McGee <dan@archlinux.org>2007-03-03 09:43:16 +0000
commite24c22e308f3dfc0642a542ff2fd7158af489fd0 (patch)
treee166f272a387a4d946eb76359b4fca361dfcbbd4 /lib/libalpm/trans.c
parent7f5dada8851c3b40ba44ed92e46315cefa9006b2 (diff)
* A little more hacking with wchar_t output, but nothing really changed in
it. Eventually we'll make progress. * Rewrote the _alpm_splitdep function to behave more like all our other function calls. Use heap instead of stack allocation for the depend struct, so now it needs to be freed by the caller.
Diffstat (limited to 'lib/libalpm/trans.c')
-rw-r--r--lib/libalpm/trans.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 9a301b63..b4677079 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -269,22 +269,22 @@ int _alpm_trans_update_depends(pmtrans_t *trans, pmpkg_t *pkg)
localdb = alpm_option_get_localdb();
for(i = depends; i; i = i->next) {
- pmdepend_t dep;
- if(_alpm_splitdep(i->data, &dep) != 0) {
+ pmdepend_t* dep = _alpm_splitdep(i->data);
+ if(dep == NULL) {
continue;
}
-
+
if(trans->packages && trans->type == PM_TRANS_TYPE_REMOVE) {
- if(_alpm_pkg_find(dep.name, handle->trans->packages)) {
+ if(_alpm_pkg_find(dep->name, handle->trans->packages)) {
continue;
}
}
- pmpkg_t *deppkg = _alpm_db_get_pkgfromcache(localdb, dep.name);
+ pmpkg_t *deppkg = _alpm_db_get_pkgfromcache(localdb, dep->name);
if(!deppkg) {
int found_provides = 0;
/* look for a provides package */
- alpm_list_t *provides = _alpm_db_whatprovides(localdb, dep.name);
+ alpm_list_t *provides = _alpm_db_whatprovides(localdb, dep->name);
for(j = provides; j; j = j->next) {
if(!j->data) {
continue;
@@ -319,7 +319,7 @@ int _alpm_trans_update_depends(pmtrans_t *trans, pmpkg_t *pkg)
FREELISTPTR(provides);
if(!found_provides) {
- _alpm_log(PM_LOG_DEBUG, _("could not find dependency '%s'"), dep.name);
+ _alpm_log(PM_LOG_DEBUG, _("could not find dependency '%s'"), dep->name);
continue;
}
}
@@ -341,6 +341,7 @@ int _alpm_trans_update_depends(pmtrans_t *trans, pmpkg_t *pkg)
_alpm_log(PM_LOG_ERROR, _("could not update 'requiredby' database entry %s-%s"),
alpm_pkg_get_name(deppkg), alpm_pkg_get_version(deppkg));
}
+ free(dep);
}
return(0);
}