LAUNCH: Supported RDS(run as) on windows.
authordonghyuk,yang <donghyuk.yang@samsung.com>
Sun, 27 Apr 2014 05:04:01 +0000 (14:04 +0900)
committerdonghyuk,yang <donghyuk.yang@samsung.com>
Sun, 27 Apr 2014 05:04:01 +0000 (14:04 +0900)
RDS is supported on windows. It is applied in case of running a project.

Change-Id: I45ce2b5ffc79e595b0d5e5425edb9439fa32dcf3
Signed-off-by: donghyuk,yang <donghyuk.yang@samsung.com>
27 files changed:
org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformExternalBuildRunner.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/gbs/GBSBuildResultProcessor.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/command/launcher/HostCommandLauncher.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/command/launcher/RemoteCommandUtil.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/command/launcher/RemoteScriptProvider.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/PlatformLaunchDelegate.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkg/commander/IPkgCommander.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkg/commander/IPkgModelMaker.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkg/commander/deb/DebCommanderHost.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkg/commander/rpm/RpmCommanderCommon.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkg/commander/rpm/RpmCommanderRemoteHost.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkg/commander/rpm/RpmModelMaker.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkg/commander/rpm/RpmPackageLauncher.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkg/model/IPackage.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/rds/CachePackageChecksum.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/rds/RemoteRpmRapidDeployer.java [new file with mode: 0644]
org.tizen.nativeplatform/src/org/tizen/nativeplatform/rds/RpmRapidDeployer.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/RsyncProcessor.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/rootstrap/BaseFileSystemGenerator.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/util/PackageUtil.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/util/PlatformFileUtil.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/util/PlatformLaunchUtil.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/util/RootstrapUtil.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/views/ui/RemoteConnectionDialog.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/views/ui/RemoteRepoTab.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/views/ui/RootstrapGenDialog.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/views/ui/RootstrapView.java

index cc1df88..a93ddee 100644 (file)
@@ -84,6 +84,10 @@ import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.QualifiedName;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.ptp.remotetools.core.IRemoteFileTools;
+import org.eclipse.ptp.remotetools.exception.CancelException;
+import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;
+import org.eclipse.ptp.remotetools.exception.RemoteOperationException;
 import org.eclipse.swt.widgets.Display;
 import org.tizen.common.util.OSChecker;
 import org.tizen.common.util.log.UserInteraction;
@@ -91,6 +95,7 @@ import org.tizen.common.util.log.UserLogger;
 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.RootstrapSyncronizer;
 import org.tizen.nativeplatform.remote.connection.WorkspaceDeltaManager;
 import org.tizen.nativeplatform.remote.connection.WorkspaceResourceDelta;
@@ -98,6 +103,7 @@ import org.tizen.nativeplatform.remote.connection.WorkspaceSyncronizer;
 import org.tizen.nativeplatform.rootstrap.RootstrapManager;
 import org.tizen.nativeplatform.util.PackageUtil;
 import org.tizen.nativeplatform.util.PlatformProjectUtil;
