Simplify rpmcliTransaction() a bit
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 26 Mar 2010 14:14:52 +0000 (16:14 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 26 Mar 2010 15:11:12 +0000 (17:11 +0200)
- 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

index 8a54c99..ec3fba5 100644 (file)
@@ -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);