Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=00158c2514ad2d259cef13007e3473c2bb4e4c67
commit 00158c2514ad2d259cef13007e3473c2bb4e4c67 Author: Michel Hermier <[email protected]> Date: Tue Sep 23 16:00:29 2014 +0200 libpacman: Remove now unecessary list argument in pmtrans_t::resolvedeps. diff --git a/lib/libpacman/deps.cpp b/lib/libpacman/deps.cpp index ea5f909..f724ddd 100644 --- a/lib/libpacman/deps.cpp +++ b/lib/libpacman/deps.cpp @@ -443,7 +443,7 @@ void pmtrans_t::removedeps() * * make sure *list and *trail are already initialized */ -int pmtrans_t::resolvedeps(FList<Package *> &list, FPtrList **data) +int pmtrans_t::resolvedeps(FPtrList **data) { FPtrList deps; FList<Package *> targ; @@ -463,8 +463,8 @@ int pmtrans_t::resolvedeps(FList<Package *> &list, FPtrList **data) Package *ps = NULL; /* check if one of the packages in *list already provides this dependency */ - for(auto j = list.begin(), j_end = list.end(); j != j_end && !found; ++j) { - Package *sp = *j; + for(auto j = syncpkgs.begin(), j_end = syncpkgs.end(); j != j_end && !found; ++j) { + Package *sp = (*j)->pkg_new; if(sp->provides(miss->depend.name)) { _pacman_log(PM_LOG_DEBUG, _("%s provides dependency %s -- skipping"), sp->name(), miss->depend.name); @@ -518,8 +518,7 @@ int pmtrans_t::resolvedeps(FList<Package *> &list, FPtrList **data) } if(usedep) { _pacman_log(PM_LOG_DEBUG, _("pulling dependency %s"), ps->name()); - list.add(ps); - + pmsyncpkg_t *psync = new __pmsyncpkg_t(PM_TRANS_TYPE_UPGRADE, ps); if(psync == NULL) { goto error; diff --git a/lib/libpacman/trans.cpp b/lib/libpacman/trans.cpp index b70a9a9..e317673 100644 --- a/lib/libpacman/trans.cpp +++ b/lib/libpacman/trans.cpp @@ -457,7 +457,6 @@ int __pmtrans_t::prepare(FPtrList **data) Database *db_local; FPtrList lp; FPtrList deps; - FList<Package *> list; /* list allowing checkdeps usage with data from packages */ int ret = 0; /* Sanity checks */ @@ -477,14 +476,13 @@ int __pmtrans_t::prepare(FPtrList **data) if(m_type == PM_TRANS_TYPE_SYNC) { for(auto i = syncpkgs.begin(), end = syncpkgs.end(); i != end; ++i) { pmsyncpkg_t *ps = *i; - list.add(ps->pkg_new); } if(!(flags & PM_TRANS_FLAG_NODEPS)) { /* Resolve targets dependencies */ EVENT(this, PM_TRANS_EVT_RESOLVEDEPS_START, NULL, NULL); _pacman_log(PM_LOG_FLOW1, _("resolving targets dependencies")); - if(resolvedeps(list, data) == -1) { + if(resolvedeps(data) == -1) { /* pm_errno is set by resolvedeps */ ret = -1; goto cleanup; @@ -695,7 +693,6 @@ int __pmtrans_t::prepare(FPtrList **data) } EVENT(this, PM_TRANS_EVT_INTERCONFLICTS_DONE, NULL, NULL); } - list.clear(); /* XXX: this fails for cases where a requested package wants * a dependency that conflicts with an older version of @@ -712,6 +709,7 @@ int __pmtrans_t::prepare(FPtrList **data) * package that's in our final (upgrade) list. */ /*EVENT(this, PM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL);*/ + FList<Package *> list; for(auto i = syncpkgs.begin(), end = syncpkgs.end(); i != end; ++i) { pmsyncpkg_t *ps = *i; for(auto j = ps->m_replaces.begin(), j_end = ps->m_replaces.end(); j != j_end; ++j) { diff --git a/lib/libpacman/trans.h b/lib/libpacman/trans.h index f6f41aa..38e5082 100644 --- a/lib/libpacman/trans.h +++ b/lib/libpacman/trans.h @@ -72,7 +72,7 @@ struct __pmtrans_t FPtrList checkdeps(unsigned char op); FPtrList find_conflicts(); void removedeps(); - int resolvedeps(FList<libpacman::Package *> &list, FPtrList **data); + int resolvedeps(FPtrList **data); FList<libpacman::Package *> sortbydeps(); FList<libpacman::Package *> sortbydeps(const FList<libpacman::Package *> &targets, int mode); _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