+import org.tizen.nativeplatform.util.RootstrapUtil;
 import org.tizen.nativeplatform.views.model.PlatformRootstrap;
 
 public class PlatformExternalBuildRunner extends ExternalBuildRunner {
@@ -118,7 +124,8 @@ public class PlatformExternalBuildRunner extends ExternalBuildRunner {
         String targetId = PlatformConfigurationManager.getBuildTargetName(configuration);
         String rootId = SmartBuildInterface.getInstance().getRootstrapIDFromTargetID(targetId);
         final PlatformRootstrap rootstrap = RootstrapManager.getRootstrap(rootId);
-        boolean needRemoteSync = OSChecker.isWindows() && buildArgs[0].equals("clean");
+        boolean needCacheChecksum = !buildArgs[0].equals("clean");
+        boolean needRemoteSync = OSChecker.isWindows() && !buildArgs[0].equals("clean");
         if (needRemoteSync) {
             syncWorkspace(project, configuration, monitor);
             readySyncRootstrap(rootstrap);
@@ -129,11 +136,13 @@ public class PlatformExternalBuildRunner extends ExternalBuildRunner {
                 markerGenerator, projectBuilder, monitor);
         UserLogger.end(UserInteraction.CATE_PLATFORM_BUILD);
         final PackageUtil pkgUtil = new PackageUtil(PlatformProjectUtil.getPkgType());
-        Display.getDefault().asyncExec(new Runnable() {
-            public void run() {
-                pkgUtil.cachePkgChecksum(project, configuration);
-            }
-        });
+        if (needCacheChecksum) {
+               Display.getDefault().asyncExec(new Runnable() {
+                   public void run() {
+                       pkgUtil.cachePkgChecksum(project, configuration);
+                   }
+               });
+        }
         
         if (needRemoteSync) {
             /*
@@ -167,7 +176,20 @@ public class PlatformExternalBuildRunner extends ExternalBuildRunner {
         }
         IResourceDelta delta = resourceDelta.computeDelta();
         boolean needSync = false;
-        if (delta == null) {
+        String remoteWorkspacePath = RootstrapUtil.getUserSyncWorkspacePath(project.getName());
+        IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
+        boolean workspaceExists = false;
+        try {          
+                       workspaceExists = filetool.hasFile(remoteWorkspacePath, new NullProgressMonitor());
+               } catch (RemoteOperationException e) {
+                       e.printStackTrace();
+               } catch (RemoteConnectionException e) {
+                       e.printStackTrace();
+               } catch (CancelException e) {
+                       e.printStackTrace();
+               }
+        
+        if (delta == null || !workspaceExists) {
             needSync = true;
         } else {
             IResourceDelta[] deltas = delta.getAffectedChildren();
index cf3fcb6..0f26a7a 100644 (file)
@@ -45,7 +45,6 @@ import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;
 import org.eclipse.ptp.remotetools.exception.RemoteOperationException;
 import org.tizen.common.util.FileUtil;
 import org.tizen.common.util.OSChecker;
-import org.tizen.common.util.log.UserInteraction;
 import org.tizen.common.util.log.UserLogger;
 import org.tizen.nativecommon.build.SmartBuildInterface;
 import org.tizen.nativeplatform.build.IBuildResultProcessor;
@@ -53,7 +52,6 @@ import org.tizen.nativeplatform.build.PlatformConfigurationManager;
 import org.tizen.nativeplatform.filefilter.RpmFileFilter;
 import org.tizen.nativeplatform.filefilter.XmlFileFilter;
 import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
-import org.tizen.nativeplatform.remote.connection.RootstrapSyncronizer;
 import org.tizen.nativeplatform.rootstrap.RootstrapManager;
 import org.tizen.nativeplatform.util.PlatformUserInteraction;
 import org.tizen.nativeplatform.util.RootstrapUtil;
@@ -147,19 +145,25 @@ public class GBSBuildResultProcessor implements IBuildResultProcessor {
         IProject project = (IProject) config.getOwner();
         IPath configPath = project.getLocation().append(config.getName());
         IRemoteCopyTools copytool = RemoteConnectionManager.getRemoteTools().getCopyTool();
-        for (String rpm : rpms) {
-            try {
+        IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
+        String remoteWorkspacePath = RootstrapUtil.getUserSyncWorkspacePath(project.getName());
+        IPath remoteConfigPath = new Path(remoteWorkspacePath).append(config.getName());
+        try {
+               filetool.assureDirectory(remoteConfigPath.toString(), new NullProgressMonitor());
+               for (String rpm : rpms) {            
                 String filename = FileUtil.getFileNameFromPath(rpm);
                 String targetPath = configPath.append(filename).toOSString();
+                String remoteTargetPath = remoteConfigPath.append(filename).toString();
+                filetool.copyFile(rpm, remoteTargetPath, new NullProgressMonitor());
                 copytool.downloadFileToFile(rpm, targetPath);
-                rpmfiles.add(targetPath);
-            } catch (RemoteConnectionException e) {
-                e.printStackTrace();
-            } catch (RemoteOperationException e) {
-                e.printStackTrace();
-            } catch (CancelException e) {
-                e.printStackTrace();
-            }
+                rpmfiles.add(targetPath);            
+               }
+        } catch (RemoteConnectionException e) {
+            e.printStackTrace();
+        } catch (RemoteOperationException e) {
+            e.printStackTrace();
+        } catch (CancelException e) {
+            e.printStackTrace();
         }
         List<String> xmls = getRemoteXmlFiles(rootstrap);
         for (String xml : xmls) {
index e01ff07..87917fd 100644 (file)
@@ -259,6 +259,7 @@ public class HostCommandLauncher {
         // start process
         Process proc = null;
         BufferedReader input = null;
+        BufferedReader err = null;
         StringBuilder contents = null;
         try {
             proc = CommandUtil.createProcess(command, workingDir, includeStdErr);
index 4041822..83dfcdd 100644 (file)
@@ -54,7 +54,7 @@ public class RemoteCommandUtil {
         RemoteProcess proc = null;
         
         try {
-            IRemoteExecutionTools exectool = RemoteConnectionManager.getRemoteTools().getExecTool();
+            IRemoteExecutionTools exectool = RemoteConnectionManager.getRemoteTools().getExecTool();            
             IRemoteScript script = exectool.createScript();
             if (workingDir != null && !workingDir.isEmpty()) {
                 String[] commands = {"cd " + workingDir, command};
index be0d071..db88c59 100644 (file)
@@ -23,7 +23,78 @@ public class RemoteScriptProvider {
     public static final Logger logger = LoggerFactory.getLogger(RemoteScriptProvider.class);
 
     public static synchronized String genCacheChecksumScript(IProject project, String filePaths) {
-        return null;
+        PrintWriter pw = null;
+        String cacheChecksumScript = null;
+        String cachingDir = CommandUtil.getCachingDir(project);
+        String workingDir = CommandUtil.getWorkingDir();
+
+        try {
+            IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
+            filetool.assureDirectory(workingDir, new NullProgressMonitor());
+            
+            String randomNum = CommandUtil.getRandomNum();
+            String fileName = ScriptProvider.CACHE_CHECKSUM_FILENAME + "_" + randomNum + ScriptProvider.SHELL_EXT;
+            
+            cacheChecksumScript = new Path(workingDir).append(fileName).toString();
+            boolean exist = filetool.hasFile(cacheChecksumScript, new NullProgressMonitor());
+            if (exist) {
+               filetool.removeFile(cacheChecksumScript, new NullProgressMonitor());
+            }
+            filetool.createFile(cacheChecksumScript, new NullProgressMonitor());
+            OutputStream out = filetool.getOutputStream(cacheChecksumScript, IRemoteFileTools.NONE,
+                    new NullProgressMonitor());
+            pw = new PrintWriter(out);
+            pw.write("#!/bin/sh -ee");
+            pw.write('\n');
+            pw.write(String.format("rm -rf %s/*", cachingDir));
+            pw.write('\n');
+            pw.write(String.format("mkdir -p %s", cachingDir));
+            pw.write('\n');
+            pw.write(String.format("cd %s", cachingDir));
+            pw.write('\n');
+            pw.write(String.format("for file in `ls %s`", filePaths));
+            pw.write('\n');
+            pw.write("do");
+            pw.write('\n');
+            pw.write("    checksum=`md5sum ${file} | awk '{print $1}'`");
+            pw.write('\n');
+            pw.write("    pkgfile=`basename ${file}`");
+            pw.write('\n');
+            pw.write("    pkgdir=\"${pkgfile}_${checksum}\"");
+            pw.write('\n');
+            pw.write("    rm -rf ${pkgdir}");
+            pw.write('\n');
+            pw.write("    mkdir ${pkgdir}");
+            pw.write('\n');
+            pw.write("    cd ${pkgdir}");
+            pw.write('\n');
+            pw.write("    rpm2cpio ${file} | cpio -idm --quiet");
+            pw.write('\n');
+            pw.write("    echo \"key:  ${pkgdir}\"");
+            pw.write('\n');
+            pw.write("    cd ..");
+            pw.write('\n');
+            pw.write("    find ${pkgdir} -type f -printf '\"%p\"\\n' | xargs md5sum");
+            pw.write('\n');
+            pw.write("done");
+            pw.close();
+            
+            IRemoteItem item = filetool.getFile(cacheChecksumScript, new NullProgressMonitor());
+            if (item.exists()) {
+                item.setExecutable(true);
+                item.commitAttributes(new NullProgressMonitor());
+            }
+        } catch (RemoteOperationException e) {
+                       e.printStackTrace();
+               } catch (RemoteConnectionException e) {
+                       e.printStackTrace();
+               } catch (CancelException e) {
+                       e.printStackTrace();
+               } finally {
+            tryClose(pw);
+        }
+
+        return cacheChecksumScript;
     }
 
     // return generate expect script and return script path
index 1994fbf..1539f12 100644 (file)
@@ -118,6 +118,7 @@ import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
 import org.tizen.nativeplatform.rootstrap.RootstrapManager;
 import org.tizen.nativeplatform.types.CmdTargetTypes;
 import org.tizen.nativeplatform.util.PackageUtil;
+import org.tizen.nativeplatform.util.PlatformFileUtil;
 import org.tizen.nativeplatform.util.PlatformLaunchUtil;
 import org.tizen.nativeplatform.util.PlatformProjectUtil;
 import org.tizen.nativeplatform.util.PlatformUserInteraction;
@@ -336,26 +337,11 @@ public class PlatformLaunchDelegate extends AbstractCLaunchDelegate {
         String appPath = config
                 .getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "");
         IPath hostPath = getHostPath(appPath, config);
-        boolean exists = false;
         if (hostPath != null) {
-            if (OSChecker.isWindows()) {
-                IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
-                try {
-                    exists = filetool.hasFile(hostPath.toString(), new NullProgressMonitor());
-                } catch (RemoteOperationException e) {
-                    e.printStackTrace();
-                } catch (RemoteConnectionException e) {
-                    e.printStackTrace();
-                } catch (CancelException e) {
-                    e.printStackTrace();
-                }
-            } else {
-                exists = hostPath.toFile().exists();                    
-            }
-        }
-        if (!exists) {
-            newCoreException(PlatformLaunchMessages.CANNOT_FIND_EXECUTABLE_IN_A_HOST_ROOTSTRAP,
-                    null);
+               if (!PlatformFileUtil.existsFile(hostPath.toString())) {
+                       newCoreException(PlatformLaunchMessages.CANNOT_FIND_EXECUTABLE_IN_A_HOST_ROOTSTRAP,
+                        null);
+               }
         }
     }
 
index fcbe3ca..8af1a81 100644 (file)
@@ -47,6 +47,12 @@ public interface IPkgCommander {
     PackageManagerOutputReceiver getOutputReceiver();
 
     void setHttpProxy(String proxy);
+    
+    String getArchFromRemoteFile(String filePath);
+
+    String getNameFromRemoteFile(String filePath);
+
+    String getVerFromRemoteFile(String filePath);    
 
     String getArchFromFile(String filePath);
 
index 782439e..79f7bc6 100644 (file)
@@ -33,7 +33,9 @@ import org.tizen.nativeplatform.pkg.model.IPackage;
 
 public interface IPkgModelMaker {
     IPackage makeModel(String filePath);
+    IPackage makeRemoteModel(String filePath);
     IPackage makeModel(String filePath, boolean needsFilter);
+    List<IPackage> makeRemoteModels(List<String> filePaths);
     List<IPackage> makeModels(List<String> filePaths);
     List<IPackage> makeModels(List<String> filePaths, boolean needsFilter);
 }
index 7b34464..492886b 100644 (file)
@@ -310,4 +310,19 @@ public class DebCommanderHost implements IPkgCommander {
     @Override
     public void cancelExecution() {
     }
+
+       @Override
+       public String getArchFromRemoteFile(String filePath) {
+               return "";
+       }
+
+       @Override
+       public String getNameFromRemoteFile(String filePath) {
+               return "";
+       }
+
+       @Override
+       public String getVerFromRemoteFile(String filePath) {
+               return "";                              
+       }
 }
index 4a8f4e2..ab714d7 100644 (file)
@@ -157,6 +157,18 @@ public abstract class RpmCommanderCommon implements IPkgCommander {
             printResultLog(String.format("Set proxy: %s", proxy));
         }
     }
+    
+    public String getArchFromRemoteFile(String filePath) {
+       return "";
+    }
+
+    public String getNameFromRemoteFile(String filePath) {
+       return "";
+    }
+
+    public String getVerFromRemoteFile(String filePath) {
+       return "";
+    }
 
     public String getArchFromFile(String filePath) {
         return "";
index af25740..3f739ce 100644 (file)
@@ -72,6 +72,41 @@ public class RpmCommanderRemoteHost extends RpmCommanderCommon {
     public ICommandStatus copyFilesToTmpDir(String[] fileList) {
         return null;
     }
+    
+    public String getArchFromRemoteFile(String filePath) {
+       String result = "";
+       if (!RemoteConnectionManager.connected()) {
+            return "";
+        }
+       try {
+               IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
+               boolean exists = filetool.hasFile(filePath, new NullProgressMonitor());
+               if (!exists) {
+                   return result;
+               }
+               String command = RpmTool.fileArchCommand(filePath);
+            result = HostCommandLauncher.executeOutput(command);            
+        } catch (RemoteConnectionException e) {
+            e.printStackTrace();
+            logger.error(e.getMessage(), e);
+        } catch (RemoteOperationException e) {
+            e.printStackTrace();
+            logger.error(e.getMessage(), e);
+        } catch (CancelException e) {
+            e.printStackTrace();
+            logger.error(e.getMessage(), e);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+            logger.error(e.getMessage(), e);
+        }
+
+        String[] name = result.split(",");
+        if (name.length > 0) {
+            return name[0];
+        } else {
+            return "";
+        }
+    }
 
     public String getArchFromFile(String filePath) {
         String result = "";
@@ -88,8 +123,7 @@ public class RpmCommanderRemoteHost extends RpmCommanderCommon {
             IRemoteCopyTools copytool = RemoteConnectionManager.getRemoteTools().getCopyTool();
             IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
             copytool.uploadFileToFile(filePath, remotepath);
-            String command = RpmTool.fileArchCommand(remotepath);
-            result = HostCommandLauncher.executeOutput(command);
+            result = getArchFromRemoteFile(remotepath);
             filetool.removeFile(remotepath, new NullProgressMonitor());
         } catch (RemoteConnectionException e) {
             e.printStackTrace();
@@ -100,6 +134,32 @@ public class RpmCommanderRemoteHost extends RpmCommanderCommon {
         } catch (CancelException e) {
             e.printStackTrace();
             logger.error(e.getMessage(), e);
+        }
+        return result;
+    }
+
+    public String getNameFromRemoteFile(String filePath) {
+       String result = "";
+       if (!RemoteConnectionManager.connected()) {
+            return "";
+        }
+       try {
+               IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
+               boolean exists = filetool.hasFile(filePath, new NullProgressMonitor());
+               if (!exists) {
+                   return result;
+               }
+               String command = RpmTool.fileNameCommand(filePath);
+            result = HostCommandLauncher.executeOutput(command);            
+        } catch (RemoteConnectionException e) {
+            e.printStackTrace();
+            logger.error(e.getMessage(), e);
+        } catch (RemoteOperationException e) {
+            e.printStackTrace();
+            logger.error(e.getMessage(), e);
+        } catch (CancelException e) {
+            e.printStackTrace();
+            logger.error(e.getMessage(), e);
         } catch (InterruptedException e) {
             e.printStackTrace();
             logger.error(e.getMessage(), e);
@@ -112,7 +172,6 @@ public class RpmCommanderRemoteHost extends RpmCommanderCommon {
             return "";
         }
     }
-
     public String getNameFromFile(String filePath) {
         String result = "";
         if (!new File(filePath).exists()) {
@@ -128,8 +187,7 @@ public class RpmCommanderRemoteHost extends RpmCommanderCommon {
             IRemoteCopyTools copytool = RemoteConnectionManager.getRemoteTools().getCopyTool();
             IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
             copytool.uploadFileToFile(filePath, remotepath);
-            String command = RpmTool.fileNameCommand(remotepath);
-            result = HostCommandLauncher.executeOutput(command);
+            result = getNameFromRemoteFile(remotepath);
             filetool.removeFile(remotepath, new NullProgressMonitor());
         } catch (RemoteConnectionException e) {
             e.printStackTrace();
@@ -140,10 +198,37 @@ public class RpmCommanderRemoteHost extends RpmCommanderCommon {
         } catch (CancelException e) {
             e.printStackTrace();
             logger.error(e.getMessage(), e);
+        }
+        return result;
+    }
+    
+    public String getVerFromRemoteFile(String filePath) {
+       String result = "";
+       if (!RemoteConnectionManager.connected()) {
+            return "";
+        }
+       try {
+               IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
+               boolean exists = filetool.hasFile(filePath, new NullProgressMonitor());
+               if (!exists) {
+                   return result;
+               }
+               String command = RpmTool.fileFullVerCommand(filePath);
+            result = HostCommandLauncher.executeOutput(command);            
+        } catch (RemoteConnectionException e) {
+            e.printStackTrace();
+            logger.error(e.getMessage(), e);
+        } catch (RemoteOperationException e) {
+            e.printStackTrace();
+            logger.error(e.getMessage(), e);
+        } catch (CancelException e) {
+            e.printStackTrace();
+            logger.error(e.getMessage(), e);
         } catch (InterruptedException e) {
             e.printStackTrace();
             logger.error(e.getMessage(), e);
         }
+
         String[] name = result.split(",");
         if (name.length > 0) {
             return name[0];
@@ -167,8 +252,7 @@ public class RpmCommanderRemoteHost extends RpmCommanderCommon {
             IRemoteCopyTools copytool = RemoteConnectionManager.getRemoteTools().getCopyTool();
             IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
             copytool.uploadFileToFile(filePath, remotepath);
-            String command = RpmTool.fileFullVerCommand(remotepath);
-            result = HostCommandLauncher.executeOutput(command);
+            result = getVerFromRemoteFile(remotepath);
             filetool.removeFile(remotepath, new NullProgressMonitor());
         } catch (RemoteConnectionException e) {
             e.printStackTrace();
@@ -179,16 +263,8 @@ public class RpmCommanderRemoteHost extends RpmCommanderCommon {
         } catch (CancelException e) {
             e.printStackTrace();
             logger.error(e.getMessage(), e);
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-            logger.error(e.getMessage(), e);
-        }
-        String[] name = result.split(",");
-        if (name.length > 0) {
-            return name[0];
-        } else {
-            return "";
         }
+        return result;
     }
 
     @Override
index 210e38f..5c1a7a3 100644 (file)
@@ -65,6 +65,18 @@ public class RpmModelMaker implements IPkgModelMaker {
         pkg.setVer(ver);
         return pkg;
     }
+    
+    private Package _makeRemoteModel(String filePath) {
+        Package pkg = new Package();
+        String name = target.getCommander(CmdTargetTypes.HOST, false).getNameFromRemoteFile(filePath);
+        String ver = target.getCommander(CmdTargetTypes.HOST, false).getVerFromRemoteFile(filePath);
+        String arch = target.getCommander(CmdTargetTypes.HOST, false).getArchFromRemoteFile(filePath);
+        pkg.setPath(filePath);
+        pkg.setName(name);
+        pkg.setArch(arch);
+        pkg.setVer(ver);
+        return pkg;
+    }
 
     public IPackage makeModel(String filePath) {
         Package pkg = _makeModel(filePath);
@@ -73,6 +85,14 @@ public class RpmModelMaker implements IPkgModelMaker {
         }
         return pkg;
     }
+    
+    public IPackage makeRemoteModel(String filePath) {
+        Package pkg = _makeRemoteModel(filePath);
+        if (pkg == null) {
+            return null;
+        }
+        return pkg;
+    }
 
     public IPackage makeModel(String filePath, boolean needsFilter) {
         Package pkg = _makeModel(filePath);
@@ -82,6 +102,26 @@ public class RpmModelMaker implements IPkgModelMaker {
         pkg.setNeedsFilter(needsFilter);
         return pkg;
     }
+    
+    public IPackage makeRemoteModel(String filePath, boolean needsFilter) {
+        Package pkg = _makeRemoteModel(filePath);
+        if (pkg == null) {
+            return null;
+        }
+        pkg.setNeedsFilter(needsFilter);
+        return pkg;
+    }
+    
+    public List<IPackage> makeRemoteModels(List<String> filePaths) {
+        List<IPackage> pkgs = new ArrayList<IPackage>();
+        for (String path : filePaths) {
+            IPackage pkg = makeRemoteModel(path);
+            if (pkg != null) {
+                pkgs.add(pkg);
+            }
+        }
+        return pkgs;
+    }
 
     public List<IPackage> makeModels(List<String> filePaths) {
         List<IPackage> pkgs = new ArrayList<IPackage>();
index 4fda6a6..78782de 100644 (file)
@@ -37,6 +37,7 @@ import org.eclipse.swt.widgets.Shell;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.tizen.common.rds.ui.preference.RdsPreferencePage;
+import org.tizen.common.util.OSChecker;
 import org.tizen.common.util.log.UserInteraction;
 import org.tizen.common.util.log.UserLogger;
 import org.tizen.nativecommon.launch.TizenLaunchMessages;
@@ -50,6 +51,7 @@ import org.tizen.nativeplatform.pkg.commander.factory.PkgStatusUpdaterFactory;
 import org.tizen.nativeplatform.pkg.model.IPackage;
 import org.tizen.nativeplatform.pkg.model.PkgStatus;
 import org.tizen.nativeplatform.pkgmgr.PkgMgrInitializer;
+import org.tizen.nativeplatform.rds.RemoteRpmRapidDeployer;
 import org.tizen.nativeplatform.rds.RpmRapidDeployer;
 import org.tizen.nativeplatform.rootstrap.RootstrapManager;
 import org.tizen.nativeplatform.types.CmdTargetTypes;
@@ -343,9 +345,14 @@ public class RpmPackageLauncher implements IPkgLauncher {
     }
 
     private boolean internalProcessRDS(final IPkgCommander commander, List<IPackage> packages,
-            boolean worksSmack, IProgressMonitor monitor) {
-        RpmRapidDeployer rpmRds = new RpmRapidDeployer(project, commander, packages);
-        return rpmRds.process();
+            boolean worksSmack, IProgressMonitor monitor) {    
+       if (OSChecker.isWindows()) {
+               RemoteRpmRapidDeployer rpmRds = new RemoteRpmRapidDeployer(project, commander, packages);
+               return rpmRds.process();
+       } else {
+               RpmRapidDeployer rpmRds = new RpmRapidDeployer(project, commander, packages);
+               return rpmRds.process();
+       }
     }
 
     private String newline() {
index 99e107d..92c6f31 100644 (file)
@@ -34,6 +34,7 @@ public interface IPackage {
     String getVer();
     String getArch();
     String getPath();
+    void setPath(String path);
     PkgTypes getType();
     boolean needsFilter();
     IPackage clonePkg();
index 7dfe656..be4b16c 100644 (file)
@@ -6,11 +6,18 @@ import java.util.List;
 import java.util.Map;
 
 import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
-import org.tizen.nativeplatform.command.launcher.CommandUtil;
+import org.eclipse.ptp.remotetools.core.IRemoteFileTools;
+import org.eclipse.ptp.remotetools.exception.CancelException;
+import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;
+import org.eclipse.ptp.remotetools.exception.RemoteOperationException;
+import org.tizen.common.util.OSChecker;
 import org.tizen.nativeplatform.command.launcher.HostCommandLauncher;
 import org.tizen.nativeplatform.command.launcher.ScriptProvider;
 import org.tizen.nativeplatform.pkg.model.IPackage;
+import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
+import org.tizen.nativeplatform.util.PlatformFileUtil;
 
 public class CachePackageChecksum {
     /* 
@@ -68,9 +75,11 @@ public class CachePackageChecksum {
             }
             if (strs[0].equals("key:")) {
                 key = strs[1];
+                key = key.replace("\r", "");
                 put(key, new HashMap<String, String>());
             } else {
                 String s = (strs[1].startsWith(".")) ? strs[1].substring(1) : strs[1];
+                s = s.replace("\r", "");
                 Map<String, String> value = get(key);
                 if (value == null) {
                     put(key, new HashMap<String, String>());
@@ -89,7 +98,7 @@ public class CachePackageChecksum {
             return false;
         }
         return true;
-    }
+    } 
 
     public static boolean cachePkgChecksum(IProject project, List<IPackage> pkgFiles)
             throws InterruptedException {
@@ -116,10 +125,10 @@ public class CachePackageChecksum {
         StringBuffer sbNeedCachingPkgs = new StringBuffer();
         Map<String, String> result = new HashMap<String, String>();
         for (String path : pkgPaths.split(" ")) {
-            // packages should exist.
-            if (!new File(path).exists()) {
-                return null;
-            }
+            // packages should exist.          
+               if (!PlatformFileUtil.existsFile(path)) {
+                       return null;
+               }
             String pkgName = new Path(path).lastSegment();
             // key = <package filename>_<checksum>
             //     = aul-devel-0.0.280-1.i586.rpm_1c8812299688a58503949ee804b26532
@@ -148,14 +157,19 @@ public class CachePackageChecksum {
     }
 
     public static String getCacheKey(String pkgPath) throws InterruptedException {
-        if (!new File(pkgPath).exists()) {
+       if (!PlatformFileUtil.existsFile(pkgPath)) {
             return "";
         }
-        String workingPath = new Path(pkgPath).removeLastSegments(1).toOSString();
+        String workingPath = new Path(pkgPath).removeLastSegments(1).toString();
         String pkgFile = new Path(pkgPath).lastSegment();
-        String command = String.format("md5sum %s | awk '{print $2 \"_\" $1}'", pkgFile);
+        //String command = String.format("md5sum %s | awk '{print $2 \"_\" $1}'", pkgFile);
+        String command = String.format("md5sum %s", pkgFile);
         // output should be "<package path>_<checksum>" format
-        String output = HostCommandLauncher.executeOutput(command, workingPath, false, null);
+        String output = HostCommandLauncher.executeOutput(command, workingPath, true, null);
+        String[] content = output.trim().split(" ");
+        if (content.length >= 2) {
+               output = String.format("%s_%s", content[content.length-1], content[0]);
+        }
         return output;
     }
 }
diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/rds/RemoteRpmRapidDeployer.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/rds/RemoteRpmRapidDeployer.java
new file mode 100644 (file)
index 0000000..b17eb9a
--- /dev/null
@@ -0,0 +1,356 @@
+package org.tizen.nativeplatform.rds;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.ptp.remotetools.core.IRemoteCopyTools;
+import org.eclipse.ptp.remotetools.exception.CancelException;
+import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;
+import org.eclipse.ptp.remotetools.exception.RemoteOperationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.tizen.common.util.FileUtil;
+import org.tizen.common.util.FilenameUtil;
+import org.tizen.nativeplatform.command.launcher.CommandUtil;
+import org.tizen.nativeplatform.command.launcher.LocalCommandUtil;
+import org.tizen.nativeplatform.command.launcher.RemoteCommandUtil;
+import org.tizen.nativeplatform.launch.PlatformLaunchMessages;
+import org.tizen.nativeplatform.pkg.commander.ICommandStatus;
+import org.tizen.nativeplatform.pkg.commander.IPkgCommander;
+import org.tizen.nativeplatform.pkg.model.IPackage;
+import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
+import org.tizen.nativeplatform.types.CmdTargetTypes;
+import org.tizen.nativeplatform.util.RootstrapUtil;
+
+public class RemoteRpmRapidDeployer {
+    private IProject project;
+    private IPkgCommander commander;
+    private List<IPackage> packages;
+    private CmdTargetTypes cmdType;
+    private final Logger logger = LoggerFactory.getLogger(RemoteRpmRapidDeployer.class);
+
+    public RemoteRpmRapidDeployer(IProject project, IPkgCommander commander, List<IPackage> packages) {
+        this.project = project;
+        this.commander = commander;
+        for (IPackage pkg : packages) {
+               String path = pkg.getPath();
+               String[] segments = new Path(path).segments();
+               String configNamae = segments[segments.length - 2];
+               String fileNamae = segments[segments.length - 1];
+               String remoteWorkspacePath = RootstrapUtil.getUserSyncWorkspacePath(project.getName());
+               String remotePkgPath = new Path(remoteWorkspacePath).append(configNamae).append(fileNamae).toString();
+               pkg.setPath(remotePkgPath);
+        }
+        this.packages = packages;
+        this.cmdType = commander.getCommandType();
+    }
+
+    public boolean process() {
+        StringBuffer sbPkgList = new StringBuffer();
+        for (IPackage pkg : packages) {
+            sbPkgList.append(pkg.getPath());
+            sbPkgList.append(" ");
+        }
+        String pkgList = sbPkgList.toString().trim();
+        Map<String, String> sourceChecksums = null;
+        // get cached checksum information
+        try {
+            sourceChecksums = CachePackageChecksum.getPkgChecksum(project, pkgList);
+        } catch (InterruptedException e) {
+            logger.error(PlatformLaunchMessages.FAILED_CHECK_FILE_CHECKSUM, e);
+            return false;
+        }
+        if (sourceChecksums == null || sourceChecksums.isEmpty()) {
+            return false;
+        }
+        StringBuffer sbCheckFiles = new StringBuffer();
+        for (String file : sourceChecksums.keySet()) {
+            // key = <package filename>_<checksum>/<filepath>
+            sbCheckFiles.append("\"");
+            sbCheckFiles.append(new Path(file).removeFirstSegments(1).toString());
+            sbCheckFiles.append("\" ");
+        }
+        String needCheckFiles = sbCheckFiles.toString().trim();
+        Map<String, String> targetChecksums = getTargetChecksumMap(needCheckFiles);
+        if (targetChecksums == null) {
+            return false;
+        }
+
+        List<String> copyList = new ArrayList<String>();
+        List<String> addList = new ArrayList<String>();
+        List<String> remainList = new ArrayList<String>();
+        List<String> removeList = new ArrayList<String>();
+        String copyFileList = groupFiles(sourceChecksums, targetChecksums, copyList, addList,
+                remainList, removeList);
+        if (isDeviceCommander()) {
+            // If there are added files, install packages normally.
+            if (!addList.isEmpty()) {
+                return false;
+            }
+            // If copied files are more than 20, install packages normally. It might be better.
+            if (copyList.size() > 20) {
+                return false;
+            }
+        }
+        Map<String, String[]> smackInfo = null;
+        if (isDeviceCommander()) {
+            smackInfo = getSmackInfo(copyFileList);
+            if (smackInfo == null) {
+                return false;
+            }
+        }
+       LocalCommandUtil.clearCachingDir();
+       String cachingDir = LocalCommandUtil.getCachingDir(project);
+       FileUtil.createDirectory(cachingDir);
+
+        if (!processCopiedFiles(copyList)) {
+            return false;
+        }
+        if (!processAddedFiles(addList, smackInfo)) {
+            return false;
+        }
+        if (!processRemovedFiles(removeList)) {
+            return false;
+        }
+        if (isDeviceCommander()) {
+            if (!applySmack(smackInfo)) {
+                return false;
+            }
+        }
+        return true;
+    }  
+
+    private boolean processCopiedFiles(List<String> fileList) {
+       String cachingDir = LocalCommandUtil.getCachingDir(project);
+       IRemoteCopyTools copytool = RemoteConnectionManager.getRemoteTools().getCopyTool();
+        for (final String file : fileList) {
+               String remoteFilepath = new Path(RemoteCommandUtil.getCachingDir(project)).append(file).toString();
+               String filename = FilenameUtil.getFilename(file);
+               String srcPath = new Path(cachingDir).append(filename).toOSString();
+               try {
+                               copytool.downloadFileToFile(remoteFilepath, srcPath);
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                       }
+            String targetFilePath = new Path(file).removeFirstSegments(1).toString();
+            ICommandStatus status = commander.copyFile(srcPath, targetFilePath);
+            if (status == null || !status.isOk()) {
+                logger.error(String.format("Failed to copy files [%s]", srcPath));
+                return false;
+            }
+        }
+        return true;
+    }
+
+    private boolean processAddedFiles(List<String> fileList, Map<String, String[]> smackInfo) {
+        for (String file : fileList) {
+            IPath filePath = new Path(file);
+            String targetFilePath = filePath.removeFirstSegments(1).toOSString();
+            String targetPath = filePath.removeFirstSegments(1).removeLastSegments(1).toOSString();
+            String srcFilePath = new Path(CommandUtil.getCachingDir(project)).append(file)
+                    .toOSString();
+            ICommandStatus status = commander.makeDir(targetPath);
+            if (status == null || !status.isOk()) {
+                logger.error(String.format("Failed to make directory [%s]", targetPath));
+                return false;
+            }
+            status = commander.copyFile(srcFilePath, targetFilePath);
+            if (status == null || !status.isOk()) {
+                logger.error(String.format("Failed to copy files [%s]", srcFilePath));
+                return false;
+            }
+            if (smackInfo != null && isDeviceCommander()) {
+                String[] labels = { "_", "_" };
+                smackInfo.put(targetFilePath, labels);
+            }
+        }
+        return true;
+    }
+
+    private boolean processRemovedFiles(List<String> fileList) {
+        for (String file : fileList) {
+            ICommandStatus status = commander.removeFile(file);
+            if (status == null || !status.isOk()) {
+                logger.error(String.format("Failed to remove files [%s]", file));
+                return false;
+            }
+        }
+        return true;
+    }
+
+    private boolean isDeviceCommander() {
+        return (cmdType == CmdTargetTypes.DEVICE);
+    }
+
+    // Maintain smack information of copied file same as before.
+    private boolean applySmack(Map<String, String[]> smackInfo) {
+        if (!smackInfo.isEmpty()) {
+            try {
+                // Sleep guarantee changing of smack information.
+                // "chsmack" command after pushing file is not completed.
+                Thread.sleep(100);
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+                return false;
+            }
+        }
+        for (Entry<String, String[]> entry : smackInfo.entrySet()) {
+            String file = entry.getKey();
+            String[] value = entry.getValue();
+            ICommandStatus status = commander.changeSmack(file, value[0], value[1]);
+            if (status == null || !status.isOk()) {
+                logger.error(String.format("Failed to change smack [%s]", file));
+                return false;
+            }
+        }
+        return true;
+    }
+
+    private Map<String, String[]> getSmackInfo(String fileList) {
+        Map<String, String[]> smackInfo = new HashMap<String, String[]>();
+        String[] args;
+        if (fileList.length() > CommandUtil.LIMIT_COMMAND_LENGTH) {
+            args = CommandUtil.splitCommandArgs(fileList);
+        } else {
+            args = new String[1];
+            args[0] = fileList;
+        }
+        for (String arg : args) {
+            if (arg.isEmpty()) {
+                continue;
+            }
+            ICommandStatus status = commander.getSmack(arg);
+            if (status == null || !status.isOk()) {
+                logger.error(String.format("Failed to get smack info [%s]", fileList));
+                return null;
+            }
+            List<String> result = status.getValues();
+            if (result == null) {
+                logger.error(String.format("Failed to get smack info [%s]", fileList));
+                return null;
+            }
+            for (String line : result) {
+                String targetFile = "";
+                String labels[] = { "", "" };
+                for (String info : line.split(" ")) {
+                    if (info.startsWith("access=")) {
+                        String[] a_label = info.split("=");
+                        if (a_label.length == 2) {
+                            labels[0] = a_label[1].trim();
+                        }
+                    } else if (info.startsWith("execute")) {
+                        String[] e_label = info.split("=");
+                        if (e_label.length == 2) {
+                            labels[1] = e_label[1].trim();
+                        }
+                    } else {
+                        targetFile = info;
+                    }
+                }
+                if (targetFile.isEmpty()) {
+                    logger.error(String.format("Failed to get smack info [%s]", fileList));
+                    return null;
+                } else {
+                    smackInfo.put(targetFile, labels);
+                }
+            }
+        }
+        return smackInfo;
+    }
+
+    // compare source data and target data. divide all files into four list parts.
+    private String groupFiles(Map<String, String> sourceChecksums,
+            Map<String, String> targetChecksums, List<String> copyList, List<String> addList,
+            List<String> remainList, List<String> removeList) {
+
+        StringBuffer sbCopyFiles = new StringBuffer();
+        for (Entry<String, String> entry : sourceChecksums.entrySet()) {
+            // key = aul-0.0.280-1.i586.rpm_d986faacda139c2d2d9c19c792ef07bc/etc/init.d/launchpad_run
+            String key = entry.getKey();
+            // s_value = 50155d2eaed43a6cbf2632b38dd37242
+            String s_value = entry.getValue();
+            // target_key = etc/init.d/launchpad_run
+            String target_key = new Path(key).removeFirstSegments(1).toString();
+            if (targetChecksums.containsKey(target_key)) {
+                // d_value = 50155d2eaed43a6cbf2632b38dd37242
+                String d_value = targetChecksums.get(target_key);
+                // As comparing keys, divide files into 2 parts (copy list, remain list)
+                if (!s_value.equals(d_value)) {
+                    copyList.add(key);
+                    sbCopyFiles.append("\"" + target_key + "\" ");
+                } else {
+                    remainList.add(key);
+                }
+                // if targetChecksums contains source key, remove the key from targetChecksums.
+                // it is for removing unused files on device later.
+                targetChecksums.remove(target_key);
+            } else {
+                // if targetChecksums does not contains source key, it should be copied.
+                if (!key.equals("-")) {
+                    addList.add(key);
+                }
+            }
+        }
+        // if targetChecksums has keys, it should be removed.
+        for (String key : targetChecksums.keySet()) {
+            removeList.add(key);
+        }
+        return sbCopyFiles.toString().trim();
+    }
+
+    // get checksum information for files in target
+    private Map<String, String> getTargetChecksumMap(String fileList) {
+        Map<String, String> checksumMap = new HashMap<String, String>();
+        // if command is too long, split it.
+        String[] args;
+        if (fileList.length() > CommandUtil.LIMIT_COMMAND_LENGTH) {
+            args = CommandUtil.splitCommandArgs(fileList);
+        } else {
+            args = new String[1];
+            args[0] = fileList;
+        }
+        for (String arg : args) {
+            if (arg.isEmpty()) {
+                continue;
+            }
+            ICommandStatus status = commander.getMd5Checksum(arg);
+            if (status == null) {
+                return null;
+            }
+            List<String> values = status.getValues();
+            if (values == null) {
+                logger.error(String.format("%s: src:%s",
+                        PlatformLaunchMessages.FAILED_CHECK_FILE_CHECKSUM, arg));
+                return null;
+            }
+            Map<String, String> data = getChecksumMap(values);
+            if (data.isEmpty()) {
+                logger.error(String.format("%s: checksum is empty. src:%s",
+                        PlatformLaunchMessages.FAILED_CHECK_FILE_CHECKSUM, arg));
+                return null;
+            } else {
+                checksumMap.putAll(data);
+            }
+        }
+        return checksumMap;
+    }
+
+    private Map<String, String> getChecksumMap(List<String> sources) {
+        Map<String, String> result = new HashMap<String, String>();
+        for (String value : sources) {
+            String[] v = value.split("  ");
+            if (v.length != 2) {
+                continue;
+            }
+            String key = (v[1].startsWith(".")) ? v[1].substring(1) : v[1];
+            result.put(key, v[0]);
+        }
+        return result;
+    }
+}
index 534015e..55662ee 100644 (file)
@@ -11,12 +11,14 @@ import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.tizen.nativecommon.build.SmartBuildInterface;
 import org.tizen.nativeplatform.command.launcher.CommandUtil;
 import org.tizen.nativeplatform.launch.PlatformLaunchMessages;
 import org.tizen.nativeplatform.pkg.commander.ICommandStatus;
 import org.tizen.nativeplatform.pkg.commander.IPkgCommander;
 import org.tizen.nativeplatform.pkg.model.IPackage;
 import org.tizen.nativeplatform.types.CmdTargetTypes;
+import org.tizen.nativeplatform.util.RootstrapUtil;
 
 public class RpmRapidDeployer {
     private IProject project;
index b292cc2..1f7c58a 100644 (file)
@@ -14,12 +14,12 @@ import org.tizen.nativeplatform.command.launcher.LocalCommandUtil;
 public class RsyncProcessor {\r
     String host = "";\r
     String user = "";\r
-    String sshKeyPath = "";\r
+    String sshPrivateKey = "";\r
 \r
-    public RsyncProcessor(String host, String user, String sshKeyPath) {\r
+    public RsyncProcessor(String host, String user, String sshPrivateKey) {\r
         this.host = host;\r
         this.user = user;\r
-        this.sshKeyPath = sshKeyPath;\r
+        this.sshPrivateKey = sshPrivateKey;\r
     }\r
     \r
     public boolean downloadSync(String remotePath, String localPath, IProgressMonitor monitor) throws InterruptedException {\r
@@ -40,7 +40,7 @@ public class RsyncProcessor {
         cmd.append(" -c \"");\r
         cmd.append("rsync -avz --delete -e");\r
         cmd.append("'ssh -i ");\r
-        cmd.append(sshKeyPath);\r
+        cmd.append(sshPrivateKey);\r
         cmd.append(" -o StrictHostKeyChecking=no");\r
         cmd.append("' ");\r
         cmd.append(user);\r
@@ -68,8 +68,10 @@ public class RsyncProcessor {
             }\r
         }\r
         String excludeCmd = "";\r
-        for (String exclude : excludes) {\r
-            excludeCmd += String.format("--exclude=%s ", exclude);\r
+        if (excludes != null) {\r
+               for (String exclude : excludes) {\r
+                   excludeCmd += String.format("--exclude=%s ", exclude);\r
+               }\r
         }\r
         \r
         String msysBinPath = sbi.getMsysBinPath();\r
@@ -79,7 +81,7 @@ public class RsyncProcessor {
         cmd.append(" -c \"");\r
         cmd.append("rsync -avz --delete -e ");\r
         cmd.append("'ssh -i ");\r
-        cmd.append(sshKeyPath);\r
+        cmd.append(sshPrivateKey);\r
         cmd.append(" -o StrictHostKeyChecking=no");\r
         cmd.append("' ");\r
         if (!excludeCmd.isEmpty()) {\r
index 3c44821..9078ae3 100644 (file)
@@ -64,7 +64,7 @@ public class BaseFileSystemGenerator {
             latestTempRootstrap = new PlatformRootstrap(id, id, arch, tempDirPath, null, "", false);
 
             // use rogen
-            String rogen = RootstrapUtil.getRogenPath();
+            String rogen = RootstrapUtil.getRogenBinPath();
             String baseArch = RootstrapUtil.getBaseArchitecture(arch);
             String urlData = "";
             for (String url : reposURLs) {
@@ -128,7 +128,7 @@ public class BaseFileSystemGenerator {
             latestTempRootstrap = new PlatformRootstrap(id, id, arch, tempDirPath, null, "", false);
 
             // use rogen
-            String rogen = RootstrapUtil.getRemoteRogenPath();
+            String rogen = RootstrapUtil.getRemoteRogenBinPath();
             String baseArch = RootstrapUtil.getBaseArchitecture(arch);
             String urlData = "";
             for (String url : reposURLs) {
index 3889e7e..bd77d7a 100644 (file)
@@ -39,16 +39,28 @@ import org.eclipse.core.resources.IncrementalProjectBuilder;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
+import org.eclipse.ptp.remotetools.core.IRemoteFileTools;
+import org.eclipse.ptp.remotetools.core.IRemoteItem;
+import org.eclipse.ptp.remotetools.exception.CancelException;
+import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;
+import org.eclipse.ptp.remotetools.exception.RemoteOperationException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.tizen.common.util.ArrayUtil;
+import org.tizen.common.util.FilenameUtil;
+import org.tizen.common.util.OSChecker;
 import org.tizen.nativeplatform.filefilter.RpmFileFilter;
 import org.tizen.nativeplatform.launch.PlatformLaunchMessages;
 import org.tizen.nativeplatform.pkg.commander.IPkgModelMaker;
+import org.tizen.nativeplatform.pkg.commander.PkgCommandTarget;
 import org.tizen.nativeplatform.pkg.commander.factory.PkgModelMakerFactory;
 import org.tizen.nativeplatform.pkg.model.IPackage;
+import org.tizen.nativeplatform.pkg.model.Package;
 import org.tizen.nativeplatform.rds.CachePackageChecksum;
+import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
+import org.tizen.nativeplatform.types.CmdTargetTypes;
 import org.tizen.nativeplatform.types.PkgTypes;
 
 public class PackageUtil {
@@ -86,8 +98,8 @@ public class PackageUtil {
         }
         return true;
     }
-
-    public void cachePkgChecksum(IProject project, IConfiguration config) {
+    
+    public void cacheLocalpkgChecksum(IProject project, IConfiguration config) {
         try {
             if(!CachePackageChecksum.cachePkgChecksum(project, getPackages(project, config))) {
                 logger.error(PlatformLaunchMessages.FAILED_CACHE_PACKAGE_CHECKSUM);
@@ -97,6 +109,50 @@ public class PackageUtil {
             e.printStackTrace();
         }
     }
+    
+    public void cacheRemotepkgChecksum(IProject project, IConfiguration config) {
+        try {
+            if(!CachePackageChecksum.cachePkgChecksum(project, getRemotePackages(project, config))) {
+                logger.error(PlatformLaunchMessages.FAILED_CACHE_PACKAGE_CHECKSUM);
+            }
+        } catch (InterruptedException e) {
+            logger.error(PlatformLaunchMessages.FAILED_CACHE_PACKAGE_CHECKSUM);
+            e.printStackTrace();
+        }
+    }
+
+    public void cachePkgChecksum(IProject project, IConfiguration config) {
+       if (OSChecker.isWindows()) {
+               cacheRemotepkgChecksum(project, config);
+       } else {
+               cacheLocalpkgChecksum(project, config);
+       }
+    }    
+    
+    public List<IPackage> getRemotePackages(IProject project, IConfiguration config) {
+       List<String> pkgs = new ArrayList<String>();
+       String targetPath = RootstrapUtil.getUserSyncWorkspacePath(project.getName());
+       String configPath = new Path(targetPath).append(config.getName()).toString();
+       IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
+       try {
+                       IRemoteItem[] items = filetool.listItems(configPath, new NullProgressMonitor());
+                       for (IRemoteItem item : items) {
+                               String path = item.getPath();
+                               String filename = FilenameUtil.getFilename(path);
+                               String ext = FilenameUtil.getExtension(filename);
+                               if (ext.equals("rpm")) {
+                                       pkgs.add(path);
+                               }
+                       }
+               } catch (RemoteConnectionException e) {
+                       e.printStackTrace();
+               } catch (RemoteOperationException e) {
+                       e.printStackTrace();
+               } catch (CancelException e) {
+                       e.printStackTrace();
+               }
+       return modelMaker.makeRemoteModels(pkgs);
+    }
 
     public List<IPackage> getPackages(IProject project, IConfiguration config) {
         List<String> pkgs = new ArrayList<String>();
index 3ac0fba..c90a227 100644 (file)
@@ -30,7 +30,10 @@ package org.tizen.nativeplatform.util;
 import java.io.File;
 import java.io.FilenameFilter;
 
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
+import org.eclipse.ptp.remotetools.core.IRemoteFileTools;
+import org.tizen.common.util.OSChecker;
 import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
 
 public class PlatformFileUtil {
@@ -72,4 +75,19 @@ public class PlatformFileUtil {
             return name.endsWith(ext);
         }
     }
+    
+    public static boolean existsFile(String path) {
+       boolean exists = false;
+       if (OSChecker.isWindows()) {
+               IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
+               try {
+                               exists = filetool.hasFile(path, new NullProgressMonitor());
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                       }
+       } else {
+            exists = !new File(path).exists();
+       }
+       return exists;
+    }
 }
index 9dd9fc1..24aeac2 100644 (file)
@@ -208,34 +208,15 @@ public class PlatformLaunchUtil {
             TizenLaunchCommand command, IPath srcPath) throws CoreException, TimeoutException,
             SdbCommandRejectedException, IOException, Exception {
         String gdbserverPath = srcPath.toString();
-        File gdbserver = new File(gdbserverPath);
-        if (OSChecker.isWindows()) {
-            
-            IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
-            boolean exists = filetool.hasFile(gdbserverPath, new NullProgressMonitor());
-            if (!exists) {
-                IPkgCommander commander = cmdTarget.getCommander(CmdTargetTypes.ROOTSTRAP);
-                commander.installRemotePkg("gdb-server", null);
-            }
-            exists = filetool.hasFile(gdbserverPath, new NullProgressMonitor());
-            if (!exists) {
-                LaunchUtils.newCoreException(
-                        NLS.bind(TizenLaunchMessages.GDBSERVER_NOT_INSTALLED, device.getDeviceName()),
-                        null);
-            }
-        } else {
-            if (!gdbserver.exists()) {
-                IPkgCommander commander = cmdTarget.getCommander(CmdTargetTypes.ROOTSTRAP);
-                commander.installRemotePkg("gdb-server", null);
-            }
-
-            if (!gdbserver.exists()) {
-                LaunchUtils.newCoreException(
-                        NLS.bind(TizenLaunchMessages.GDBSERVER_NOT_INSTALLED, device.getDeviceName()),
-                        null);
-            }
+        if (!PlatformFileUtil.existsFile(gdbserverPath)) {
+               IPkgCommander commander = cmdTarget.getCommander(CmdTargetTypes.ROOTSTRAP);
+            commander.installRemotePkg("gdb-server", null);
+        }
+        if (!PlatformFileUtil.existsFile(gdbserverPath)) {
+            LaunchUtils.newCoreException(
+                    NLS.bind(TizenLaunchMessages.GDBSERVER_NOT_INSTALLED, device.getDeviceName()),
+                    null);
         }
-
         if (!checkGdbServerInDevice(device, command)) {
             copyFileToDevice(cmdTarget.getRootstrap(), device, gdbserverPath,
                     TizenPlatformConstants.GDBSERVER_PLATFORM_CMD);
index 77af6a2..5f1878c 100644 (file)
@@ -49,7 +49,7 @@ public class RootstrapUtil {
     private static final String REMOTE_TIZEN_SDK_DIR_NAME = "tizen-sdk-remote-data";
     private static final String REMOTE_CONNECTION_DIR = "connection";
     private static final String REMOTE_CONNECTION_FILE = "info";
-    private static final String REMOTE_SOURCE_DIR_NAME = "source";
+    private static final String REMOTE_TOOLS_DIR_NAME = "tools";
     private static final String REMOTE_WORKSPACE_DIR = "workspace";
     private static final String REMOTE_ROOSTRAP_PLUGINS_DIR_NAME = "user-rootstrap-plugins";
 
@@ -69,11 +69,12 @@ public class RootstrapUtil {
         String userhome = RemoteConnectionManager.getRemoteTools().getUserhome();
         return new Path(userhome).append(REMOTE_TIZEN_SDK_DIR_NAME).toString();
     }
-    /*
-    public static String getRemoteSourcePath() {
-        return new Path(getRemoteRootstrapBasePath()).append(REMOTE_SOURCE_DIR_NAME).toString();
+    
+    public static String getRemoteToolsPath() {
+       return new Path(getRemoteRootstrapBasePath()).append(REMOTE_TOOLS_DIR_NAME)
+                .toString();
     }
-    */
+
     public static String getRemoteRootstrapPluginPath() {
         return new Path(getRemoteRootstrapBasePath()).append(REMOTE_ROOSTRAP_PLUGINS_DIR_NAME)
                 .toString();
@@ -180,15 +181,21 @@ public class RootstrapUtil {
     public static String getRemotePluginXML(String id) {
         return new Path(getRemoteRootstrapPluginPath()).append(id + ".xml").toString();
     }
-
-    public static String getRogenPath() {
-        return new Path(InstallPathConfig.getSDKPath()).append("tools").append("rogen")
-                .append("bin").append("rogen.rb").toString();
+    
+    public static IPath getRogenPath() {
+        return new Path(InstallPathConfig.getSDKPath()).append("tools").append("rogen");
     }
 
-    public static String getRemoteRogenPath() {
+    public static IPath getRemoteRogenPath() {
         String userhome = RemoteConnectionManager.getRemoteTools().getUserhome();
-        return new Path(userhome).append(REMOTE_TIZEN_SDK_DIR_NAME).append("tools").append("rogen")
-                .append("bin").append("rogen.rb").toString();
+        return new Path(userhome).append(REMOTE_TIZEN_SDK_DIR_NAME).append("tools").append("rogen");
+    }
+
+    public static String getRogenBinPath() {
+        return getRogenPath().append("bin").append("rogen.rb").toString();
+    }
+
+    public static String getRemoteRogenBinPath() {
+        return getRemoteRogenPath().append("bin").append("rogen.rb").toString();
     }
 }
index f8886a6..a80d8e1 100644 (file)
@@ -75,7 +75,6 @@ public class RemoteConnectionDialog extends Dialog {
     private Text hostText;
     private Text userText;
     private Text passText;
-    private Text sudoText;
     private Text sshPrivateText;
     private Text sshPublicText;
 
@@ -83,6 +82,8 @@ public class RemoteConnectionDialog extends Dialog {
     private int y = 0;
     private int width = 400;
     private int height = 250;
+    
+    private boolean connected = false;
 
     private final String BUNDLE_NAME = RemoteConnectionDialog.class.getPackage().getName()
             + ".RootstrapUIMessages";//$NON-NLS-1$
@@ -229,7 +230,8 @@ public class RemoteConnectionDialog extends Dialog {
             IRemoteExecutionTools exectool = RemoteConnectionManager.getRemoteTools().getExecTool();
             IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
             String userhome = RemoteConnectionManager.getRemoteTools().getUserhome();
-            String remoteAuthfile = new Path(userhome).append(".ssh").append("authorized_keys").toString();
+            IPath remoteSshPath = new Path(userhome).append(".ssh");
+            String remoteAuthfile = remoteSshPath.append("authorized_keys").toString();
             boolean needSet = true;
             if (filetool.hasFile(remoteAuthfile, new NullProgressMonitor())) {
                 String cmd = String.format("grep -rn \"%s\" %s", pubkey, remoteAuthfile);
@@ -239,6 +241,7 @@ public class RemoteConnectionDialog extends Dialog {
                 }
             }
             if (needSet) {
+               filetool.assureDirectory(remoteSshPath.toString(), new NullProgressMonitor());
                 String cmd = String.format("echo \"%s\" >> %s", pubkey, remoteAuthfile);
                 exectool.executeBashCommand(cmd);
             }
@@ -257,6 +260,10 @@ public class RemoteConnectionDialog extends Dialog {
         }
     }
 
+    public boolean connected() {
+       return connected;
+    }
+
     @Override
     protected void okPressed() {
         final String host = hostText.getText();
@@ -282,10 +289,10 @@ public class RemoteConnectionDialog extends Dialog {
                      monitor.beginTask(resources.getString("RemoteConnDlg.Progress.Creating"), 1);
                      try {
                          UserLogger.start(PlatformUserInteraction.CONNECT_SSH);
-                         boolean result = RemoteConnectionManager.createConnection(host, user, pass, publicKey, privateKey, 
+                         connected = RemoteConnectionManager.createConnection(host, user, pass, publicKey, privateKey, 
                                  new SubProgressMonitor(monitor, 1));
                          UserLogger.end(PlatformUserInteraction.CONNECT_SSH);
-                         if (!result) {
+                         if (!connected) {
                              DialogUtil.openMessageDialog(getShell(), "Failed to connect");
                          } else {
                              registerAuthorizedKey(publicKey);
index a80e698..9e4049d 100644 (file)
@@ -50,6 +50,7 @@ import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
@@ -359,7 +360,7 @@ public class RemoteRepoTab implements IRepositoryTab {
         Table table = reposURLViewer.getTable();
         table.setHeaderVisible(true);
         table.setLinesVisible(true);
-
+               int width = computeDefaultColumnWidth();
         reposURLViewer.setLabelProvider(new RepoTableViewerProvider());
         reposURLViewer.setContentProvider(new ArrayContentProvider());
 
@@ -371,16 +372,71 @@ public class RemoteRepoTab implements IRepositoryTab {
         column = new TableColumn(table, SWT.NONE);
         column.setResizable(true);
         column.setText(resources.getString("GenRootDlg.Tree.Column.URL"));
-        column.setWidth(300);
+        column.setWidth(width-50);
 
         GridData tableGridData = new GridData(GridData.FILL_HORIZONTAL
                 | GridData.VERTICAL_ALIGN_BEGINNING);
         tableGridData.heightHint = 200;
         table.setLayoutData(tableGridData);
-
         reposURLViewer.setInput(new ArrayList<ICheckTreeItem>());
     }
 
+       /**
+        * Return the default width of the column; this should be the width of the client area.
+        * The table won't tell us the real width of the client area; this is an approximate calculation.
+        * This accounts for the size of the data and the visibility of the scrollbar.
+        * @return
+        */
+       private int computeDefaultColumnWidth()
+       {
+               // Many of the padding are on both sides, have to double them to get the full size
+               Table table = reposURLViewer.getTable();
+               GridLayout parentLayout = (GridLayout)table.getParent().getLayout();
+               
+               // determine the padding from the parent composite
+               int windowHorizontalPadding = (2 * parentLayout.horizontalSpacing)
+                       + (2 * parentLayout.marginWidth);
+               // determine the extra space the table displays that isn't the column
+               int tablePadding = 2 * table.getBorderWidth();
+               // If the scrollbar is displayed, need to account for its size.
+               if (isScrollBarVisible())
+               {
+                       tablePadding += table.getVerticalBar().getSize().x;
+               }
+               // finish computing the width.
+               int totalPadding = tablePadding + windowHorizontalPadding;
+               int defaultWidth = table.getShell().getClientArea().width - totalPadding;
+               
+               return defaultWidth;
+       }
+       /**
+        * Return true if the scroll bar is visible.
+        * The scrollbar won't tell us if it is visible, so this is an approximate calculation.
+        * This will tell us if it is likely that the scrollbar is visible.
+        * @return true if the scroll bar is visible
+        */
+       private boolean isScrollBarVisible()
+       {
+               // Many of the padding are on both sides, have to double them to get the full size
+               Table table = reposURLViewer.getTable();
+               GridLayout parentLayout = (GridLayout)table.getParent().getLayout();
+               
+               // need to figure out if the scroll bar will be displayed...
+               // determine how high the data rows are
+               int rowsHeight = table.getItemCount() * (table.getItemHeight() + table.getGridLineWidth());
+               // figure out the extra composite padding
+               int windowVerticalPadding = (2 * parentLayout.verticalSpacing)
+                       + (2 * parentLayout.marginHeight);
+               // Manually determined vertical size of the remaining window's stuff (Button, etc).
+               int rowPadding = 29;
+               // mix it all up to figure out how tall the table would be with all the data displayed
+               int rowsComputedHeight = rowsHeight + windowVerticalPadding + rowPadding;
+               int availableHeight = table.getShell().getClientArea().height;
+               boolean isScrollVisible = (rowsComputedHeight> availableHeight);
+               
+               return isScrollVisible;
+       }
+       
     @Override
     public String getArchitecture() {
         return architecture;
index bc15ae1..bdfa3a8 100644 (file)
@@ -231,7 +231,7 @@ public class RootstrapGenDialog extends Dialog {
     }
 
     private void createTabs(Composite parent) {
-        tabFolder = new TabFolder(parent, SWT.BORDER);
+        tabFolder = new TabFolder(parent, SWT.NONE);
         GridData data = new GridData(GridData.FILL_BOTH);
         data.heightHint = 400;
 
index 6085d0d..b1fd772 100644 (file)
@@ -28,7 +28,6 @@
 package org.tizen.nativeplatform.views.ui;
 
 import java.io.BufferedReader;
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -50,11 +49,7 @@ import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IContributionItem;
 import org.eclipse.jface.action.IMenuListener;
@@ -71,6 +66,11 @@ import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.ptp.remotetools.core.IRemoteCopyTools;
+import org.eclipse.ptp.remotetools.core.IRemoteFileTools;
+import org.eclipse.ptp.remotetools.exception.CancelException;
+import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;
+import org.eclipse.ptp.remotetools.exception.RemoteOperationException;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -102,7 +102,6 @@ import org.slf4j.LoggerFactory;
 import org.tizen.common.TizenHelpContextIds;
 import org.tizen.common.connection.ConnectionPlugin;
 import org.tizen.common.util.DialogUtil;
-import org.tizen.common.util.FileUtil;
 import org.tizen.common.util.ImageUtil;
 import org.tizen.common.util.OSChecker;
 import org.tizen.common.util.SWTUtil;
@@ -619,20 +618,24 @@ public class RootstrapView extends ViewPart {
 
     private void showConnectDialog() {
         RemoteConnectionDialog dlg = new RemoteConnectionDialog(shell);
-        if (dlg.open() == Dialog.OK) {
+        if (dlg.open() == Dialog.OK) {         
+               if (!RemoteConnectionManager.connected()) {
+                       return;
+               }
             ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
             try {
                 dialog.run(true, true, new IRunnableWithProgress() {
                     @Override
                     public void run(IProgressMonitor monitor) throws InvocationTargetException,
                             InterruptedException {
-                        monitor.beginTask("Synchronizing...", 3);
+                        monitor.beginTask("Synchronizing...", 4);
                         try {
                             monitor.subTask("Synchronizing rootstraps...");
                             RootstrapManager.reinitialize(new SubProgressMonitor(monitor, 1));
                             monitor.subTask("Clear platform temp directory");
                             CommandUtil.clearPlatformTempDir();
                             monitor.worked(1);
+                            initBuildserver(new SubProgressMonitor(monitor, 1));
                             SWTUtil.syncExec(new Runnable() {
                                 public void run() {
                                     updateToolbarEnable();
@@ -653,6 +656,36 @@ public class RootstrapView extends ViewPart {
         }
     }
     
+    private void initBuildserver(IProgressMonitor monitor) {
+       monitor.beginTask("Setting build server...", 3);
+       IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
+       String basedir = RootstrapUtil.getRemoteToolsPath();
+       try {
+                       filetool.assureDirectory(basedir, new SubProgressMonitor(monitor, 1));
+                       IPath remoteRogenPath = RootstrapUtil.getRemoteRogenPath();
+                       boolean exists = filetool.hasDirectory(remoteRogenPath.toString(), new SubProgressMonitor(monitor, 1));
+                       if (!exists) {
+                       String host = RemoteConnectionManager.getRemoteTools().getHost();
+                       String user = RemoteConnectionManager.getRemoteTools().getUser();
+                       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));
+                       }
+               } catch (RemoteOperationException e) {
+                       e.printStackTrace();
+               } catch (RemoteConnectionException e) {
+                       e.printStackTrace();
+               } catch (CancelException e) {
+                       e.printStackTrace();
+               } catch (InterruptedException e) {
+                       e.printStackTrace();
+               } finally {
+                       monitor.done();
+               }
+       
+    }
+    
     private void syncIncludes() {
         doActionForEntry(new IActionForEntry() {
             @Override