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;
DeltaResourceInfo interestNode = null;
RdsDeltaListFile deltaListFile = new RdsDeltaListFile();
String type = null;
- boolean isNeededInstall = false;
- Set<String> needAppOwnerSet = new HashSet<String>();
for ( DeltaResourceInfo node : deltaInfoList ) {
interestNode = null;
if ( interestNode == null ) {
continue;
}
-
- if ( DeltaResourceInfo.TYPE_INSTALL.equals(interestNode.getType()) ) {
- isNeededInstall = true;
- }
-
strRemotePath = getRemotePathOfDelta(interestNode, strProjectPath, node);
strRemoteAbsolutePath = strAppInstallPath + "/" + strRemotePath;
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<DeltaResourceInfo> getInterestDelta( List<DeltaResourceInfo> deltaInfoList ) {
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);
}
}
}
- private String addQuotes( String orig ) {
- return "\"" + orig + "\"";
- }
-
public static String makeRdsLog( String log ) {
return RdsMessages.RDS_MODE_PREFIX + " " + log;
}