From 98cfe652077e311d62c6f26fa3c5b6907f013ace Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 26 Mar 2010 16:14:52 +0200 Subject: [PATCH] Simplify rpmcliTransaction() a bit - No need for separate the install and erase cases here for problem filter flags: we only check disk space for added packages so this is just a no-op anyway - Also no need to fiddle with eflags for ordering, we always want ordering unless --noorder specified --- lib/rpminstall.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lib/rpminstall.c b/lib/rpminstall.c index 8a54c99..ec3fba5 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -259,7 +259,7 @@ static int rpmcliTransaction(rpmts ts, struct rpmInstallArguments_s * ia, ps = rpmpsFree(ps); } - if ((eflags? 1 : (!stop)) && !(ia->installInterfaceFlags & INSTALL_NOORDER)) { + if (!stop && !(ia->installInterfaceFlags & INSTALL_NOORDER)) { if (rpmtsOrder(ts)) { rc = numPackages; stop = 1; @@ -267,16 +267,10 @@ static int rpmcliTransaction(rpmts ts, struct rpmInstallArguments_s * ia, } if (numPackages && !stop) { - - if (eflags) { - rpmlog(RPMLOG_DEBUG, "erasing packages\n"); - rpmtsClean(ts); - rc = rpmtsRun(ts, NULL, ia->probFilter & (RPMPROB_FILTER_DISKSPACE|RPMPROB_FILTER_DISKNODES)); - } else { - rpmlog(RPMLOG_DEBUG, "installing binary packages\n"); - rpmtsClean(ts); - rc = rpmtsRun(ts, NULL, ia->probFilter); - } + rpmlog(RPMLOG_DEBUG, eflags ? "erasing packages\n" : + "installing binary packages\n"); + rpmtsClean(ts); + rc = rpmtsRun(ts, NULL, ia->probFilter); ps = rpmtsProblems(ts); -- 2.7.4