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

commit 93218f5cee8a1c3affd2588906bfa48f31e0ca76
Author: Michel Hermier <[email protected]>
Date:   Mon May 12 11:55:09 2014 +0200

libpacman: Remove some duplicate code for dependency check in 
__pmtrans_t::prepare.

diff --git a/lib/libpacman/trans.cpp b/lib/libpacman/trans.cpp
index 953f6b7..042a768 100644
--- a/lib/libpacman/trans.cpp
+++ b/lib/libpacman/trans.cpp
@@ -1274,12 +1274,13 @@ cleanup:
/* Check dependencies
*/
if(!(flags & PM_TRANS_FLAG_NODEPS)) {
-               if(type & PM_TRANS_TYPE_ADD) {
EVENT(this, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL);
-
-               /* look for unsatisfied dependencies */
_pacman_log(PM_LOG_FLOW1, _("looking for unsatisfied dependencies"));
+
lp = _pacman_checkdeps(this, type, packages);
+
+               if(type & PM_TRANS_TYPE_ADD) {
+               /* look for unsatisfied dependencies */
if(lp != NULL) {
if(data) {
*data = lp;
@@ -1307,14 +1308,8 @@ cleanup:
/* free the old alltargs */
FREELISTPTR(packages);
packages = lp;
-
-               EVENT(this, PM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL);
}
if(type == PM_TRANS_TYPE_REMOVE && type != PM_TRANS_TYPE_UPGRADE) {
-               EVENT(this, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL);
-
-               _pacman_log(PM_LOG_FLOW1, _("looking for unsatisfied 
dependencies"));
-               lp = _pacman_checkdeps(this, type, packages);
if(lp != NULL) {
if(flags & PM_TRANS_FLAG_CASCADE) {
while(lp) {
@@ -1354,9 +1349,8 @@ cleanup:
/* free the old alltargs */
FREELISTPTR(packages);
packages = lp;
-
-               EVENT(this, PM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL);
}
+               EVENT(this, PM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL);
}

/* Cleaning up
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to