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

commit c5435598260ff646d96998b5fdea653861cb2897
Author: Michel Hermier <[email protected]>
Date:   Tue Sep 23 11:21:04 2014 +0200

libpacman: Add pmsyncpkg when resolving depends.

diff --git a/lib/libpacman/deps.cpp b/lib/libpacman/deps.cpp
index 63fcbd0..44ab558 100644
--- a/lib/libpacman/deps.cpp
+++ b/lib/libpacman/deps.cpp
@@ -533,6 +533,7 @@ int pmtrans_t::resolvedeps(Package *syncpkg, FList<Package 
*> &list,
continue;
}

+               /* FIXME: PM_TRANS_FLAG_DEPENDSONLY are ignored and should 
require a flag flipping */
if(!_pacman_pkg_isin(ps->name(), trail)) {
/* check pmo_ignorepkg and pmo_s_ignore to make sure we haven't pulled in
* something we're not supposed to.
@@ -551,6 +552,15 @@ int pmtrans_t::resolvedeps(Package *syncpkg, FList<Package 
*> &list,
_pacman_log(PM_LOG_DEBUG, _("pulling dependency %s (needed by %s)"),
ps->name(), syncpkg->name());
list.add(ps);
+
+                               pmsyncpkg_t *psync = new 
__pmsyncpkg_t(PM_TRANS_TYPE_UPGRADE, ps);
+                               if(psync == NULL) {
+                                       goto error;
+                               }
+                               psync->m_flags = PM_TRANS_FLAG_ALLDEPS;
+                               syncpkgs.add(psync);
+                               _pacman_log(PM_LOG_FLOW2, _("adding package 
%s-%s to the transaction targets"),
+                                               ps->name(), ps->version());
} else {
_pacman_log(PM_LOG_ERROR, _("cannot resolve dependencies for \"%s\""), 
miss->target);
if(data != NULL) {
diff --git a/lib/libpacman/trans.cpp b/lib/libpacman/trans.cpp
index cf603cf..c3edd82 100644
--- a/lib/libpacman/trans.cpp
+++ b/lib/libpacman/trans.cpp
@@ -495,22 +495,6 @@ int __pmtrans_t::prepare(FPtrList **data)
}
}

-               /* FIXME: PM_TRANS_FLAG_DEPENDSONLY are ignored and should 
require a flag flipping */
-               for(auto i = list.begin(), end = list.end(); i != end; ++i) {
-                       /* add the dependencies found by resolvedeps to the 
transaction set */
-                       Package *spkg = *i;
-                       if(!find(spkg->name())) {
-                               pmsyncpkg_t *ps = new 
__pmsyncpkg_t(PM_TRANS_TYPE_UPGRADE, spkg);
-                               if(ps == NULL) {
-                                       ret = -1;
-                                       goto cleanup;
-                               }
-                               ps->m_flags = PM_TRANS_FLAG_ALLDEPS;
-                               syncpkgs.add(ps);
-                               _pacman_log(PM_LOG_FLOW2, _("adding package 
%s-%s to the transaction targets"),
-                                               spkg->name(), spkg->version());
-                       }
-               }
{
/* remove the targets that where only requiring their depends */
auto it = syncpkgs.begin(), end = syncpkgs.end();
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to