diff options
author | donghyuk.yang <donghyuk.yang@samsung.com> | 2014-05-07 09:33:39 +0900 |
---|---|---|
committer | donghyuk.yang <donghyuk.yang@samsung.com> | 2014-05-07 09:33:39 +0900 |
commit | 3ae5d6eb0ee1a3b61f329b5ce9260d8bc011f72e (patch) | |
tree | 17f1c72bae4dd67eef9d1cf5685e72f902fab868 | |
parent | cf3157cd07ac4de4047854e07074a1a485fdbab3 (diff) | |
download | nativeplatform-eplugin-3ae5d6eb0ee1a3b61f329b5ce9260d8bc011f72e.tar.gz nativeplatform-eplugin-3ae5d6eb0ee1a3b61f329b5ce9260d8bc011f72e.tar.bz2 nativeplatform-eplugin-3ae5d6eb0ee1a3b61f329b5ce9260d8bc011f72e.zip |
SYNC: Remove rsync "--delete" option when synchronizing workspace.
GBS incremental option is not working because of "--delete" option.
Change-Id: Ife793ff920f8921714d5f878ce3dab2c1997db31
Signed-off-by: donghyuk.yang <donghyuk.yang@samsung.com>
8 files changed, 31 insertions, 21 deletions
diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformExternalBuildRunner.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformExternalBuildRunner.java index 345b8846..3ef09ad7 100644 --- a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformExternalBuildRunner.java +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformExternalBuildRunner.java @@ -101,10 +101,10 @@ import org.tizen.nativecommon.build.SmartBuildInterface; import org.tizen.nativeplatform.Activator; import org.tizen.nativeplatform.build.IBuildCommandProvider.BUILDTOOL; import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager; -import org.tizen.nativeplatform.remote.connection.RootstrapSynchronizer; -import org.tizen.nativeplatform.remote.connection.WorkspaceDeltaManager; -import org.tizen.nativeplatform.remote.connection.WorkspaceResourceDelta; -import org.tizen.nativeplatform.remote.connection.WorkspaceSynchronizer; +import org.tizen.nativeplatform.remote.synchronize.RootstrapSynchronizer; +import org.tizen.nativeplatform.remote.synchronize.WorkspaceDeltaManager; +import org.tizen.nativeplatform.remote.synchronize.WorkspaceResourceDelta; +import org.tizen.nativeplatform.remote.synchronize.WorkspaceSynchronizer; import org.tizen.nativeplatform.rootstrap.RootstrapManager; import org.tizen.nativeplatform.util.IPackageUtil; import org.tizen.nativeplatform.util.PkgUtilFactory; diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/PlatformLaunchDelegate.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/PlatformLaunchDelegate.java index 11c808a2..64f9a4ac 100644 --- a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/PlatformLaunchDelegate.java +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/PlatformLaunchDelegate.java @@ -114,7 +114,7 @@ import org.tizen.nativeplatform.pkg.commander.factory.PkgFilterFactory; import org.tizen.nativeplatform.pkg.model.IPackage; import org.tizen.nativeplatform.pkg.model.PkgStatus; import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager; -import org.tizen.nativeplatform.remote.connection.RootstrapSynchronizer; +import org.tizen.nativeplatform.remote.synchronize.RootstrapSynchronizer; import org.tizen.nativeplatform.rootstrap.RootstrapManager; import org.tizen.nativeplatform.types.CmdTargetTypes; import org.tizen.nativeplatform.util.IPackageUtil; diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/RootstrapSynchronizer.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/synchronize/RootstrapSynchronizer.java index f09dbf69..a4b6b7f3 100644 --- a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/RootstrapSynchronizer.java +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/synchronize/RootstrapSynchronizer.java @@ -1,4 +1,4 @@ -package org.tizen.nativeplatform.remote.connection;
+package org.tizen.nativeplatform.remote.synchronize;
import java.io.File;
import java.util.ArrayList;
@@ -25,6 +25,7 @@ import org.tizen.common.util.FileUtil; import org.tizen.common.util.log.UserLogger;
import org.tizen.nativecommon.build.SmartBuildInterface;
import org.tizen.nativeplatform.build.PlatformConfigurationManager;
+import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
import org.tizen.nativeplatform.util.PlatformUserInteraction;
import org.tizen.nativeplatform.util.RootstrapUtil;
import org.tizen.nativeplatform.views.model.PlatformRootstrap;
@@ -180,7 +181,7 @@ public class RootstrapSynchronizer { UserLogger.start(PlatformUserInteraction.CATE_SYNCRONIZE, PlatformUserInteraction.SYNC_INCLUDES);
if (syncIncludes) {
monitor.subTask(String.format("Synchronize includes... [%s]", rootstrap.getId()));
- processor.downloadSync(remoteIncludePath, usrDir.toString(), EXCLUDES, monitor);
+ processor.downloadSync(remoteIncludePath, usrDir.toString(), EXCLUDES, true, monitor);
}
monitor.worked(1);
if (syncDebugsrc) {
@@ -188,7 +189,7 @@ public class RootstrapSynchronizer { FileUtil.createDirectory(debugDir);
}
monitor.subTask(String.format("Synchronize debug source... [%s]", rootstrap.getId()));
- processor.downloadSync(remoteDebugsrcPath, debugDir.toString(), null, monitor);
+ processor.downloadSync(remoteDebugsrcPath, debugDir.toString(), null, true, monitor);
}
monitor.worked(1);
UserLogger.end(PlatformUserInteraction.CATE_SYNCRONIZE, PlatformUserInteraction.SYNC_INCLUDES);
diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/RsyncProcessor.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/synchronize/RsyncProcessor.java index e69c3f73..8e5f3f6c 100644 --- a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/RsyncProcessor.java +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/synchronize/RsyncProcessor.java @@ -1,4 +1,4 @@ -package org.tizen.nativeplatform.remote.connection;
+package org.tizen.nativeplatform.remote.synchronize;
import java.util.HashMap;
import java.util.List;
@@ -22,7 +22,7 @@ public class RsyncProcessor { this.sshPrivateKey = sshPrivateKey;
}
- public boolean downloadSync(String remotePath, String localPath, String[] excludes, IProgressMonitor monitor) throws InterruptedException {
+ public boolean downloadSync(String remotePath, String localPath, String[] excludes, boolean delete, IProgressMonitor monitor) throws InterruptedException {
SmartBuildInterface sbi = SmartBuildInterface.getInstance();
String[] envs = sbi.getEnvironmentVariables();
Map<String, String> envMap = new HashMap<String, String>();
@@ -45,7 +45,11 @@ public class RsyncProcessor { StringBuffer cmd = new StringBuffer();
cmd.append(new Path(msysBinPath).append("sh.exe").toOSString());
cmd.append(" -c \"");
- cmd.append("rsync -avz --delete -e");
+ cmd.append("rsync -avz ");
+ if (delete) {
+ cmd.append("--delete ");
+ }
+ cmd.append("-e ");
cmd.append("'ssh -i ");
cmd.append(sshPrivateKey);
cmd.append(" -o StrictHostKeyChecking=no");
@@ -64,8 +68,8 @@ public class RsyncProcessor { return result;
}
- public boolean uploadSync(String localPath, String remotePath, String[] excludes, IProgressMonitor monitor)
- throws InterruptedException {
+ public boolean uploadSync(String localPath, String remotePath, String[] excludes, boolean delete,
+ IProgressMonitor monitor) throws InterruptedException {
SmartBuildInterface sbi = SmartBuildInterface.getInstance();
String[] envs = sbi.getEnvironmentVariables();
Map<String, String> envMap = new HashMap<String, String>();
@@ -89,7 +93,11 @@ public class RsyncProcessor { StringBuffer cmd = new StringBuffer();
cmd.append(new Path(msysBinPath).append("sh.exe").toOSString());
cmd.append(" -c \"");
- cmd.append("rsync -avz --delete -e ");
+ cmd.append("rsync -avz ");
+ if (delete) {
+ cmd.append("--delete ");
+ }
+ cmd.append("-e ");
cmd.append("'ssh -i ");
cmd.append(sshPrivateKey);
cmd.append(" -o StrictHostKeyChecking=no");
diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceDeltaManager.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/synchronize/WorkspaceDeltaManager.java index 2e008d7d..e4eab1f6 100644 --- a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceDeltaManager.java +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/synchronize/WorkspaceDeltaManager.java @@ -1,4 +1,4 @@ -package org.tizen.nativeplatform.remote.connection;
+package org.tizen.nativeplatform.remote.synchronize;
import java.util.HashMap;
import java.util.Map;
diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceResourceDelta.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/synchronize/WorkspaceResourceDelta.java index 2b2d67e9..6207e543 100644 --- a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceResourceDelta.java +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/synchronize/WorkspaceResourceDelta.java @@ -1,4 +1,4 @@ -package org.tizen.nativeplatform.remote.connection;
+package org.tizen.nativeplatform.remote.synchronize;
import org.eclipse.core.internal.events.ResourceDeltaFactory;
import org.eclipse.core.internal.resources.Workspace;
diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceSynchronizer.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/synchronize/WorkspaceSynchronizer.java index 29345d3c..2f98a021 100644 --- a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceSynchronizer.java +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/synchronize/WorkspaceSynchronizer.java @@ -1,4 +1,4 @@ -package org.tizen.nativeplatform.remote.connection;
+package org.tizen.nativeplatform.remote.synchronize;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
@@ -14,6 +14,7 @@ import org.eclipse.ptp.remotetools.exception.RemoteConnectionException; import org.eclipse.ptp.remotetools.exception.RemoteExecutionException;
import org.eclipse.ptp.remotetools.exception.RemoteOperationException;
import org.tizen.common.util.log.UserLogger;
+import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
import org.tizen.nativeplatform.util.PlatformUserInteraction;
import org.tizen.nativeplatform.util.RootstrapUtil;
@@ -36,7 +37,7 @@ public class WorkspaceSynchronizer { UserLogger.start(PlatformUserInteraction.CATE_SYNCRONIZE, PlatformUserInteraction.SYNC_WORKSPACE);
RsyncProcessor processor = new RsyncProcessor(host, user, sshKeyPath);
UserLogger.end(PlatformUserInteraction.CATE_SYNCRONIZE, PlatformUserInteraction.SYNC_WORKSPACE);
- boolean result = processor.uploadSync(sourcePath, workspacePath, EXCLUDES, monitor);
+ boolean result = processor.uploadSync(sourcePath, workspacePath, EXCLUDES, false, monitor);
return result;
} catch (RemoteOperationException e) {
e.printStackTrace();
diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/views/ui/RootstrapView.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/views/ui/RootstrapView.java index 2f0a5bfc..d4fec0e4 100644 --- a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/views/ui/RootstrapView.java +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/views/ui/RootstrapView.java @@ -126,8 +126,8 @@ import org.tizen.nativeplatform.pkg.commander.PkgCommandTarget; import org.tizen.nativeplatform.pkgmgr.PkgMgrInitializer; import org.tizen.nativeplatform.pkgmgr.ui.RPMPackageDialog; import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager; -import org.tizen.nativeplatform.remote.connection.RootstrapSynchronizer; -import org.tizen.nativeplatform.remote.connection.RsyncProcessor; +import org.tizen.nativeplatform.remote.synchronize.RootstrapSynchronizer; +import org.tizen.nativeplatform.remote.synchronize.RsyncProcessor; import org.tizen.nativeplatform.repo.commander.LocalRepoMounter; import org.tizen.nativeplatform.repo.commander.RepoManager; import org.tizen.nativeplatform.repo.model.Repository; @@ -764,7 +764,7 @@ public class RootstrapView extends ViewPart { String sshKey = RemoteConnectionManager.getRemoteTools().getPrivateKey(); String localRogenPath = RootstrapUtil.getRogenPath().toOSString(); RsyncProcessor processor = new RsyncProcessor(host, user, sshKey); - processor.uploadSync(localRogenPath, basedir, null, new SubProgressMonitor(monitor, 1)); + processor.uploadSync(localRogenPath, basedir, null, false, new SubProgressMonitor(monitor, 1)); } } catch (RemoteOperationException e) { e.printStackTrace(); |