[Title] modified parse the "rpm" file.
authorGun Kim <gune.kim@samsung.com>
Thu, 20 Dec 2012 10:13:06 +0000 (19:13 +0900)
committerGun Kim <gune.kim@samsung.com>
Fri, 21 Dec 2012 09:36:11 +0000 (18:36 +0900)
[Type]
[Module]
[Priority]
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

Change-Id: Idcbf5b56516b3210b7022c8fd283c291a9901e41

org.tizen.common.connection/src/org/tizen/common/connection/debugtools/OnDemandInstall.java

index 587c0d6..44d78a1 100644 (file)
@@ -449,15 +449,19 @@ public class OnDemandInstall {
         //            version = HostUtil.returnExecute( String.format( DebugTool.RPM_QUERY_COMMAND, "%{VERSION}", "-p " + f.getCanonicalPath()) );
         //            name = HostUtil.returnExecute( String.format( DebugTool.RPM_QUERY_COMMAND, "%{NAME}", "-p " + f.getCanonicalPath()) );
 
-        // RPM file format : gtest-0.0.8-7.1.armv7l.rpm
+        // RPM file format : <name>-<version>-<release>.<architecture>.rpm
         String[] fileSplit = f.getName().split("-");
         if ( fileSplit.length < 3 ) {
             return null;
         }
+        
         name = fileSplit[0];
+        for ( int i = 1 ; i < fileSplit.length - 2 ; i++ ) {
+            name += "-" + fileSplit[i];
+        }
         // version is not used
         // FIXME : Unsafe way to extract the version.
-        version = fileSplit[1];
+        version = fileSplit[fileSplit.length - 2];
         String[] archSplit = fileSplit[fileSplit.length-1].split("\\.");
         architecture = archSplit[archSplit.length-2];