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

commit d94d0a716ebef33482a08a54473970901433b4fb
Author: Michel Hermier <[email protected]>
Date:   Mon May 12 12:47:18 2014 +0200

libpacman: Regroup _pacman_checkdeps error reporting code.

diff --git a/lib/libpacman/trans.cpp b/lib/libpacman/trans.cpp
index e6142b4..84e1329 100644
--- a/lib/libpacman/trans.cpp
+++ b/lib/libpacman/trans.cpp
@@ -1281,14 +1281,32 @@ cleanup:

/* look for unsatisfied dependencies */
if(lp != NULL) {
-                       if(type & PM_TRANS_TYPE_ADD) {
+                       if((type == PM_TRANS_TYPE_REMOVE) && (flags & 
PM_TRANS_FLAG_CASCADE)) {
+                               while(lp) {
+                                       pmlist_t *i;
+                                       for(i = lp; i; i = i->next) {
+                                               pmdepmissing_t *miss = 
(pmdepmissing_t *)i->data;
+                                               Package *pkg_local = 
db_local->scan(miss->depend.name, INFRQ_ALL);
+                                               if(pkg_local) {
+                                                       
_pacman_log(PM_LOG_FLOW2, _("pulling %s in the targets list"), 
pkg_local->name());
+                                                       packages = 
_pacman_list_add(packages, pkg_local);
+                                               } else {
+                                                       
_pacman_log(PM_LOG_ERROR, _("could not find %s in database -- skipping"),
+                                                               
miss->depend.name);
+                                               }
+                                       }
+                                       FREELIST(lp);
+                                       lp = _pacman_checkdeps(this, type, 
packages);
+                               }
+                       }
+               }
+               if(lp != NULL){
if(data) {
*data = lp;
} else {
FREELIST(lp);
}
RET_ERR(PM_ERR_UNSATISFIED_DEPS, -1);
-                       }
}

if(type & PM_TRANS_TYPE_ADD) {
@@ -1311,35 +1329,6 @@ cleanup:
FREELISTPTR(packages);
packages = lp;
}
-               if(lp != NULL) {
-                       if(type == PM_TRANS_TYPE_REMOVE && type != 
PM_TRANS_TYPE_UPGRADE) {
-                       if(flags & PM_TRANS_FLAG_CASCADE) {
-                               while(lp) {
-                                       pmlist_t *i;
-                                       for(i = lp; i; i = i->next) {
-                                               pmdepmissing_t *miss = 
(pmdepmissing_t *)i->data;
-                                               Package *pkg_local = 
db_local->scan(miss->depend.name, INFRQ_ALL);
-                                               if(pkg_local) {
-                                                       
_pacman_log(PM_LOG_FLOW2, _("pulling %s in the targets list"), 
pkg_local->name());
-                                                       packages = 
_pacman_list_add(packages, pkg_local);
-                                               } else {
-                                                       
_pacman_log(PM_LOG_ERROR, _("could not find %s in database -- skipping"),
-                                                               
miss->depend.name);
-                                               }
-                                       }
-                                       FREELIST(lp);
-                                       lp = _pacman_checkdeps(this, type, 
packages);
-                               }
-                       } else {
-                               if(data) {
-                                       *data = lp;
-                               } else {
-                                       FREELIST(lp);
-                               }
-                               RET_ERR(PM_ERR_UNSATISFIED_DEPS, -1);
-                       }
-                       }
-               }

if(type == PM_TRANS_TYPE_REMOVE && type != PM_TRANS_TYPE_UPGRADE) {
if(flags & PM_TRANS_FLAG_RECURSE) {
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to