ecs: separate package file path by platform version
authorMunkyu Im <munkyu.im@samsung.com>
Mon, 2 Jan 2017 07:55:16 +0000 (16:55 +0900)
committerMunkyu Im <munkyu.im@samsung.com>
Mon, 2 Jan 2017 09:44:17 +0000 (18:44 +0900)
The old path does not work on tizen 3.0.
So, change the path to push package file.

For tizen 2.XX: /opt/usr/apps/tmp/sdk_tools/
For the others(including tizen 3.XX): /tmp/.emulator/apps/

Change-Id: Ide6d328ff024c286c1820a13c3720f8f1362a2b7
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
tizen/src/ecs/ecs_msg_injector.c

index 0c5c3d5..f85b1c3 100644 (file)
@@ -313,18 +313,28 @@ static bool push_package(const char *data)
     const char *addon_path = "\\emulator-images\\add-ons\\";
 #endif
     const char *bin_dir = get_bin_path();
+    const char *dst_dir;
+    if (g_str_has_prefix(get_platform_version(), "tizen-2.")) {
+        dst_dir = "/opt/usr/apps/tmp/sdk_tools/";
+    } else {
+        /*
+         * Also, if get_platform_version() is empty,
+         * set as the following path.
+         */
+        dst_dir = "/tmp/.emulator/apps/";
+    }
 
     memset(cmd, 0, sizeof(cmd));
 
     char *addon = strtok((char *)data, token);
 #ifndef CONFIG_WIN32
-    ret = sprintf(cmd, "\"%s%s\" -s emulator-%d push \"%s%s%s%s%s\" /tmp/.emulator/apps/%s 2>&1",
+        ret = sprintf(cmd, "\"%s%s\" -s emulator-%d push \"%s%s%s%s%s\" %s%s 2>&1",
 #else
-    ret = sprintf(cmd, "cmd /S /C \"\"%s%s\" -s emulator-%d push \"%s%s%s%s%s\" /tmp/.emulator/apps/%s 2>&1\"",
+        ret = sprintf(cmd, "cmd /S /C \"\"%s%s\" -s emulator-%d push \"%s%s%s%s%s\" %s%s 2>&1\"",
 #endif
             bin_dir, sdb_path, get_vm_device_serial_number(),
             bin_dir, platform_path, get_profile_name(), addon_path, addon,
-            addon);
+            dst_dir, addon);
     if (ret < 0) {
         LOG_SEVERE("SDB push command is wrong: %s\n", cmd);
         return false;