mirror of
https://github.com/moparisthebest/pacman
synced 2025-01-09 04:57:59 -05:00
* Bug fix FS#6058
properly remove entries from "Required By" instead of wiping it out entirely
This commit is contained in:
parent
65e086e0e3
commit
50030f778a
@ -782,6 +782,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
|
|||||||
_alpm_log(PM_LOG_ERROR, _("could not add entry '%s' in cache"), info->name);
|
_alpm_log(PM_LOG_ERROR, _("could not add entry '%s' in cache"), info->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* XXX: This is copy-pasta from remove.c - refactor */
|
||||||
/* update dependency packages' REQUIREDBY fields */
|
/* update dependency packages' REQUIREDBY fields */
|
||||||
if(info->depends) {
|
if(info->depends) {
|
||||||
_alpm_log(PM_LOG_FLOW2, _("updating dependency packages 'requiredby' fields"));
|
_alpm_log(PM_LOG_FLOW2, _("updating dependency packages 'requiredby' fields"));
|
||||||
@ -810,6 +811,10 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Ensure package has the right info */
|
||||||
|
_alpm_db_read(db, INFRQ_DEPENDS, depinfo);
|
||||||
|
|
||||||
_alpm_log(PM_LOG_DEBUG, _("adding '%s' in requiredby field for '%s'"), info->name, depinfo->name);
|
_alpm_log(PM_LOG_DEBUG, _("adding '%s' in requiredby field for '%s'"), info->name, depinfo->name);
|
||||||
depinfo->requiredby = _alpm_list_add(depinfo->requiredby, strdup(info->name));
|
depinfo->requiredby = _alpm_list_add(depinfo->requiredby, strdup(info->name));
|
||||||
if(_alpm_db_write(db, depinfo, INFRQ_DEPENDS)) {
|
if(_alpm_db_write(db, depinfo, INFRQ_DEPENDS)) {
|
||||||
|
@ -325,6 +325,8 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* Ensure package has the appropriate data */
|
||||||
|
_alpm_db_read(db, INFRQ_DEPENDS, depinfo);
|
||||||
/* splice out this entry from requiredby */
|
/* splice out this entry from requiredby */
|
||||||
depinfo->requiredby = _alpm_list_remove(depinfo->requiredby, info->name, str_cmp, &vdata);
|
depinfo->requiredby = _alpm_list_remove(depinfo->requiredby, info->name, str_cmp, &vdata);
|
||||||
data = vdata;
|
data = vdata;
|
||||||
|
Loading…
Reference in New Issue
Block a user