Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=33b675e656475983c5401da60242c64a47b9870f
commit 33b675e656475983c5401da60242c64a47b9870f Author: Michel Hermier <[email protected]> Date: Mon May 6 18:56:45 2013 +0200 libpacman: Simplify _pacman_sync_sysupgrade creation of to be replaced object. diff --git a/lib/libpacman/trans_sysupgrade.c b/lib/libpacman/trans_sysupgrade.c index 2170c29..b8b8cd7 100644 --- a/lib/libpacman/trans_sysupgrade.c +++ b/lib/libpacman/trans_sysupgrade.c @@ -109,20 +109,12 @@ int _pacman_sync_sysupgrade(pmtrans_t *trans) } dummy->requiredby = f_stringlist_deep_copy(lpkg->requiredby); /* check if spkg->name is already in the packages list. */ - ps = __pacman_trans_get_trans_pkg(trans, spkg->name); - if(ps) { - /* found it -- just append to the replaces list */ - ps->replaces = _pacman_list_add(ps->replaces, dummy); - } else { - /* none found -- enter pkg into the final sync list */ - ps = __pacman_trans_pkg_new (PM_TRANS_TYPE_ADD, spkg); - if(ps == NULL) { - FREEPKG(dummy); - goto error; - } - ps->replaces = _pacman_list_add(ps->replaces, dummy); - trans->packages = _pacman_list_add(trans->packages, ps); + ps = _pacman_trans_add_pkg (trans, spkg, PM_TRANS_TYPE_UPGRADE, 0); + if (ps == NULL) { + FREEPKG(dummy); + goto error; } + ps->replaces = _pacman_list_add(ps->replaces, dummy); _pacman_log(PM_LOG_FLOW2, _("%s-%s elected for upgrade (to be replaced by %s-%s)"), lpkg->name, lpkg->version, spkg->name, spkg->version); } _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
