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;
protected ISdbCommandHelper tizenCommand;
protected List<DeltaResourceInfo> interestList = new ArrayList<DeltaResourceInfo>();
private SyncService syncService;
-
+ private final static String[] needAppOwnerArray = new String[] {"/data", "/shared/data", "/shared/trusted", "/setting"};
+
/**
* Prints progress information.
*
this.pkgType = pkgType;
this.strAppInstallPath = getAppInstallPath();
deltaDetector = new RdsDeltaDetector(device, project, strAppInstallPath);
+
}
public void setInterestList( List<DeltaResourceInfo> list) {
String strRemotePath = null;
String command = null;
boolean isInteresting = false;
+ Set<String> needAppOwnerSet = new HashSet<String>();
+
for ( DeltaResourceInfo node : deltaInfoList ) {
isInteresting = false;
for ( DeltaResourceInfo interest : interestList ) {
else {
strRemotePath = strAppInstallPath + node.getFullPath().replaceFirst(strProjectPath + interest.getFullPath(), interest.getRemotePath());
}
+
if ( DeltaResourceInfo.TYPE_INSTALL.equals(interest.getType()) ) {
isNeededInstall = true;
}
try {
command = RdsDeployer.makeRdsLog(NLS.bind(RdsMessages.RDS_PUSH_LOG, node.getFullPath(), strRemotePath));
if ( new File(node.getFullPath()).isDirectory() ) {
- tizenCommand.runCommand( "mkdir -p -m 755 " + strRemotePath + TizenPlatformConstants.CMD_SUFFIX , true, null);
+ tizenCommand.runCommand( String.format(TizenPlatformConstants.RDS_PUSH_DIRECTORY_COMMAND, strRemotePath), true, TizenPlatformConstants.CMD_SUCCESS);
}
else {
SyncResult result = getSyncService().pushFile(node.getFullPath(), strRemotePath, SyncService.getNullProgressMonitor());
throw new IOException(command);
}
}
-
printInfo( command );
+
+ // TODO: The code is removed, if 'pkgcmd' is used to change owner.
+ for ( String needAppOwnerPath : needAppOwnerArray) {
+ String needAppOwnerFullPath = strAppInstallPath + needAppOwnerPath;
+ if ( strRemotePath.startsWith( needAppOwnerFullPath ) ) {
+ needAppOwnerSet.add(needAppOwnerFullPath);
+ break;
+ }
+ }
} catch (Exception e) {
newCoreException(RdsDeployer.makeRdsLog(RdsMessages.RDS_PUSH_ERROR), e);
}
}
}
+ // TODO: It should be replaced to 'pkgcmd'
+ for ( String needAppOwnerPath : needAppOwnerSet ) {
+ try {
+ tizenCommand.runCommand( String.format(TizenPlatformConstants.RDS_CHANGE_OWNER_COMMAND, needAppOwnerPath) , true, TizenPlatformConstants.CMD_SUCCESS);
+ } catch (Exception e) {
+ newCoreException(RdsDeployer.makeRdsLog(RdsMessages.RDS_PUSH_ERROR), e);
+ }
+ }
+
if ( isNeededInstall ) {
postInstall();
}
}
-
+
protected List<DeltaResourceInfo> getDelta() {
return deltaDetector.getDelta(null, null);
}