1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-02-28 17:31:52 -05:00

*** empty log message ***

This commit is contained in:
Aaron Griffin 2007-03-01 05:42:53 +00:00
parent 0974e046a3
commit 4aca4980a7
2 changed files with 23 additions and 5 deletions

View File

@ -530,7 +530,7 @@ int _alpm_pkg_splitname(const char *target, char *name, char *version, int witha
void _alpm_pkg_update_requiredby(pmpkg_t *pkg)
{
alpm_list_t *i, *j;
alpm_list_t *i, *j, *k;
pmdb_t *localdb = alpm_option_get_localdb();
for(i = _alpm_db_get_pkgcache(localdb, INFRQ_DEPENDS); i; i = i->next) {
@ -543,11 +543,26 @@ void _alpm_pkg_update_requiredby(pmpkg_t *pkg)
if(!j->data) {
continue;
}
if(_alpm_splitdep(j->data, &dep) == 0
&& strcmp(dep.name, pkg->name) == 0) {
_alpm_log(PM_LOG_DEBUG, _("adding '%s' in requiredby field for '%s'"), cachepkg->name, pkg->name);
if(_alpm_splitdep(j->data, &dep) != 0) {
continue;
}
/* check the actual package itself */
if(strcmp(dep.name, pkg->name) == 0) {
_alpm_log(PM_LOG_DEBUG, _("adding '%s' in requiredby field for '%s'"),
cachepkg->name, pkg->name);
pkg->requiredby = alpm_list_add(pkg->requiredby, strdup(cachepkg->name));
}
/* check for provisions as well */
for(k = pkg->provides; k; k = k->next) {
const char *provname = k->data;
if(strcmp(dep.name, provname) == 0) {
_alpm_log(PM_LOG_DEBUG, _("adding '%s' in requiredby field for '%s' (provides: %s)"),
cachepkg->name, pkg->name, provname);
pkg->requiredby = alpm_list_add(pkg->requiredby, strdup(cachepkg->name));
}
}
}
}
}

View File

@ -259,7 +259,10 @@ int _alpm_trans_update_depends(pmtrans_t *trans, pmpkg_t *pkg)
ASSERT(pkg != NULL, RET_ERR(PM_ERR_PKG_INVALID, -1));
if(pkg->depends) {
_alpm_log(PM_LOG_DEBUG, _("updating dependency packages 'requiredby' fields"));
_alpm_log(PM_LOG_DEBUG, _("updating dependency packages 'requiredby' fields for %s-%s"),
pkg->name, pkg->version);
} else {
_alpm_log(PM_LOG_DEBUG, _("package has no dependencies, no other packages to update"));
}
localdb = alpm_option_get_localdb();