From 40e63b07bc7c336a378720c9e6e5bb41e70e0510 Mon Sep 17 00:00:00 2001 From: Gun Kim Date: Wed, 10 Apr 2013 13:05:40 +0900 Subject: [PATCH] Revert "[Title] restored RDS's installation directory and RDS's installation command." This reverts commit 458e475e2d23adffe07184f9d06a6f7267a6e323. --- .../src/org/tizen/common/rds/RdsDeltaDetector.java | 4 -- .../src/org/tizen/common/rds/RdsDeployer.java | 64 ++++------------------ 2 files changed, 11 insertions(+), 57 deletions(-) diff --git a/org.tizen.common/src/org/tizen/common/rds/RdsDeltaDetector.java b/org.tizen.common/src/org/tizen/common/rds/RdsDeltaDetector.java index 6a6c485..caa3dd8 100755 --- a/org.tizen.common/src/org/tizen/common/rds/RdsDeltaDetector.java +++ b/org.tizen.common/src/org/tizen/common/rds/RdsDeltaDetector.java @@ -85,10 +85,6 @@ public class RdsDeltaDetector { String strLocalFile = project.getLocation().toString() + "/" + STR_TREE_FILE; - if ( !new File(strLocalFile).exists() ) { - return; - } - DataInputStream input = null; try { input = new DataInputStream(new SafeFileInputStream(strLocalFile, strLocalFile + ".temp", TREE_BUFFER_SIZE)); diff --git a/org.tizen.common/src/org/tizen/common/rds/RdsDeployer.java b/org.tizen.common/src/org/tizen/common/rds/RdsDeployer.java index 97750c3..15a9c7b 100644 --- a/org.tizen.common/src/org/tizen/common/rds/RdsDeployer.java +++ b/org.tizen.common/src/org/tizen/common/rds/RdsDeployer.java @@ -30,9 +30,7 @@ import java.io.Closeable; import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.HashSet; import java.util.List; -import java.util.Set; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; @@ -183,8 +181,6 @@ public abstract class RdsDeployer implements Closeable{ DeltaResourceInfo interestNode = null; RdsDeltaListFile deltaListFile = new RdsDeltaListFile(); String type = null; - boolean isNeededInstall = false; - Set needAppOwnerSet = new HashSet(); for ( DeltaResourceInfo node : deltaInfoList ) { interestNode = null; @@ -197,11 +193,6 @@ public abstract class RdsDeployer implements Closeable{ if ( interestNode == null ) { continue; } - - if ( DeltaResourceInfo.TYPE_INSTALL.equals(interestNode.getType()) ) { - isNeededInstall = true; - } - strRemotePath = getRemotePathOfDelta(interestNode, strProjectPath, node); strRemoteAbsolutePath = strAppInstallPath + "/" + strRemotePath; @@ -225,55 +216,29 @@ public abstract class RdsDeployer implements Closeable{ else if ( DeltaResourceInfo.TYPE_ADD.equals(type) ){ deltaListFile.addAddDelta(strRemotePath); } - - for ( String needAppOwnerPath : needAppOwnerArray ) { - String needAppOwnerFullPath = strAppInstallPath + needAppOwnerPath; - if ( strRemoteAbsolutePath.startsWith( needAppOwnerFullPath ) ) { - needAppOwnerSet.add(needAppOwnerFullPath); - break; - } - } } catch (Exception e) { newCoreException(RdsDeployer.makeRdsLog(RdsMessages.RDS_PUSH_ERROR), e); } } else if ( DeltaResourceInfo.TYPE_DELETE.equals(type) ) { - try { - command = String.format(TizenPlatformConstants.REMOVE_FILE_COMMAND, addQuotes(strRemoteAbsolutePath) + TizenPlatformConstants.CMD_SUFFIX); - tizenCommand.runCommand(command, true, null); - } catch (Exception e) { - newCoreException(RdsDeployer.makeRdsLog(RdsMessages.RDS_DELETE_ERROR), e); - } deltaListFile.addDeleteDelta(strRemotePath); } } - for ( String needAppOwnerPath : needAppOwnerSet ) { + File file = deltaListFile.makeFile(strProjectPath); + if ( file != null ) { try { - tizenCommand.runCommand( String.format(TizenPlatformConstants.RDS_CHANGE_OWNER_COMMAND, needAppOwnerPath) , true, TizenPlatformConstants.CMD_SUCCESS); + command = RdsDeployer.makeRdsLog(NLS.bind(RdsMessages.RDS_PUSH_LOG, file.getCanonicalPath(), strAppInstallPath + "/" + file.getName())); + SyncResult result = getSyncService().pushFile(file.getCanonicalPath(), strAppInstallPath + "/" + file.getName(), SyncService.getNullProgressMonitor()); + if ( result.getCode() != SyncService.RESULT_OK ) { + throw new IOException(command); + } + printInfo( command ); } catch (Exception e) { newCoreException(RdsDeployer.makeRdsLog(RdsMessages.RDS_PUSH_ERROR), e); } - } - - if ( isNeededInstall ) { postInstall(); } - -// File file = deltaListFile.makeFile(strProjectPath); -// if ( file != null ) { -// try { -// command = RdsDeployer.makeRdsLog(NLS.bind(RdsMessages.RDS_PUSH_LOG, file.getCanonicalPath(), strAppInstallPath + "/" + file.getName())); -// SyncResult result = getSyncService().pushFile(file.getCanonicalPath(), strAppInstallPath + "/" + file.getName(), SyncService.getNullProgressMonitor()); -// if ( result.getCode() != SyncService.RESULT_OK ) { -// throw new IOException(command); -// } -// printInfo( command ); -// } catch (Exception e) { -// newCoreException(RdsDeployer.makeRdsLog(RdsMessages.RDS_PUSH_ERROR), e); -// } -// postInstall(); -// } } public List getInterestDelta( List deltaInfoList ) { @@ -327,15 +292,12 @@ public abstract class RdsDeployer implements Closeable{ SdbCommand sdbCommand = new SdbCommand(device, console); try { - String installCommand = String.format(TizenPlatformConstants.PKG_TOOL_INSTALL_COMMAND, pkgType.toLowerCase(), strAppInstallPath); - sdbCommand.runCommand(installCommand, new PkgcmdErrorType()); -// String installCommand = String.format(TizenPlatformConstants.PKG_TOOL_REINSTALL_COMMAND, pkgType.toLowerCase(), getPkgId()); - + String installCommand = String.format(TizenPlatformConstants.PKG_TOOL_REINSTALL_COMMAND, pkgType.toLowerCase(), getPkgId()); //String installCommand = String.format("osp-installer -r %s", getPkgId()); // TODO: Timeout is temporary. // If "pkgcmd -r" is normal operation, timeout should be removed. -// sdbCommand.runCommand(installCommand, new PkgcmdErrorType(), 20000); -// sdbCommand.runCommand( String.format(TizenPlatformConstants.REMOVE_FILE_COMMAND, strAppInstallPath)); + sdbCommand.runCommand(installCommand, new PkgcmdErrorType(), 20000); + sdbCommand.runCommand( String.format(TizenPlatformConstants.REMOVE_FILE_COMMAND, strAppInstallPath)); } catch (Exception e) { newCoreException(RdsDeployer.makeRdsLog(RdsMessages.CANNOT_INSTALL), e); } @@ -362,10 +324,6 @@ public abstract class RdsDeployer implements Closeable{ } } - private String addQuotes( String orig ) { - return "\"" + orig + "\""; - } - public static String makeRdsLog( String log ) { return RdsMessages.RDS_MODE_PREFIX + " " + log; } -- 2.7.4