MISC: Transfer SSH private key to device when device is connected. 45/20345/1
authordonghyuk.yang <donghyuk.yang@samsung.com>
Sat, 3 May 2014 06:08:25 +0000 (15:08 +0900)
committerdonghyuk.yang <donghyuk.yang@samsung.com>
Sat, 3 May 2014 06:08:25 +0000 (15:08 +0900)
Host ssh private key should transfer to device for getting rpm packages
files from remote build server. IDE transfers the key when device is
connected.

Change-Id: I3363d76bf5256d9f71f52558b851520df41a1c9c
Signed-off-by: donghyuk.yang <donghyuk.yang@samsung.com>
org.tizen.nativeplatform/src/org/tizen/nativeplatform/command/launcher/DeviceChangeListener.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/pkg/commander/rpm/RpmCommanderDevice.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/views/ui/RootstrapView.java

index d26ac8b..e742229 100644 (file)
@@ -1,16 +1,14 @@
 package org.tizen.nativeplatform.command.launcher;
 
-import java.io.IOException;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.tizen.common.util.OSChecker;
 import org.tizen.nativeplatform.pkg.commander.PkgCommandTarget;
-import org.tizen.nativeplatform.pkg.commander.rpm.RpmCommanderCommon;
+import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
 import org.tizen.nativeplatform.util.PlatformProjectUtil;
+import org.tizen.nativeplatform.util.SSHUtil;
 import org.tizen.sdblib.IDevice;
 import org.tizen.sdblib.IDeviceChangeListener;
-import org.tizen.sdblib.exception.SdbCommandRejectedException;
-import org.tizen.sdblib.exception.TimeoutException;
 import org.tizen.sdblib.util.DeviceUtil;
 
 public class DeviceChangeListener implements IDeviceChangeListener {
@@ -31,6 +29,9 @@ public class DeviceChangeListener implements IDeviceChangeListener {
         }
         
         target.getDeviceCommander().actionBeforeUsingZypper();
+        if (OSChecker.isWindows() && RemoteConnectionManager.connected()) {
+            SSHUtil.transferSshKey(target);
+        }
     }
 
     @Override
index eef963a..4f3086c 100644 (file)
@@ -333,12 +333,18 @@ public class RpmCommanderDevice extends RpmCommanderCommon {
             sbCommand.append(String.format(" -a %s", a_label));
         } else {
             String log = String.format(
-                    "[RDS] Do not need to change smack (access permission is empty): %s", path);
+                    "[RDS] access permission is empty: %s", path);
             printResultLog(log);
+            //sbCommand.append(String.format(" -a \"\"", a_label));
             return new CommandStatus(ICommandStatus.OK, "", log, null);
         }
         if (!e_label.isEmpty()) {
             sbCommand.append(String.format(" -e %s", e_label));
+        } else {
+            String log = String.format(
+                    "[RDS] execute permission is empty: %s", path);
+            printResultLog(log);
+            sbCommand.append(String.format(" -e \"\"", a_label));
         }
         sbCommand.append(String.format(" %s", path));
         // 2. check the changing
index d980322..e15a7f0 100644 (file)
@@ -545,13 +545,13 @@ public class RootstrapView extends ViewPart {
     private void activateContext() {
         IContextService contextService = (IContextService) getSite().getService(
                 IContextService.class);
-        contextService.activateContext("org.tizen.common.rootstrap.setdefault.context");
-        contextService.activateContext("org.tizen.common.rootstrap.lauchpkgmgr.context");
-        contextService.activateContext("org.tizen.common.rootstrap.remove.context");
+        contextService.activateContext("org.tizen.nativeplatform.rootstrap.setdefault.context");
+        contextService.activateContext("org.tizen.nativeplatform.rootstrap.lauchpkgmgr.context");
+        contextService.activateContext("org.tizen.nativeplatform.rootstrap.remove.context");
         if (!OSChecker.isWindows()) {
-            contextService.activateContext("org.tizen.common.rootstrap.export.context");
+            contextService.activateContext("org.tizen.nativeplatform.rootstrap.export.context");
         }
-        contextService.activateContext("org.tizen.common.rootstrap.change.conffile.context");
+        contextService.activateContext("org.tizen.nativeplatform.rootstrap.change.conffile.context");
         if (OSChecker.isWindows()) {
             contextService.activateContext("org.tizen.nativeplatform.rootstrap.sync.includes");
         }