Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=69fb7624cbf17cf5d6d6ed8e3caa1ed70cfc208a

commit 69fb7624cbf17cf5d6d6ed8e3caa1ed70cfc208a
Author: Michel Hermier <[email protected]>
Date:   Fri May 3 21:32:31 2013 +0200

libpacman: Use _pacman_trans_add_pkg.

diff --git a/lib/libpacman/trans.c b/lib/libpacman/trans.c
index d23474c..29b9bec 100644
--- a/lib/libpacman/trans.c
+++ b/lib/libpacman/trans.c
@@ -620,14 +620,7 @@ int _pacman_sync_prepare (pmtrans_t *trans, pmlist_t 
**data)
/* add the dependencies found by resolvedeps to the transaction set */
pmpkg_t *spkg = i->data;
if(!__pacman_trans_get_trans_pkg(trans, spkg->name)) {
-                               pmsyncpkg_t *ps = 
__pacman_trans_pkg_new(PM_TRANS_TYPE_ADD, spkg);
-                               if(ps == NULL) {
-                                       ret = -1;
-                                       goto cleanup;
-                               }
-                               trans->packages = 
_pacman_list_add(trans->packages, ps);
-                               _pacman_log(PM_LOG_FLOW2, _("adding package 
%s-%s to the transaction targets"),
-                                               spkg->name, spkg->version);
+                               _pacman_trans_add_pkg (trans, spkg, 
PM_TRANS_TYPE_UPGRADE, 0);
} else {
/* remove the original targets from the list if requested */
if((trans->flags & PM_TRANS_FLAG_DEPENDSONLY)) {
diff --git a/lib/libpacman/trans_sysupgrade.c b/lib/libpacman/trans_sysupgrade.c
index 0c14947..2170c29 100644
--- a/lib/libpacman/trans_sysupgrade.c
+++ b/lib/libpacman/trans_sysupgrade.c
@@ -186,17 +186,7 @@ int _pacman_sync_sysupgrade(pmtrans_t *trans)
} else {
_pacman_log(PM_LOG_FLOW2, _("%s-%s elected for upgrade (%s => %s)"),
local->name, local->version, local->version, spkg->version);
-                       /* check if spkg->name is already in the packages list. 
*/
-                       if(!__pacman_trans_get_trans_pkg(trans, spkg->name)) {
-                               ps = __pacman_trans_pkg_new 
(PM_TRANS_TYPE_UPGRADE, spkg);
-                               if(ps == NULL) {
-                                       goto error;
-                               }
-                               ps->pkg_local = local;
-                               trans->packages = 
_pacman_list_add(trans->packages, ps);
-                       } else {
-                               /* spkg->name is already in the packages list 
-- just ignore it */
-                       }
+                       _pacman_trans_add_pkg (trans, spkg, 
PM_TRANS_TYPE_UPGRADE, 0);
}
}
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to