SYNC: Remove rsync "--delete" option when synchronizing workspace. 08/20408/1
authordonghyuk.yang <donghyuk.yang@samsung.com>
Wed, 7 May 2014 00:33:39 +0000 (09:33 +0900)
committerdonghyuk.yang <donghyuk.yang@samsung.com>
Wed, 7 May 2014 00:33:39 +0000 (09:33 +0900)
GBS incremental option is not working because of "--delete" option.

Change-Id: Ife793ff920f8921714d5f878ce3dab2c1997db31
Signed-off-by: donghyuk.yang <donghyuk.yang@samsung.com>
org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformExternalBuildRunner.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/PlatformLaunchDelegate.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/synchronize/RootstrapSynchronizer.java [moved from org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/RootstrapSynchronizer.java with 96% similarity]
org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/synchronize/RsyncProcessor.java [moved from org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/RsyncProcessor.java with 85% similarity]
org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/synchronize/WorkspaceDeltaManager.java [moved from org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceDeltaManager.java with 87% similarity]
org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/synchronize/WorkspaceResourceDelta.java [moved from org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceResourceDelta.java with 92% similarity]
org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/synchronize/WorkspaceSynchronizer.java [moved from org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceSynchronizer.java with 92% similarity]
org.tizen.nativeplatform/src/org/tizen/nativeplatform/views/ui/RootstrapView.java

index 345b884..3ef09ad 100644 (file)
@@ -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;
index 11c808a..64f9a4a 100644 (file)
@@ -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;
@@ -1,4 +1,4 @@
-package org.tizen.nativeplatform.remote.connection;\r
+package org.tizen.nativeplatform.remote.synchronize;\r
 \r
 import java.io.File;\r
 import java.util.ArrayList;\r
@@ -25,6 +25,7 @@ import org.tizen.common.util.FileUtil;
 import org.tizen.common.util.log.UserLogger;\r
 import org.tizen.nativecommon.build.SmartBuildInterface;\r
 import org.tizen.nativeplatform.build.PlatformConfigurationManager;\r
+import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;\r
 import org.tizen.nativeplatform.util.PlatformUserInteraction;\r
 import org.tizen.nativeplatform.util.RootstrapUtil;\r
 import org.tizen.nativeplatform.views.model.PlatformRootstrap;\r
