PKGMGR: Show the latest packages on package manager
authordonghyuk.yang <donghyuk.yang@samsung.com>
Thu, 13 Feb 2014 07:58:26 +0000 (16:58 +0900)
committerdonghyuk.yang <donghyuk.yang@samsung.com>
Thu, 13 Feb 2014 07:58:26 +0000 (16:58 +0900)
On package manager, show the latest package if two repositories have same package as different version.

Change-Id: I34999f976cfd533acf941d7e09e1d8bcaef20a99
Signed-off-by: donghyuk.yang <donghyuk.yang@samsung.com>
org.tizen.nativeplatform/src/org/tizen/nativeplatform/coredump/CoredumpSelectionHandler.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkg/tools/ZypperXmlParser.java

index f7adaf1..b22c138 100644 (file)
@@ -9,7 +9,6 @@ import java.util.List;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.Path;
-import org.eclipse.jgit.util.FileUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.tizen.common.TizenPlatformConstants;
@@ -39,7 +38,7 @@ public class CoredumpSelectionHandler {
         monitor.subTask("Downloading coredump archive...");
         try {
             String workingDir = CommandLauncherUtil.getCoredumpDir();
-            FileUtils.mkdirs(new File(workingDir), true);
+            FileUtil.createDirectory(workingDir);
             String coredumpPath = corefileEntry.getFullPath();
             String fileName = new Path(coredumpPath).lastSegment().replace(".tar.gz", "");
             String destFilePrefix = new Path(workingDir).append(fileName).toOSString();
@@ -59,8 +58,7 @@ public class CoredumpSelectionHandler {
         monitor.subTask("Extracting coredump archive...");
         try {
             String workingDir = CommandLauncherUtil.getCoredumpDir();
-            FileUtils.mkdirs(new File(workingDir), true);
-
+            FileUtil.createDirectory(workingDir);
             // extract .coredump file
             String cmd = String.format(TizenPlatformConstants.DEBUG_COREFILE_EXTRACT_COMMAND,
                     coredumpArchive, workingDir, coreExpr);
index a04887b..5599ac6 100644 (file)
@@ -147,15 +147,16 @@ public class ZypperXmlParser {
                     Package pkg = new Package(name, version, arch);
                     PkgStatus newStatus = new PkgStatus(pkg);
                     newStatus.setNewVer(version);
-                    if (part[0].equals("i")) {
-                        newStatus.setInstalledVer(version);
-                        newStatus.setInstallInfo(PkgInstallTypes.INSTALLED);
+                    if (pkgMap.get(name) == null) {
+                        if (part[0].equals("i")) {
+                            newStatus.setInstalledVer(version);
+                            newStatus.setInstallInfo(PkgInstallTypes.INSTALLED);
+                        }
+                        pkgMap.put(name, newStatus);
                     }
-                    pkgMap.put(name, newStatus);
                 }
             }
         }
-
         return pkgMap;
     }
 
@@ -208,11 +209,13 @@ public class ZypperXmlParser {
                     Package pkg = new Package(name, version, arch);
                     PkgStatus newStatus = new PkgStatus(pkg);
                     newStatus.setNewVer(version);
-                    if (part[0].equals("i")) {
-                        newStatus.setInstalledVer(version);
-                        newStatus.setInstallInfo(PkgInstallTypes.INSTALLED);
+                    if (pkgMap.get(name) == null) {
+                        if (part[0].equals("i")) {
+                            newStatus.setInstalledVer(version);
+                            newStatus.setInstallInfo(PkgInstallTypes.INSTALLED);
+                        }
+                        pkgMap.put(name, newStatus);
                     }
-                    pkgMap.put(name, newStatus);
                 }
             }
         }