Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=6a3f3d8611ab23b1a79e214f8542353a2928b5b9
commit 6a3f3d8611ab23b1a79e214f8542353a2928b5b9 Author: Michel Hermier <[email protected]> Date: Sat Aug 16 06:52:48 2014 +0200 libpacman: Make code more symetric. diff --git a/lib/libpacman/trans.cpp b/lib/libpacman/trans.cpp index 05f175c..56bda78 100644 --- a/lib/libpacman/trans.cpp +++ b/lib/libpacman/trans.cpp @@ -339,12 +339,12 @@ int __pmtrans_t::add(const char *target, pmtranstype_t type, int flags) pmlist_t *p; _pacman_log(PM_LOG_FLOW2, _("target '%s' not found -- looking for provisions"), targ); p = dbs->whatPackagesProvide(targ); - if(p == NULL) { - RET_ERR(PM_ERR_PKG_NOT_FOUND, -1); + if(p != NULL) { + _pacman_log(PM_LOG_DEBUG, _("found '%s' as a provision for '%s'"), f_stringlistitem_to_str(p), targ); + spkg = dbs->find(f_stringlistitem_to_str(p)); + FREELISTPTR(p); } - _pacman_log(PM_LOG_DEBUG, _("found '%s' as a provision for '%s'"), f_stringlistitem_to_str(p), targ); - spkg = dbs->find(f_stringlistitem_to_str(p)); - FREELISTPTR(p); + break; } } } @@ -360,7 +360,7 @@ int __pmtrans_t::add(const char *target, pmtranstype_t type, int flags) for(i = dbs_sync; i && !spkg; i = i->next) { Database *dbs = i->data; pmlist_t *p = dbs->whatPackagesProvide(targ); - if(p) { + if(p != NULL) { _pacman_log(PM_LOG_DEBUG, _("found '%s' as a provision for '%s'"), f_stringlistitem_to_str(p), targ); spkg = dbs->find(f_stringlistitem_to_str(p)); FREELISTPTR(p); _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
