From: Ian Jackson Date: Fri, 28 Mar 2008 16:19:25 +0000 (+0200) Subject: Refactor returning code in deppossi_ok_found X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=043da257abd59e61caeb60c8a3616d0d06118925;p=dpkg Refactor returning code in deppossi_ok_found --- diff --git a/ChangeLog b/ChangeLog index d0a91f81..6aec5ce3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-03-28 Ian Jackson + + * src/packages.c (deppossi_ok_found): Refactor returning code. + 2008-03-28 Ian Jackson * src/depcon.c (depisok): Improve whynot message by stating when a diff --git a/src/packages.c b/src/packages.c index e4016b60..8f1ebeee 100644 --- a/src/packages.c +++ b/src/packages.c @@ -335,10 +335,8 @@ static int deppossi_ok_found(struct pkginfo *possdependee, possdependee->name); } - if (fc_depends) thisf= (dependtry >= 4) ? 2 : 1; - debug(dbg_depcondetail," not configured/able - returning %d",thisf); - (*interestingwarnings)++; - return thisf; + debug(dbg_depcondetail, " not configured/able"); + goto unsuitable; } default: if (providing) { @@ -350,11 +348,18 @@ static int deppossi_ok_found(struct pkginfo *possdependee, possdependee->name); } - if (fc_depends) thisf= (dependtry >= 4) ? 2 : 1; - debug(dbg_depcondetail," not installed - returning %d",thisf); - (*interestingwarnings)++; - return thisf; + debug(dbg_depcondetail, " not installed"); + goto unsuitable; } + +unsuitable: + if (fc_depends) + thisf = (dependtry >= 4) ? 2 : 1; + + debug(dbg_depcondetail, " returning %d", thisf); + (*interestingwarnings)++; + + return thisf; } static void breaks_check_one(struct varbuf *aemsgs, int *ok,