summaryrefslogtreecommitdiff
path: root/lib/libalpm/add.c
diff options
context:
space:
mode:
authorNagy Gabor <ngaba@petra.hos.u-szeged.hu>2007-07-16 20:58:58 +0200
committerDan McGee <dan@archlinux.org>2007-08-20 15:23:53 -0400
commitb1808930ce45a034981626fc20bbc7920890899e (patch)
tree7bdcb9fe684c0a9f508abe4503cc93c8ae31b2b5 /lib/libalpm/add.c
parent17d9122e01f5a675f4c7882e68ceae65aae7b5aa (diff)
downloadpacman-b1808930ce45a034981626fc20bbc7920890899e.tar.xz
libalpm/add.c,trans.c : cleanup of requiredby handling.
This patch cleans up and fix the _alpm_trans_update_depends function and ensure that all requiredby fields are filled in case of multiple satisfiers (previously, the handling of mutliple satisfiers in that function was inconsistent). This makes a special case handling of requiredby in commit_single_pkg() obsolete, and so allows cleaning that code as well. Also fixed upgrade056 pactest because : 1) the requiredby fields were wrong, and this wouldn't happen with the fixed _alpm_trans_update_depends(). 2) this is a very unusual case anyway (and handling all corner cases combined to a broken database seems nearly impossible to achieve). References : http://www.archlinux.org/pipermail/pacman-dev/2007-July/008919.html http://www.archlinux.org/pipermail/pacman-dev/2007-July/008920.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Diffstat (limited to 'lib/libalpm/add.c')
-rw-r--r--lib/libalpm/add.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 9ef83d91..398839a6 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -827,43 +827,6 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
* looking for packages depending on the package to add */
_alpm_pkg_update_requiredby(newpkg);
- /* special case: if our provides list has changed from oldpkg to newpkg AND
- * we get here, we need to make sure we find the actual provision that
- * still satisfies this case, and update its 'requiredby' field... ugh */
- /* TODO this seems really messy and should be taken care of elsewhere */
- alpm_list_t *provdiff, *prov;
- provdiff = alpm_list_diff(alpm_pkg_get_provides(oldpkg),
- alpm_pkg_get_provides(newpkg),
- _alpm_str_cmp);
- for(prov = provdiff; prov; prov = prov->next) {
- const char *provname = prov->data;
- _alpm_log(PM_LOG_DEBUG, "provision '%s' has been removed from package %s (%s => %s)",
- provname, alpm_pkg_get_name(oldpkg),
- alpm_pkg_get_version(oldpkg), alpm_pkg_get_version(newpkg));
-
- alpm_list_t *p = _alpm_db_whatprovides(handle->db_local, provname);
- if(p) {
- /* we now have all the provisions in the local DB for this virtual
- * package... seeing as we can't really determine which is the 'correct'
- * provision, we'll use the FIRST for now.
- * TODO figure out a way to find a "correct" provision */
- pmpkg_t *provpkg = p->data;
- const char *pkgname = alpm_pkg_get_name(provpkg);
- _alpm_log(PM_LOG_DEBUG, "updating '%s' due to provision change (%s)",
- pkgname, provname);
- _alpm_pkg_update_requiredby(provpkg);
-
- if(_alpm_db_write(db, provpkg, INFRQ_DEPENDS)) {
- _alpm_log(PM_LOG_ERROR, _("could not update provision '%s' from '%s'"),
- provname, pkgname);
- alpm_logaction("error: could not update provision '%s' from '%s'",
- provname, pkgname);
- RET_ERR(PM_ERR_DB_WRITE, -1);
- }
- }
- }
- alpm_list_free(provdiff);
-
/* make an install date (in UTC) */
time_t t = time(NULL);
strncpy(newpkg->installdate, asctime(gmtime(&t)), PKG_DATE_LEN);