Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=c81fb362e446d1e0279e042623cfd1f0513631ed
commit c81fb362e446d1e0279e042623cfd1f0513631ed Author: Michel Hermier <[email protected]> Date: Mon Sep 22 12:04:55 2014 +0200 libpacman: Make _pacman_checkconflicts a member of pmtrans_t. diff --git a/lib/libpacman/conflict.cpp b/lib/libpacman/conflict.cpp index ab01d7f..f0486c4 100644 --- a/lib/libpacman/conflict.cpp +++ b/lib/libpacman/conflict.cpp @@ -49,14 +49,14 @@ using namespace libpacman; * * conflicts are always name only */ -FPtrList _pacman_checkconflicts(pmtrans_t *trans, const FList<Package *> &packages) +FPtrList pmtrans_t::checkconflicts(const FList<Package *> &packages) { Package *info = NULL; FPtrList baddeps; pmdepmissing_t *miss = NULL; int howmany, remain; double percent; - Database *db_local = trans->m_handle->db_local; + Database *db_local = m_handle->db_local; if(db_local == NULL) { return baddeps; @@ -72,8 +72,8 @@ FPtrList _pacman_checkconflicts(pmtrans_t *trans, const FList<Package *> &packag remain = flib::count(i, end); percent = (double)(howmany - remain + 1) / howmany; - if(trans->m_type == PM_TRANS_TYPE_SYNC) { - PROGRESS(trans, PM_TRANS_PROGRESS_INTERCONFLICTS_START, "", + if(m_type == PM_TRANS_TYPE_SYNC) { + PROGRESS(this, PM_TRANS_PROGRESS_INTERCONFLICTS_START, "", (percent * 100), howmany, howmany - remain + 1); } diff --git a/lib/libpacman/conflict.h b/lib/libpacman/conflict.h index 6b3ddd5..3aed401 100644 --- a/lib/libpacman/conflict.h +++ b/lib/libpacman/conflict.h @@ -33,8 +33,6 @@ struct __pmconflict_t { char ctarget[PKG_NAME_LEN]; }; -FPtrList _pacman_checkconflicts(pmtrans_t *trans, const FList<libpacman::Package *> &packages); - #endif /* _PACMAN_CONFLICT_H */ /* vim: set ts=2 sw=2 noet: */ diff --git a/lib/libpacman/trans.cpp b/lib/libpacman/trans.cpp index 32d5de0..02bb7db 100644 --- a/lib/libpacman/trans.cpp +++ b/lib/libpacman/trans.cpp @@ -555,7 +555,7 @@ int __pmtrans_t::prepare(FPtrList **data) EVENT(this, PM_TRANS_EVT_INTERCONFLICTS_START, NULL, NULL); _pacman_log(PM_LOG_FLOW1, _("looking for conflicts")); - deps = _pacman_checkconflicts(this, list); + deps = checkconflicts(list); if(!deps.empty()) { int errorout = 0; FStringList asked; @@ -870,7 +870,7 @@ cleanup: if(m_type & PM_TRANS_TYPE_ADD) { /* no unsatisfied deps, so look for conflicts */ _pacman_log(PM_LOG_FLOW1, _("looking for conflicts")); - lp = _pacman_checkconflicts(this, m_packages); + lp = checkconflicts(m_packages); if(!lp.empty()) { if(data != NULL) { lp.swap(**data); diff --git a/lib/libpacman/trans.h b/lib/libpacman/trans.h index 93de505..36f2247 100644 --- a/lib/libpacman/trans.h +++ b/lib/libpacman/trans.h @@ -67,6 +67,7 @@ struct __pmtrans_t pmsyncpkg_t *add(pmsyncpkg_t *syncpkg, int flags); int add(const char *target, pmtranstype_t type, int flags, pmsyncpkg_t **syncpkg = NULL); + FPtrList checkconflicts(const FList<libpacman::Package *> &packages); FPtrList checkdeps(unsigned char op); FPtrList checkdeps(unsigned char op, const FList<libpacman::Package *> &packages); FPtrList find_conflicts(); _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
