summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/package.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-03-03 10:43:16 +0100
committerDan McGee <dan@archlinux.org>2007-03-03 10:43:16 +0100
commite24c22e308f3dfc0642a542ff2fd7158af489fd0 (patch)
treee166f272a387a4d946eb76359b4fca361dfcbbd4 /lib/libalpm/package.c
parent7f5dada8851c3b40ba44ed92e46315cefa9006b2 (diff)
downloadpacman-e24c22e308f3dfc0642a542ff2fd7158af489fd0.tar.gz
pacman-e24c22e308f3dfc0642a542ff2fd7158af489fd0.tar.xz
* 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/package.c')
-rw-r--r--lib/libalpm/package.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index f720bd7f..1faf2f2d 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -546,16 +546,17 @@ void _alpm_pkg_update_requiredby(pmpkg_t *pkg)
}
pmpkg_t *cachepkg = i->data;
for(j = alpm_pkg_get_depends(cachepkg); j; j = j->next) {
- pmdepend_t dep;
+ pmdepend_t *dep;
if(!j->data) {
continue;
}
- if(_alpm_splitdep(j->data, &dep) != 0) {
- continue;
+ dep = _alpm_splitdep(j->data);
+ if(dep == NULL) {
+ continue;
}
-
+
/* check the actual package itself */
- if(strcmp(dep.name, alpm_pkg_get_name(pkg)) == 0) {
+ if(strcmp(dep->name, alpm_pkg_get_name(pkg)) == 0) {
_alpm_log(PM_LOG_DEBUG, _("adding '%s' in requiredby field for '%s'"),
cachepkg->name, pkg->name);
alpm_list_t *reqs = alpm_pkg_get_requiredby(pkg);
@@ -566,7 +567,7 @@ void _alpm_pkg_update_requiredby(pmpkg_t *pkg)
/* check for provisions as well */
for(k = alpm_pkg_get_provides(pkg); k; k = k->next) {
const char *provname = k->data;
- if(strcmp(dep.name, provname) == 0) {
+ if(strcmp(dep->name, provname) == 0) {
_alpm_log(PM_LOG_DEBUG, _("adding '%s' in requiredby field for '%s' (provides: %s)"),
alpm_pkg_get_name(cachepkg), alpm_pkg_get_name(pkg), provname);
alpm_list_t *reqs = alpm_pkg_get_requiredby(pkg);
@@ -574,6 +575,7 @@ void _alpm_pkg_update_requiredby(pmpkg_t *pkg)
pkg->requiredby = reqs;
}
}
+ free(dep);
}
}
}