[Title] Modified process monitor for installing packages
authordonghyuk.yang <donghyuk.yang@samsung.com>
Tue, 9 Jul 2013 11:06:44 +0000 (20:06 +0900)
committerdonghyuk.yang <donghyuk.yang@samsung.com>
Tue, 9 Jul 2013 11:06:44 +0000 (20:06 +0900)
org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkg/commander/rpm/RpmPackageLauncher.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkg/tools/ZypperXmlParser.java

index 2cd8323..f358cc9 100644 (file)
@@ -101,7 +101,7 @@ public class RpmPackageLauncher implements IPkgLauncher {
     private void internalLaunchPkgs(List<PkgStatus> buildSystemPkgStatus,
             List<PkgStatus> devicePkgStatus, Shell shell, IProgressMonitor monitor)
             throws InterruptedException {
-        monitor.beginTask(PlatformLaunchMessages.INSTALL_PACKAGE, 4);
+        monitor.beginTask(PlatformLaunchMessages.INSTALL_PACKAGE, 3);
         monitor.subTask(PlatformLaunchMessages.CHECK_PKG_STATUS);
 
         boolean isEflApp = PlatformProjectUtil.isEFLApplication(project);
@@ -121,7 +121,7 @@ public class RpmPackageLauncher implements IPkgLauncher {
         if (selecteBsPkgs != null && !selecteBsPkgs.isEmpty()) {
             installPkgsToRootstrap(selecteBsPkgs, IPkgCommander.TOOL.ZYPPER, monitor);
         }
-
+        monitor.worked(2);
         monitor.subTask(PlatformLaunchMessages.INSTALL_PACKAGES_TO_DEVICE);
         if (selecteDvPkgs != null && !selecteDvPkgs.isEmpty()) {
             if (isEflApp) {
@@ -130,6 +130,7 @@ public class RpmPackageLauncher implements IPkgLauncher {
                 installPkgsToDevice(selecteDvPkgs, IPkgCommander.TOOL.ZYPPER, monitor);
             }
         }
+        monitor.worked(3);
         monitor.done();
     }
 
@@ -144,8 +145,6 @@ public class RpmPackageLauncher implements IPkgLauncher {
 
     private void applyReinstallOp(List<PkgStatus> list, boolean reinstallOp) {
         for (PkgStatus status : list) {
-            //status.setChecked(false);
-
             if (status.getInstallInfo().equals(PkgInstallTypes.INSTALLED) && !reinstallOp) {
                 status.setChecked(false);
             }
@@ -220,7 +219,6 @@ public class RpmPackageLauncher implements IPkgLauncher {
 
     private boolean installPkgs(IPkgCommander commander, IPkgCommander.TOOL type,
             List<IPackage> packages, IProgressMonitor monitor) throws InterruptedException {
-        monitor.beginTask("Installing packages to rootstrap", 2);
 
         List<String> paths = new ArrayList<String>();
 
@@ -231,7 +229,6 @@ public class RpmPackageLauncher implements IPkgLauncher {
 
         ICommandStatus status = commander.installLocalPkg(paths.toArray(new String[0]), type,
                 monitor);
-        monitor.worked(1);
 
         if (!status.isOk()) {
             newInterruptedException(status.getMessage());
@@ -245,7 +242,6 @@ public class RpmPackageLauncher implements IPkgLauncher {
             }
         }
 
-        monitor.subTask("Checking installed successfully..");
         String failedInstallPkgs = "";
         for (IPackage p : packages) {
             String name = p.getName();
@@ -253,7 +249,6 @@ public class RpmPackageLauncher implements IPkgLauncher {
                 failedInstallPkgs = failedInstallPkgs + "   - " + name + newline();
             }
         }
-        monitor.worked(2);
 
         if (!failedInstallPkgs.isEmpty()) {
             newInterruptedException(log);
index e808e96..2a8422d 100644 (file)
@@ -137,17 +137,9 @@ public class ZypperXmlParser {
                     newStatus.setNewVer(version);
                     if (part[0].equals("i")) {
                         newStatus.setInstalledVer(version);
-                        newStatus.setInstallInfo(PkgInstallTypes.INSTALLED);
-                        /*
-                         * pkgMap.put(name, new Package(name, version,
-                         * Package.INSTALLINFO.INSTALLED, version, arch));
-                         */
+                        newStatus.setInstallInfo(PkgInstallTypes.INSTALLED);                     
                     }
                     pkgMap.put(name, newStatus);
-                    /*
-                     * else { pkgMap.put(name, new Package(name, "", version,
-                     * arch)); }
-                     */
                 }
             }
         }