From: Sangyoon Jang Date: Thu, 23 Apr 2020 11:30:18 +0000 (+0900) Subject: Remove preload-rw pkgs after install X-Git-Tag: submit/tizen/20200601.023448~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F90%2F231690%2F5;p=platform%2Fcore%2Fappfw%2Fpkgmgr-tool.git Remove preload-rw pkgs after install These packages were backuped already. Change-Id: Ibca7ca4ab358788759c90c28e9a24eee10866e97 Signed-off-by: Sangyoon Jang --- diff --git a/src/install_preload_pkg.c b/src/install_preload_pkg.c index e53ab34..48576cc 100644 --- a/src/install_preload_pkg.c +++ b/src/install_preload_pkg.c @@ -144,20 +144,7 @@ static int _install_preload_pkg(const char *backend, const char *directory, waitpid(pid, &status, 0); } - /* remove a file after installation, - * keep rw packages for factory-reset - */ - if (readonly) { - ret = remove(file_path); - if (ret < 0) { - _E("Failed to remove [%s]: [%s]", - file_path, strerror_r(errno, err_buf, - sizeof(err_buf))); - closedir(dir); - g_list_free_full(preload_rw_pkg_list, free); - return -1; - } - } else { + if (!readonly) { // make the preload-rw list pkg_info = pkgmgr_client_check_pkginfo_from_file(file_path); if (pkg_info == NULL) { @@ -170,6 +157,17 @@ static int _install_preload_pkg(const char *backend, const char *directory, pkgmgr_client_free_pkginfo(pkg_info); pkg_info = NULL; } + + /* remove a file after installation */ + ret = remove(file_path); + if (ret < 0) { + _E("Failed to remove [%s]: [%s]", file_path, + strerror_r(errno, err_buf, + sizeof(err_buf))); + closedir(dir); + g_list_free_full(preload_rw_pkg_list, free); + return -1; + } } closedir(dir);