Do clean operation in opposite direction 28/128628/5
authorDamian Pietruchowski <d.pietruchow@samsung.com>
Wed, 10 May 2017 14:44:37 +0000 (16:44 +0200)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Mon, 26 Jun 2017 08:38:29 +0000 (08:38 +0000)
Change-Id: I6a18f2583a382b102fd5ac17971d160e19eaa7fd
Signed-off-by: Damian Pietruchowski <d.pietruchow@samsung.com>
src/common/app_installer.cc

index fb72ade..49d75d1 100644 (file)
@@ -106,21 +106,23 @@ AppInstaller::Result AppInstaller::Run() {
       }
     } while (it-- != itStart);
   } else {
-    for (auto& step : steps_) {
+    if (it == itEnd)
+      --it;
+    do {
       try {
-        TTRACE(TTRACE_TAG_APP, "%s_%s", step->name(), "clean");
-        if (step->clean() != Step::Status::OK) {
-          LOG(ERROR) << "Error during clean operation(" << step->name() << ")";
+        TTRACE(TTRACE_TAG_APP, "%s_%s", (*it)->name(), "clean");
+        if ((*it)->clean() != Step::Status::OK) {
+          LOG(ERROR) << "Error during clean operation(" << (*it)->name() << ")";
           ret = Result::CLEANUP_ERROR;
           break;
         }
       } catch (const std::exception& err) {
         LOG(ERROR) << "Exception occurred in clean(): " << err.what()
-                   << " in step: " << step->name();
+                   << " in step: " << (*it)->name();
         ret = Result::CLEANUP_ERROR;
         break;
       }
-    }
+    } while (it-- != itStart);
   }
   sync();