summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkh5325.kim <kh5325.kim@samsung.com>2013-06-24 19:16:56 +0900
committerkh5325.kim <kh5325.kim@samsung.com>2013-06-24 19:16:56 +0900
commit2df5dc18e79ab0ca48e10a7554251ae044e5b26e (patch)
tree581391c4a345191c9875d43cc2e2686d22797eda
parent5979c8bbc0ff5ca363358088d14a905ba1193fb6 (diff)
downloadsdb-2df5dc18e79ab0ca48e10a7554251ae044e5b26e.tar.gz
sdb-2df5dc18e79ab0ca48e10a7554251ae044e5b26e.tar.bz2
sdb-2df5dc18e79ab0ca48e10a7554251ae044e5b26e.zip
Upload tizen_2.2 source
Change-Id: I0efd811f0463e926faccca2e74b75311df0735a9
-rw-r--r--package/changelog12
-rw-r--r--package/pkginfo.manifest2
-rw-r--r--src/command_function.c20
-rw-r--r--src/file_sync_client.c9
-rwxr-xr-xsrc/sdb.h2
-rw-r--r--src/sdb_client.c75
-rw-r--r--src/sdb_client.h10
7 files changed, 123 insertions, 7 deletions
diff --git a/package/changelog b/package/changelog
index 6b8d344..8070460 100644
--- a/package/changelog
+++ b/package/changelog
@@ -1,3 +1,15 @@
+* 2.2.5
+- modify debug launchpad applied sdbd version
+== ho.namkoong <ho.namkoong@samsung.com> 2013-06-24
+* 2.2.4
+- change sdb version in help page
+== ho.namkoong <ho.namkoong@samsung.com> 2013-06-23
+* 2.2.3
+- remove printf in lauchapp
+== ho.namkoong <ho.namkoong@samsung.com> 2013-06-23
+* 2.2.2
+- apply debug launch pad
+== ho.namkoong <ho.namkoong@samsung.com> 2013-06-23
* 2.2.1
- fixed crash on Windows
== yoonki.park <yoonki.park@samsung.com> 2013-06-21
diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest
index 9bfdc18..b58c753 100644
--- a/package/pkginfo.manifest
+++ b/package/pkginfo.manifest
@@ -1,4 +1,4 @@
-Version:2.2.1
+Version:2.2.5
Source:sdb
Maintainer:Kangho Kim <kh5325.kim@samsung.com>, Yoonki Park<yoonki.park@samsung.com>, Hyunsik Noh<hyunsik.noh@samsung.com>, Gun Kim<gune.kim@samsung.com>, Ho Namkoong<ho.namkoong@samsung.com>, Taeyoung Son<taeyoung2.son@samsung.com>
diff --git a/src/command_function.c b/src/command_function.c
index 50a7bad..518dcbe 100644
--- a/src/command_function.c
+++ b/src/command_function.c
@@ -90,9 +90,21 @@ int launch(int argc, char ** argv, void** extargv) {
char flag = 0;
if (argc < 7 || argc > 15 ) {
- fprintf(stderr,"usage: sdb launch -p <pkgid> -e <executable> -m <run|debug> [-P <port>] [-attach <pid>] [-t <gtest,gcov>] [<args...>]\n");
+ fprintf(stderr,"usage: sdb launch -p <pkgid> -e <executable> -m <run|debug|da|oprofile> [-P <port>] [-attach <pid>] [-t <gtest,gcov>] [<args...>]\n");
return -1;
}
+
+ if(SDB_HIGHER_THAN_2_2_3(extargv)) {
+ int full_len = PATH_MAX - 1;
+ strncat(fullcommand, WHITE_SPACE, full_len);
+ strncat(fullcommand, SDB_LAUNCH_SCRIPT, full_len);
+ for(i = 1; i < argc; i ++) {
+ strncat(fullcommand, WHITE_SPACE, full_len);
+ strncat(fullcommand, argv[i], full_len);
+ }
+
+ return __sdb_command(fullcommand, extargv);
+ }
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-p")) {
flag = 'p';
@@ -134,7 +146,11 @@ int launch(int argc, char ** argv, void** extargv) {
mode = 0;
} else if (!strcmp(argv[i], "debug")) {
mode = 1;
- } else {
+ } else if (!strcmp(argv[i], "da") || !strcmp(argv[i], "oprofile")) {
+ fprintf(stderr,"The -m option for da and oprofile is supported in sdbd higher than 2.2.0\n");
+ return -1;
+ }
+ else {
fprintf(stderr,"The -m option accepts arguments only run or debug options\n");
return -1;
}
diff --git a/src/file_sync_client.c b/src/file_sync_client.c
index b5c3e54..0850832 100644
--- a/src/file_sync_client.c
+++ b/src/file_sync_client.c
@@ -257,8 +257,13 @@ int do_sync_copy(char* srcp, char* dstp, FILE_FUNC* srcF, FILE_FUNC* dstF, int i
}
}
- fprintf(stderr,"%d file(s) pushed. %d file(s) skipped.\n",
- pushed, skiped);
+ char command[6] = {'p', 'u', 's', 'h', 'e', 'd'};
+ if(srcF == &REMOTE_FILE_FUNC) {
+ strncpy(command, "pulled", sizeof command);
+ }
+
+ fprintf(stderr,"%d file(s) %s. %d file(s) skipped.\n",
+ pushed, command, skiped);
long long end_time = NOW() - start_time;
diff --git a/src/sdb.h b/src/sdb.h
index b45134a..98b5063 100755
--- a/src/sdb.h
+++ b/src/sdb.h
@@ -36,7 +36,7 @@
#define SDB_VERSION_MAJOR 2 // Used for help/version information
#define SDB_VERSION_MINOR 2 // Used for help/version information
-#define SDB_SERVER_VERSION 0 // Increment this when we want to force users to start a new sdb server
+#define SDB_SERVER_VERSION 4 // Increment this when we want to force users to start a new sdb server
typedef struct amessage amessage;
typedef struct apacket apacket;
diff --git a/src/sdb_client.c b/src/sdb_client.c
index dd26d29..ab54aee 100644
--- a/src/sdb_client.c
+++ b/src/sdb_client.c
@@ -34,7 +34,7 @@ static int send_service_with_length(int fd, const char* service);
static int sdb_status(int fd);
static int send_service_with_length(int fd, const char* service) {
- char tmp[5];
+
int len;
len = strlen(service);
@@ -89,6 +89,79 @@ static int switch_socket_transport(int fd, void** extra_args)
return 0;
}
+int sdb_higher_ver(int first, int middle, int last, void* extargv) {
+
+ const char* VERSION_QUERY = "shell:rpm -q sdbd";
+ D("query the sdbd version\n");
+ int fd = sdb_connect(VERSION_QUERY, extargv);
+
+ if(fd < 0) {
+ D("fail to query the sdbd version\n");
+ return fd;
+ }
+
+ char ver[PATH_MAX];
+ int len;
+
+ D("read sdb version\n");
+ while(fd >= 0) {
+ len = sdb_read(fd, ver, PATH_MAX);
+ if(len == 0) {
+ break;
+ }
+
+ if(len < 0) {
+ if(errno == EINTR) continue;
+ break;
+ }
+ fflush(stdout);
+ }
+
+ int version;
+ char* ver_num = NULL;
+
+ ver_num = strchr(ver, '-') + 1;
+
+ char* null = NULL;
+ null = strchr(ver_num, '-');
+
+ if(null == NULL) {
+ fprintf(stderr, "error: cannot parse sdbd version\n");
+ return -1;
+ }
+ *null = '\0';
+
+ D("sdbd version: %s\n", ver_num);
+
+ null = strchr(ver_num, '.');
+ *null = '\0';
+ version = atoi(ver_num);
+ if(version > first) {
+ return 1;
+ }
+ if(version < first) {
+ return 0;
+ }
+ ver_num = ++null;
+
+ null = strchr(ver_num, '.');
+ version = atoi(ver_num);
+ *null = '\0';
+ if(version > middle) {
+ return 1;
+ }
+ if(version < middle) {
+ return 0;
+ }
+ ver_num = ++null;
+
+ version = atoi(ver_num);
+ if(version > last) {
+ return 1;
+ }
+ return 0;
+}
+
static int sdb_status(int fd)
{
unsigned char buf[5];
diff --git a/src/sdb_client.h b/src/sdb_client.h
index f20b672..7f8706c 100644
--- a/src/sdb_client.h
+++ b/src/sdb_client.h
@@ -20,6 +20,9 @@
#include "sdb.h"
#include "sdb_constants.h"
+// debug launch pad is applied after sdbd 2.2.3
+#define SDB_HIGHER_THAN_2_2_3(extargv) sdb_higher_ver(2, 2, 3, extargv)
+
/* connect to sdb, connect to the named service, and return
** a valid fd for interacting with that service upon success
** or a negative number on failure
@@ -42,6 +45,13 @@ char *sdb_query(const char *service, void** ext_args);
/* return verbose error string from last operation */
const char *sdb_error(void);
+/**
+ * check sdbd version in the target.
+ * returns true, if target version is higher then {first}.{middle}.{last}.
+ * else, returns false.
+ */
+int sdb_higher_ver(int first, int middle, int last, void* extargv);
+
/* read a standard sdb status response (OKAY|FAIL) and
** return 0 in the event of OKAY, -1 in the event of FAIL
** or protocol error