Add removing xml for installation rollback 42/119342/2
authorDamian Pietruchowski <d.pietruchow@samsung.com>
Thu, 16 Mar 2017 10:45:19 +0000 (11:45 +0100)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Fri, 17 Mar 2017 06:57:36 +0000 (23:57 -0700)
For installation request, backup_path_ do not exist
in StepConvertXml, but xml file should be removed
in rollback.

Change-Id: I984b9a44af0e0e6c4f51b0769f0f877a197b99ed
Signed-off-by: Damian Pietruchowski <d.pietruchow@samsung.com>
src/tpk/step/pkgmgr/step_convert_xml.cc

index 03f6a4fea85bf17752771c31cb225d1398c8ca58..f7877e6d792e9faae583b5496cdb559ac3c3dae0 100644 (file)
@@ -140,8 +140,8 @@ common_installer::Step::Status StepConvertXml::clean() {
 }
 
 common_installer::Step::Status StepConvertXml::undo() {
-  if (!backup_path_.empty()) {
-    if (ci::Remove(new_path_)) {
+  if (ci::Remove(new_path_)) {
+    if (!backup_path_.empty()) {
       bs::error_code error;
       bf::rename(backup_path_, new_path_, error);
       if (error)