// 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];