@@ -180,7 +181,7 @@ public class RootstrapSynchronizer {
                 UserLogger.start(PlatformUserInteraction.CATE_SYNCRONIZE, PlatformUserInteraction.SYNC_INCLUDES);\r
                 if (syncIncludes) {\r
                     monitor.subTask(String.format("Synchronize includes... [%s]", rootstrap.getId()));\r
-                    processor.downloadSync(remoteIncludePath, usrDir.toString(), EXCLUDES, monitor);\r
+                    processor.downloadSync(remoteIncludePath, usrDir.toString(), EXCLUDES, true, monitor);\r
                 }\r
                 monitor.worked(1);\r
                 if (syncDebugsrc) {\r
@@ -188,7 +189,7 @@ public class RootstrapSynchronizer {
                         FileUtil.createDirectory(debugDir);\r
                     }\r
                     monitor.subTask(String.format("Synchronize debug source... [%s]", rootstrap.getId()));\r
-                    processor.downloadSync(remoteDebugsrcPath, debugDir.toString(), null, monitor);\r
+                    processor.downloadSync(remoteDebugsrcPath, debugDir.toString(), null, true, monitor);\r
                 }\r
                 monitor.worked(1);\r
                 UserLogger.end(PlatformUserInteraction.CATE_SYNCRONIZE, PlatformUserInteraction.SYNC_INCLUDES);\r
@@ -1,4 +1,4 @@
-package org.tizen.nativeplatform.remote.connection;\r
+package org.tizen.nativeplatform.remote.synchronize;\r
 \r
 import java.util.HashMap;\r
 import java.util.List;\r
@@ -22,7 +22,7 @@ public class RsyncProcessor {
         this.sshPrivateKey = sshPrivateKey;\r
     }\r
     \r
-    public boolean downloadSync(String remotePath, String localPath, String[] excludes, IProgressMonitor monitor) throws InterruptedException {\r
+    public boolean downloadSync(String remotePath, String localPath, String[] excludes, boolean delete, IProgressMonitor monitor) throws InterruptedException {\r
         SmartBuildInterface sbi = SmartBuildInterface.getInstance();\r
         String[] envs = sbi.getEnvironmentVariables();\r
         Map<String, String> envMap = new HashMap<String, String>();\r
@@ -45,7 +45,11 @@ public class RsyncProcessor {
         StringBuffer cmd = new StringBuffer();\r
         cmd.append(new Path(msysBinPath).append("sh.exe").toOSString());\r
         cmd.append(" -c \"");\r
-        cmd.append("rsync -avz --delete -e");\r
+        cmd.append("rsync -avz ");\r
+        if (delete) {\r
+            cmd.append("--delete ");\r
+        }\r
+        cmd.append("-e ");\r
         cmd.append("'ssh -i ");\r
         cmd.append(sshPrivateKey);\r
         cmd.append(" -o StrictHostKeyChecking=no");\r
@@ -64,8 +68,8 @@ public class RsyncProcessor {
         return result;\r
     }\r
     \r
-    public boolean uploadSync(String localPath, String remotePath, String[] excludes, IProgressMonitor monitor) \r
-        throws InterruptedException {\r
+    public boolean uploadSync(String localPath, String remotePath, String[] excludes, boolean delete, \r
+            IProgressMonitor monitor) throws InterruptedException {\r
         SmartBuildInterface sbi = SmartBuildInterface.getInstance();\r
         String[] envs = sbi.getEnvironmentVariables();\r
         Map<String, String> envMap = new HashMap<String, String>();\r
@@ -89,7 +93,11 @@ public class RsyncProcessor {
         StringBuffer cmd = new StringBuffer();\r
         cmd.append(new Path(msysBinPath).append("sh.exe").toOSString());\r
         cmd.append(" -c \"");\r
-        cmd.append("rsync -avz --delete -e ");\r
+        cmd.append("rsync -avz ");\r
+        if (delete) {\r
+            cmd.append("--delete ");\r
+        }\r
+        cmd.append("-e ");\r
         cmd.append("'ssh -i ");\r
         cmd.append(sshPrivateKey);\r
         cmd.append(" -o StrictHostKeyChecking=no");\r
@@ -1,4 +1,4 @@
-package org.tizen.nativeplatform.remote.connection;\r
+package org.tizen.nativeplatform.remote.synchronize;\r
 \r
 import org.eclipse.core.resources.IProject;\r
 import org.eclipse.core.runtime.IPath;\r
@@ -14,6 +14,7 @@ import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;
 import org.eclipse.ptp.remotetools.exception.RemoteExecutionException;\r
 import org.eclipse.ptp.remotetools.exception.RemoteOperationException;\r
 import org.tizen.common.util.log.UserLogger;\r
+import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;\r
 import org.tizen.nativeplatform.util.PlatformUserInteraction;\r
 import org.tizen.nativeplatform.util.RootstrapUtil;\r
 \r
@@ -36,7 +37,7 @@ public class WorkspaceSynchronizer {
             UserLogger.start(PlatformUserInteraction.CATE_SYNCRONIZE, PlatformUserInteraction.SYNC_WORKSPACE);\r
             RsyncProcessor processor = new RsyncProcessor(host, user, sshKeyPath);\r
             UserLogger.end(PlatformUserInteraction.CATE_SYNCRONIZE, PlatformUserInteraction.SYNC_WORKSPACE);\r
-            boolean result = processor.uploadSync(sourcePath, workspacePath, EXCLUDES, monitor);\r
+            boolean result = processor.uploadSync(sourcePath, workspacePath, EXCLUDES, false, monitor);\r
             return result;\r
         } catch (RemoteOperationException e) {\r
             e.printStackTrace();\r
index 2f0a5bf..d4fec0e 100644 (file)
@@ -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();