Fix pkg_upgrade 38/188738/1
authorJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 10 Sep 2018 02:59:25 +0000 (11:59 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 10 Sep 2018 02:59:25 +0000 (11:59 +0900)
- Add codes to support rpm pkg type.

Change-Id: Idca0d935c63e8a5591fb464f982eebab008409e5
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/pkg_upgrade.c

index 76fadf5..4ab5d77 100644 (file)
@@ -420,6 +420,8 @@ static void __send_args_to_backend(char *pkgid, const char *pkgtype,
        starttime = tv.tv_sec * 1000l + tv.tv_usec / 1000l;
        char buf[BUF_SIZE];
        char backend_cmd[BUF_SIZE];
+       const char *new_pkgtype;
+       const char tpk_pkgtype[] = "tpk";
 
        const char *install_ro[] = { backend_cmd, "-y", pkgid,
                                "--preload", "--partial-rw", NULL };
@@ -437,8 +439,13 @@ static void __send_args_to_backend(char *pkgid, const char *pkgtype,
        if (__compare_builtin_removable_pkgid(pkgid) < 0)
                return;
 
+       if (!strcmp(pkgtype, "rpm"))
+               new_pkgtype = tpk_pkgtype;
+       else
+               new_pkgtype = pkgtype;
+
        snprintf(backend_cmd, sizeof(backend_cmd), "/usr/bin/%s-backend",
-                       pkgtype);
+                       new_pkgtype);
 
        switch (operation) {
        case PKG_NEED_INSTALL: