From 04320cea431a195814c6bfe88ac76011283c78c1 Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Thu, 28 Mar 2019 19:40:19 +0900 Subject: [PATCH 01/16] Replace exec into /bin/sh in upgrade script - exec replaces shell itself so sciprts will terminate when command terminates executed by exec. Change-Id: Ic6e650237bad77a835afa0bb240b9229ae7d842c Signed-off-by: Junghyun Yeon --- data/updates/update.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/updates/update.sh.in b/data/updates/update.sh.in index 81cd697..7b91abf 100644 --- a/data/updates/update.sh.in +++ b/data/updates/update.sh.in @@ -22,7 +22,7 @@ echo "Pkgmgr database current version: $DB_VERSION_OLD, target version: $DB_VERS #if old version is less than 1, upgrade to 30000, default version of tizen_3.0 if [ $DB_VERSION_OLD -le $DB_VERSION_TIZEN24 ]; then echo "Updating $PARSER_DB_PATH to $DB_VERSION_TIZEN30_DEFAULT" - exec "$UPDATE_SCRIPT_LOCATION/$UPDATE_SCRIPT_PREFIX$DB_VERSION_TIZEN30_DEFAULT.sh" + /bin/sh "$UPDATE_SCRIPT_LOCATION/$UPDATE_SCRIPT_PREFIX$DB_VERSION_TIZEN30_DEFAULT.sh" DB_VERSION_OLD=30000 fi @@ -31,5 +31,5 @@ do echo "Updating $PARSER_DB_PATH to $i (target version is $DB_VERSION_NEW)" UPDATE_SCRIPT="$UPDATE_SCRIPT_LOCATION/$UPDATE_SCRIPT_PREFIX$i.sh" [ ! -e "$UPDATE_SCRIPT" ] && echo "Can't find script $UPDATE_SCRIPT" && exit 1 - exec $UPDATE_SCRIPT + /bin/sh $UPDATE_SCRIPT done -- 2.7.4 From f808d16b78b3cdfc581c1914b4de730b700c60d7 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Wed, 10 Apr 2019 15:29:09 +0900 Subject: [PATCH 02/16] Adjust 30004 upgrade script The component info table is removed. Change-Id: I82a411df1cdd09864034a9676f1f4bc30feae870 Signed-off-by: Hwankyu Jhun --- data/updates/upgrade_to_30004.sh.in | 9 --------- 1 file changed, 9 deletions(-) diff --git a/data/updates/upgrade_to_30004.sh.in b/data/updates/upgrade_to_30004.sh.in index a66c406..d1214e2 100644 --- a/data/updates/upgrade_to_30004.sh.in +++ b/data/updates/upgrade_to_30004.sh.in @@ -24,15 +24,6 @@ function migrate_parser_db() { " plugin_type TEXT NOT NULL,\n" \ " plugin_name TEXT NOT NULL);" | sqlite3 $dbpath - echo -e "CREATE TABLE IF NOT EXISTS package_app_component_info (\n" \ - " app_id TEXT NOT NULL,\n" \ - " component_id TEXT NOT NULL,\n" \ - " type TEXT NOT NULL,\n" \ - " launch_mode TEXT NOT NULL,\n" \ - " PRIMARY KEY(app_id, component_id)\n" \ - " FOREIGN KEY(app_id)\n" \ - " REFERENCES package_app_info(app_id) ON DELETE CASCADE);" | sqlite3 $dbpath - echo "PRAGMA user_version=30004;" | sqlite3 $dbpath } -- 2.7.4 From 4bd02343954f497298b3b4dbce9d9a87650dd97e Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Tue, 16 Apr 2019 17:56:55 +0900 Subject: [PATCH 03/16] Release version 0.5.1 Changes: - Change log for install_preload_pkg - Replace exec into /bin/sh in upgrade script - Adjust 30004 upgrade script Change-Id: I3205a272f7f81de7a5298ff6be1e7dbe0e9c544e Signed-off-by: Junghyun Yeon --- packaging/pkgmgr-tool.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/pkgmgr-tool.spec b/packaging/pkgmgr-tool.spec index f675f7b..124b171 100644 --- a/packaging/pkgmgr-tool.spec +++ b/packaging/pkgmgr-tool.spec @@ -1,6 +1,6 @@ Name: pkgmgr-tool Summary: Packager Manager Tool package -Version: 0.5.0 +Version: 0.5.1 Release: 1 Group: Application Framework/Package Management License: Apache-2.0 -- 2.7.4 From ef9a2de519583b2056fe875fca7997f822a211af Mon Sep 17 00:00:00 2001 From: Ilho Kim Date: Thu, 18 Apr 2019 17:19:24 +0900 Subject: [PATCH 04/16] Add redefining PATH env Add in this files - pkgmgr.patch.sh.in - update.sh.in Change-Id: Ibce3a0e9f34d8c9558ee2a24ee7ac01220be8a41 Signed-off-by: Ilho Kim --- data/700.pkgmgr.patch.sh.in | 1 + data/updates/update.sh.in | 1 + 2 files changed, 2 insertions(+) diff --git a/data/700.pkgmgr.patch.sh.in b/data/700.pkgmgr.patch.sh.in index 0db3edb..ee0ee9f 100644 --- a/data/700.pkgmgr.patch.sh.in +++ b/data/700.pkgmgr.patch.sh.in @@ -1,4 +1,5 @@ #!/bin/sh +PATH="/usr/bin:/bin:/usr/sbin:/sbin" source /etc/tizen-platform.conf diff --git a/data/updates/update.sh.in b/data/updates/update.sh.in index 7b91abf..91849b7 100644 --- a/data/updates/update.sh.in +++ b/data/updates/update.sh.in @@ -1,4 +1,5 @@ #!/bin/sh +PATH="/usr/bin:/bin:/usr/sbin:/sbin" source /etc/tizen-platform.conf -- 2.7.4 From 8f228081936c599efd0234211c6e461e12584fcb Mon Sep 17 00:00:00 2001 From: Junghoon Park Date: Fri, 19 Apr 2019 11:29:00 +0900 Subject: [PATCH 05/16] Release version 0.5.2 Changes: - Add redefining PATH env Change-Id: I96fc67634510fb2602a9ccc077cacf2825ee3511 Signed-off-by: Junghoon Park --- packaging/pkgmgr-tool.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/pkgmgr-tool.spec b/packaging/pkgmgr-tool.spec index 124b171..f51bfc1 100644 --- a/packaging/pkgmgr-tool.spec +++ b/packaging/pkgmgr-tool.spec @@ -1,6 +1,6 @@ Name: pkgmgr-tool Summary: Packager Manager Tool package -Version: 0.5.1 +Version: 0.5.2 Release: 1 Group: Application Framework/Package Management License: Apache-2.0 -- 2.7.4 From f2268b9e4993ee8b9688858bc0c744b2056a7322 Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Wed, 5 Jun 2019 20:37:54 +0900 Subject: [PATCH 06/16] Add upgrade script for version 30005 Related changes: [pkgmgr-info] : https://review.tizen.org/gerrit/c/platform/core/appfw/pkgmgr-info/+/207513/ Change-Id: Ib36223113944f895b5eafc0455ba0a897378162a Signed-off-by: Junghyun Yeon --- CMakeLists.txt | 2 ++ data/updates/upgrade_to_30005.sh.in | 35 +++++++++++++++++++++++++++++++++++ packaging/pkgmgr-tool.spec | 1 + 3 files changed, 38 insertions(+) create mode 100644 data/updates/upgrade_to_30005.sh.in diff --git a/CMakeLists.txt b/CMakeLists.txt index f688adc..a9ab2a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,3 +92,5 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/data/updates/upgrade_to_30003.sh.in u INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/upgrade_to_30003.sh DESTINATION /etc/package-manager/updates/) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/data/updates/upgrade_to_30004.sh.in upgrade_to_30004.sh $ONLY) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/upgrade_to_30004.sh DESTINATION /etc/package-manager/updates/) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/data/updates/upgrade_to_30005.sh.in upgrade_to_30005.sh $ONLY) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/upgrade_to_30005.sh DESTINATION /etc/package-manager/updates/) diff --git a/data/updates/upgrade_to_30005.sh.in b/data/updates/upgrade_to_30005.sh.in new file mode 100644 index 0000000..9814028 --- /dev/null +++ b/data/updates/upgrade_to_30005.sh.in @@ -0,0 +1,35 @@ +#!/bin/sh +PATH=/bin:/usr/bin:/sbin:/usr/sbin + +source /etc/tizen-platform.conf + +PARSER_DB_NAME=.pkgmgr_parser.db +CERT_DB_NAME=.pkgmgr_cert.db +PARSER_DB_PATH=$TZ_SYS_DB/$PARSER_DB_NAME +CERT_DB_PATH=$TZ_SYS_DB/$CERT_DB_NAME + +function migrate_db() { + local dbpath=$1 + echo -e "PRAGMA journal_mode=WAL;" | sqlite3 $dbpath + echo "PRAGMA user_version=30005;" | sqlite3 $dbpath + + touch "$dbpath-shm" + chown app_fw:app_fw "$dbpath-shm" + chsmack -a User::Home "$dbpath-shm" + touch "$dbpath-wal" + chown app_fw:app_fw "$dbpath-wal" + chsmack -a User::Home "$dbpath-wal" +} + +function migrate_user_db() { + #get each user db path and call migrate_parser_db for each of it + + find $TZ_SYS_DB/user -name $PARSER_DB_NAME | while read DBPATH + do + migrate_db $DBPATH + done +} + +migrate_db $PARSER_DB_PATH +migrate_user_db +migrate_db $CERT_DB_PATH \ No newline at end of file diff --git a/packaging/pkgmgr-tool.spec b/packaging/pkgmgr-tool.spec index f51bfc1..d0e7c5d 100644 --- a/packaging/pkgmgr-tool.spec +++ b/packaging/pkgmgr-tool.spec @@ -76,6 +76,7 @@ update-mime-database %{_datadir}/mime %attr(0700,root,root) /etc/package-manager/updates/upgrade_to_30002.sh %attr(0700,root,root) /etc/package-manager/updates/upgrade_to_30003.sh %attr(0700,root,root) /etc/package-manager/updates/upgrade_to_30004.sh +%attr(0700,root,root) /etc/package-manager/updates/upgrade_to_30005.sh %attr(0700,root,root) /usr/share/upgrade/scripts/701.app2sd.patch.sh %attr(0700,root,root) %{_sysconfdir}/opt/upgrade/pkgmgr.patch.sh %attr(0700,root,root) /usr/share/fixed_multiuser/scripts/pkgmgr-clear-skel.sh -- 2.7.4 From f8babfddf1d991465d6b9acbac17f46f34179f6f Mon Sep 17 00:00:00 2001 From: Ilho Kim Date: Thu, 23 May 2019 21:20:14 +0900 Subject: [PATCH 07/16] Handle preload-rw package deleted by user when OTA Create a file to store preload-rw-packages that has been installed, this file is used to identify whether the preload-rw-package currently installing is a new package or a deleted package by user Change-Id: If9436067b39db7e808b762fbb0db9624a07d751e Signed-off-by: Ilho Kim --- src/install_preload_pkg.c | 53 ++++++++++++ src/pkg_upgrade.c | 208 +++++++++++++++++++++++++++++++++++++++------- 2 files changed, 230 insertions(+), 31 deletions(-) diff --git a/src/install_preload_pkg.c b/src/install_preload_pkg.c index 51752ff..2218344 100644 --- a/src/install_preload_pkg.c +++ b/src/install_preload_pkg.c @@ -28,9 +28,13 @@ #include #include #include +#include #include +#include "package-manager.h" +#include "package-manager-types.h" + #define OWNER_ROOT 0 #define GLOBAL_USER tzplatform_getuid(TZ_SYS_GLOBALAPP_USER) #define BUFSZE 4096 @@ -53,6 +57,37 @@ #define WGT_DIR tzplatform_mkpath(TZ_SYS_RO_APP, ".preload-wgt") #define TPK_RW_DIR tzplatform_mkpath(TZ_SYS_RO_APP, ".preload-rw-tpk") #define WGT_RW_DIR tzplatform_mkpath(TZ_SYS_RO_APP, ".preload-rw-wgt") +#define ALL_PRELOAD_RW_PKG_LIST "/opt/usr/share/.all_preload_rw_list" + +static void __make_preload_rw_list(GList *pkg_list) +{ + FILE *file; + char pkg_info[BUFSZE]; + + if (pkg_list == NULL) + return; + + file = fopen(ALL_PRELOAD_RW_PKG_LIST, "a"); + if (file == NULL) { + _E("can not open [%s]: %s\n", ALL_PRELOAD_RW_PKG_LIST, + strerror(errno)); + return; + } + + for (; pkg_list != NULL; pkg_list = pkg_list->next) { + char *pkgid = pkg_list->data; + if (pkgid == NULL) { + _E("pkgid is null\n"); + continue; + } + + _D("Add [%s] to preload-rw list", pkgid); + snprintf(pkg_info, BUFSZE, "package=\"%s\":\n", pkgid); + fwrite(pkg_info, 1, strlen(pkg_info), file); + } + + fclose(file); +} static int _install_preload_pkg(const char *backend, const char *directory, bool readonly, bool skip_check_reference) @@ -62,6 +97,9 @@ static int _install_preload_pkg(const char *backend, const char *directory, int ret; char file_path[BUFSZE]; char err_buf[BUFSZE]; + GList *preload_rw_pkg_list = NULL; + package_manager_pkg_detail_info_t *pkg_info; + char *pkgid; dir = opendir(directory); if (!dir) { @@ -114,13 +152,28 @@ static int _install_preload_pkg(const char *backend, const char *directory, file_path, strerror_r(errno, err_buf, sizeof(err_buf))); closedir(dir); + g_list_free_full(preload_rw_pkg_list, free); return -1; } + } else { + // make the preload-rw list + pkg_info = pkgmgr_client_check_pkginfo_from_file(file_path); + if (pkg_info == NULL) { + _E("can not get pkg_info from [%s]\n", file_path); + continue; + } + + pkgid = strdup(pkg_info->pkgid); + preload_rw_pkg_list = g_list_append(preload_rw_pkg_list, pkgid); + pkgmgr_client_free_pkginfo(pkg_info); + pkg_info = NULL; } } closedir(dir); + __make_preload_rw_list(preload_rw_pkg_list); + g_list_free_full(preload_rw_pkg_list, free); return 0; } diff --git a/src/pkg_upgrade.c b/src/pkg_upgrade.c index e5d0782..4ecacee 100644 --- a/src/pkg_upgrade.c +++ b/src/pkg_upgrade.c @@ -56,6 +56,7 @@ ".preload_rw_pkg_list") #define DBPATH tzplatform_mkpath(TZ_SYS_DB, "/.pkgmgr_parser.db") #define OPT_ZIP_FILE "/usr/system/RestoreDir/opt.zip" +#define ALL_PRELOAD_RW_PKG_LIST "/opt/usr/share/.all_preload_rw_list" static char *unzip_path[BUF_SIZE] = { "opt/usr/globalapps", @@ -135,6 +136,47 @@ int remove_directory(const char *path) return ret; } +static void __iter_cb(gpointer key, gpointer value, gpointer user_data) +{ + + FILE *file; + char *pkgid; + char pkg_info[BUF_SIZE]; + + if (user_data == NULL || key == NULL) + return; + + file = user_data; + pkgid = key; + snprintf(pkg_info, BUF_SIZE, "package=\"%s\":\n", pkgid); + fwrite(pkg_info, 1, strlen(pkg_info), file); +} + +static void __make_preload_rw_list(GHashTable *preload_rw_table) +{ + if (preload_rw_table == NULL) { + _LOG("preload_rw_table is null\n"); + return; + } + FILE *file = NULL; + + char tmp_path[BUF_SIZE]; + snprintf(tmp_path, BUF_SIZE, "%s.tmp", ALL_PRELOAD_RW_PKG_LIST); + + rename(ALL_PRELOAD_RW_PKG_LIST, tmp_path); + + file = fopen(ALL_PRELOAD_RW_PKG_LIST, "w"); + if (file == NULL) { + _LOG("can not open [%s]: %s\n", + ALL_PRELOAD_RW_PKG_LIST, strerror(errno)); + return; + } + g_hash_table_foreach(preload_rw_table, __iter_cb, file); + fsync(fileno(file)); + fclose(file); + remove(tmp_path); +} + static int __is_dir(const char *dirname) { struct stat stFileInfo; @@ -404,6 +446,14 @@ static int __compare_pkgid(char *file_path, char *fota_pkgid, return ret; } +static bool __check_deleted_pkg(GHashTable *preload_rw_table, + const char *fota_pkgid) +{ + if (g_hash_table_contains(preload_rw_table, fota_pkgid)) + return true; + return false; +} + char *__manifest_to_package(const char *manifest) { char *package; @@ -814,7 +864,15 @@ static int __unzip_files(char *dest_path) return ret; } -static int __install_preload_rw(const char *pkgid, const char *pkgtype) +static int __insert_preload_rw_table(GHashTable *preload_rw_table, + const char *pkgid) +{ + g_hash_table_insert(preload_rw_table, strdup(pkgid), NULL); + return 0; +} + +static int __install_preload_rw(const char *pkgid, const char *pkgtype, + GHashTable *preload_rw_table) { if (pkgid == NULL || pkgtype == NULL) return -1; @@ -854,11 +912,15 @@ static int __install_preload_rw(const char *pkgid, const char *pkgtype) } } + ret = __insert_preload_rw_table(preload_rw_table, pkgid); + retvm_if(ret < 0, -1, "__insert_preload_rw_table fail\n"); + __send_args_to_backend(pkgid, pkgtype, PKG_NEED_PRELOADRW_INSTALL); return ret; } -static void __convert_preload_to_rw(const char *pkgid, const char *pkgtype) +static void __convert_preload_to_rw(const char *pkgid, const char *pkgtype, + GHashTable *preload_rw_table) { if (pkgid == NULL || pkgtype == NULL) return; @@ -873,7 +935,7 @@ static void __convert_preload_to_rw(const char *pkgid, const char *pkgtype) if (ret != 0) _LOG("Failed to remove directory[%s]\n", buf); - ret = __install_preload_rw(pkgid, pkgtype); + ret = __install_preload_rw(pkgid, pkgtype, preload_rw_table); if (ret != 0) { _LOG("Failed install preload rw pkg[%s]\n", pkgid); return; @@ -881,7 +943,7 @@ static void __convert_preload_to_rw(const char *pkgid, const char *pkgtype) } static int __find_deleted_pkgid_from_list(const char *source_file, - const char *target_file) + const char *target_file, GHashTable *preload_rw_table) { retvm_if(source_file == NULL, -1, "source_file is NULL.\n"); retvm_if(target_file == NULL, -1, "target_file is NULL.\n"); @@ -933,7 +995,9 @@ static int __find_deleted_pkgid_from_list(const char *source_file, if (!strncmp(update, "false", strlen("false"))) { if (is_preload_rw_pkg) { - __convert_preload_to_rw(pkgid, pkgtype); + __convert_preload_to_rw(pkgid, + pkgtype, + preload_rw_table); modified_pkg_cnt++; } else { __send_args_to_backend(pkgid, pkgtype, @@ -947,7 +1011,9 @@ static int __find_deleted_pkgid_from_list(const char *source_file, if (is_preload_rw_pkg) { __send_args_to_backend(pkgid, pkgtype, PKG_NEED_RWUNINSTALL); - __install_preload_rw(pkgid, pkgtype); + __install_preload_rw(pkgid, + pkgtype, + preload_rw_table); } } } @@ -996,7 +1062,7 @@ static int __get_pkgid_list_from_db_and_xml() return 0; } -static int __process_ro_fota() +static int __process_ro_fota(GHashTable *preload_rw_table) { int ret; long starttime; @@ -1010,7 +1076,7 @@ static int __process_ro_fota() /* find deleted pkgid */ ret = __find_deleted_pkgid_from_list(PKGID_LIST_FROM_DB_FILE, - PKGID_LIST_FROM_XML_FILE); + PKGID_LIST_FROM_XML_FILE, preload_rw_table); err_if(ret < 0, "__find_deleted_pkgid_from_list fail.\n"); /* find updated, inserted pkgid */ @@ -1030,7 +1096,7 @@ static int __process_ro_fota() return 0; } -static int __process_rw_fota() +static int __process_rw_fota(GHashTable *preload_rw_table) { FILE *fp = NULL; char buf[BUF_SIZE] = {0}; @@ -1046,6 +1112,7 @@ static int __process_rw_fota() long starttime; long endtime; struct timeval tv; + bool is_deleted_pkg; _LOG("=======================================================\n"); _LOG("RW preload package fota\n"); @@ -1077,6 +1144,7 @@ static int __process_rw_fota() if (ret != PMINFO_R_OK) { _LOG("can not compare pkg version[%s]\n", pkgid); pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + handle = NULL; FREE_AND_NULL(pkgid); FREE_AND_NULL(list_version); continue; @@ -1086,6 +1154,7 @@ static int __process_rw_fota() /* package version is not update on FOTA. */ _LOG("pkg is not updated\n"); pkgmgrinfo_pkginfo_destroy_pkginfo(handle); + handle = NULL; gettimeofday(&tv, NULL); endtime = tv.tv_sec * 1000l + @@ -1093,6 +1162,14 @@ static int __process_rw_fota() total_time += (int)(endtime - starttime); _LOG("finish request [time : %d ms]\n", (int)(endtime - starttime)); + ret = __insert_preload_rw_table(preload_rw_table, pkgid); + if (ret < 0) { + _LOG("__insert_preload_rw_table fail\n"); + free(pkgid); + free(list_version); + fclose(fp); + return -1; + } FREE_AND_NULL(pkgid); FREE_AND_NULL(list_version); continue; @@ -1100,12 +1177,20 @@ static int __process_rw_fota() _LOG("pkg is updated, need to upgrade\n"); } else { + is_deleted_pkg = __check_deleted_pkg(preload_rw_table, pkgid); + if (is_deleted_pkg) { + _LOG("pkgid[%s] is deleted pkg\n", pkgid); + FREE_AND_NULL(pkgid); + continue; + } _LOG("pkgid[%s] is new\n", pkgid); } pkgtype = __getvalue(buf, TOKEN_TYPE_STR, 1); - __install_preload_rw(pkgid, pkgtype); - free(pkgtype); + __install_preload_rw(pkgid, pkgtype, preload_rw_table); + + FREE_AND_NULL(pkgid); + FREE_AND_NULL(pkgtype); if (handle) pkgmgrinfo_pkginfo_destroy_pkginfo(handle); @@ -1116,15 +1201,54 @@ static int __process_rw_fota() _LOG("finish request [time : %d ms]\n", (int)(endtime - starttime)); } + fclose(fp); - if (fp != NULL) - fclose(fp); + return 0; +} + +static int __check_tmp_all_preload_rw_pkg_list() +{ + char tmp_path[BUF_SIZE]; + snprintf(tmp_path, BUF_SIZE, "%s.tmp", ALL_PRELOAD_RW_PKG_LIST); + if (access(tmp_path, F_OK) == 0) { + if (rename(tmp_path, ALL_PRELOAD_RW_PKG_LIST)) { + _LOG("rename tmp all preload rw pkg list fail : %s\n", + strerror(errno)); + return -1; + } + } + return 0; +} + +static int __fill_preload_rw_table(GHashTable *preload_rw_table) +{ + FILE *fp; + char buf[BUF_SIZE]; + char *pkgid; + + fp = fopen(ALL_PRELOAD_RW_PKG_LIST, "r"); + retvm_if(fp == NULL, -1, "Fail get : %s\n", ALL_PRELOAD_RW_PKG_LIST); + + while (fgets(buf, BUF_SIZE, fp) != NULL) { + __str_trim(buf); + + pkgid = __getvalue(buf, TOKEN_PKGID_STR, 1); + if (pkgid == NULL) { + _LOG("pkgid is null\n"); + continue; + } + + __insert_preload_rw_table(preload_rw_table, pkgid); + FREE_AND_NULL(pkgid); + } + fclose(fp); return 0; } int main(int argc, char *argv[]) { + GHashTable *preload_rw_table; int ret = 0; /* check pkgmgr-fota dir, if it is not, then exit */ @@ -1141,26 +1265,48 @@ int main(int argc, char *argv[]) //__get_pkginfo_from_opt(); - if (argc == 1) { - ret = __process_ro_fota(); - retvm_if(ret < 0, EXIT_FAILURE, - "__process_ro_fota is failed.\n"); - ret = __process_rw_fota(); - retvm_if(ret < 0, EXIT_FAILURE, - "__process_rw_fota is failed.\n"); - return EXIT_SUCCESS; - } + ret = __check_tmp_all_preload_rw_pkg_list(); + retvm_if(ret < 0, -1, + "__check_tmp_all_preload_rw_pkg_list is failed.\n"); + + preload_rw_table = g_hash_table_new_full( + g_str_hash, g_str_equal, free, NULL); + ret = __fill_preload_rw_table(preload_rw_table); + retvm_if(ret < 0, -1, "__fill_preload_rw_table is failed.\n"); - if (strcmp(argv[1], "-rof") == 0) { - ret = __process_ro_fota(); - retvm_if(ret < 0, EXIT_FAILURE, - "__process_ro_fota is failed.\n"); - } else if (strcmp(argv[1], "-rwf") == 0) { - ret = __process_rw_fota(); - retvm_if(ret < 0, EXIT_FAILURE, - "__process_rw_fota is failed.\n"); + if (argc == 1) { + ret = __process_ro_fota(preload_rw_table); + if (ret < 0) { + g_hash_table_destroy(preload_rw_table); + _LOGE("__process_ro_fota is failed.\n"); + return EXIT_FAILURE; + } + ret = __process_rw_fota(preload_rw_table); + if (ret < 0) { + g_hash_table_destroy(preload_rw_table); + _LOGE("__process_ro_fota is failed.\n"); + return EXIT_FAILURE; + } } else { - fprintf(stderr, "not supported operand\n"); + if (strcmp(argv[1], "-rof") == 0) { + ret = __process_ro_fota(preload_rw_table); + if (ret < 0) { + g_hash_table_destroy(preload_rw_table); + _LOGE("__process_ro_fota is failed.\n"); + return EXIT_FAILURE; + } + } else if (strcmp(argv[1], "-rwf") == 0) { + ret = __process_rw_fota(preload_rw_table); + if (ret < 0) { + g_hash_table_destroy(preload_rw_table); + _LOGE("__process_ro_fota is failed.\n"); + return EXIT_FAILURE; + } + } else { + fprintf(stderr, "not supported operand\n"); + } } + __make_preload_rw_list(preload_rw_table); + g_hash_table_destroy(preload_rw_table); return EXIT_SUCCESS; } -- 2.7.4 From f2d40fa257d2bc31c765a7c35d657317feb74c0d Mon Sep 17 00:00:00 2001 From: Ilho Kim Date: Fri, 12 Jul 2019 15:46:24 +0900 Subject: [PATCH 08/16] Release version 0.5.3 Changes: - Add upgrade script for version 30005 - Handle preload-rw package deleted by user when OTA Change-Id: I334c72992de747623ea60cd31e4af09709fe9b0e Signed-off-by: Ilho Kim --- packaging/pkgmgr-tool.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/pkgmgr-tool.spec b/packaging/pkgmgr-tool.spec index d0e7c5d..af614e7 100644 --- a/packaging/pkgmgr-tool.spec +++ b/packaging/pkgmgr-tool.spec @@ -1,6 +1,6 @@ Name: pkgmgr-tool Summary: Packager Manager Tool package -Version: 0.5.2 +Version: 0.5.3 Release: 1 Group: Application Framework/Package Management License: Apache-2.0 -- 2.7.4 From 151b6060541fa472e4fb9d22c0746867e5651750 Mon Sep 17 00:00:00 2001 From: ilho kim Date: Mon, 22 Jul 2019 05:44:36 +0000 Subject: [PATCH 09/16] Revert "Add upgrade script for version 30005" This reverts commit f2268b9e4993ee8b9688858bc0c744b2056a7322. Change-Id: Id494bb8ffb1b081fda29da1426515de1e1b1df12 --- CMakeLists.txt | 2 -- data/updates/upgrade_to_30005.sh.in | 35 ----------------------------------- packaging/pkgmgr-tool.spec | 1 - 3 files changed, 38 deletions(-) delete mode 100644 data/updates/upgrade_to_30005.sh.in diff --git a/CMakeLists.txt b/CMakeLists.txt index a9ab2a8..f688adc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,5 +92,3 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/data/updates/upgrade_to_30003.sh.in u INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/upgrade_to_30003.sh DESTINATION /etc/package-manager/updates/) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/data/updates/upgrade_to_30004.sh.in upgrade_to_30004.sh $ONLY) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/upgrade_to_30004.sh DESTINATION /etc/package-manager/updates/) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/data/updates/upgrade_to_30005.sh.in upgrade_to_30005.sh $ONLY) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/upgrade_to_30005.sh DESTINATION /etc/package-manager/updates/) diff --git a/data/updates/upgrade_to_30005.sh.in b/data/updates/upgrade_to_30005.sh.in deleted file mode 100644 index 9814028..0000000 --- a/data/updates/upgrade_to_30005.sh.in +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -PATH=/bin:/usr/bin:/sbin:/usr/sbin - -source /etc/tizen-platform.conf - -PARSER_DB_NAME=.pkgmgr_parser.db -CERT_DB_NAME=.pkgmgr_cert.db -PARSER_DB_PATH=$TZ_SYS_DB/$PARSER_DB_NAME -CERT_DB_PATH=$TZ_SYS_DB/$CERT_DB_NAME - -function migrate_db() { - local dbpath=$1 - echo -e "PRAGMA journal_mode=WAL;" | sqlite3 $dbpath - echo "PRAGMA user_version=30005;" | sqlite3 $dbpath - - touch "$dbpath-shm" - chown app_fw:app_fw "$dbpath-shm" - chsmack -a User::Home "$dbpath-shm" - touch "$dbpath-wal" - chown app_fw:app_fw "$dbpath-wal" - chsmack -a User::Home "$dbpath-wal" -} - -function migrate_user_db() { - #get each user db path and call migrate_parser_db for each of it - - find $TZ_SYS_DB/user -name $PARSER_DB_NAME | while read DBPATH - do - migrate_db $DBPATH - done -} - -migrate_db $PARSER_DB_PATH -migrate_user_db -migrate_db $CERT_DB_PATH \ No newline at end of file diff --git a/packaging/pkgmgr-tool.spec b/packaging/pkgmgr-tool.spec index af614e7..7d8396e 100644 --- a/packaging/pkgmgr-tool.spec +++ b/packaging/pkgmgr-tool.spec @@ -76,7 +76,6 @@ update-mime-database %{_datadir}/mime %attr(0700,root,root) /etc/package-manager/updates/upgrade_to_30002.sh %attr(0700,root,root) /etc/package-manager/updates/upgrade_to_30003.sh %attr(0700,root,root) /etc/package-manager/updates/upgrade_to_30004.sh -%attr(0700,root,root) /etc/package-manager/updates/upgrade_to_30005.sh %attr(0700,root,root) /usr/share/upgrade/scripts/701.app2sd.patch.sh %attr(0700,root,root) %{_sysconfdir}/opt/upgrade/pkgmgr.patch.sh %attr(0700,root,root) /usr/share/fixed_multiuser/scripts/pkgmgr-clear-skel.sh -- 2.7.4 From 7910e25dd4509a4e1ecdf4f6eb73d4c00c5bdca6 Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Mon, 22 Jul 2019 17:44:52 +0900 Subject: [PATCH 10/16] Release version 0.5.4 Changes: - Revert "Add upgrade script for version 30005" Change-Id: I42c096924942b46cb55c1cae74cea43d579a1af5 Signed-off-by: Junghyun Yeon --- packaging/pkgmgr-tool.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/pkgmgr-tool.spec b/packaging/pkgmgr-tool.spec index 7d8396e..dc94fbf 100644 --- a/packaging/pkgmgr-tool.spec +++ b/packaging/pkgmgr-tool.spec @@ -1,6 +1,6 @@ Name: pkgmgr-tool Summary: Packager Manager Tool package -Version: 0.5.3 +Version: 0.5.4 Release: 1 Group: Application Framework/Package Management License: Apache-2.0 -- 2.7.4 From 3e9ff3c7bedb8f61a84b43d7c22e3fcfcc5e215d Mon Sep 17 00:00:00 2001 From: Ilho Kim Date: Thu, 25 Jul 2019 16:52:05 +0900 Subject: [PATCH 11/16] Fix error when doing FOTA It doesn't have ALL_PRELOAD_RW_PKG in the past, the case this file not exist is not error Make preload rw package list from db in that case Change-Id: I53fc539e22481070fde998518b05beaeef3eedfa Signed-off-by: Ilho Kim --- src/pkg_upgrade.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 68 insertions(+), 9 deletions(-) diff --git a/src/pkg_upgrade.c b/src/pkg_upgrade.c index 4ecacee..9078126 100644 --- a/src/pkg_upgrade.c +++ b/src/pkg_upgrade.c @@ -282,6 +282,15 @@ static int __make_pkgid_list(const char *file_path, char *pkgid, return 0; } +static int __insert_preload_rw_table(GHashTable *preload_rw_table, + const char *pkgid) +{ + char *package = strdup(pkgid); + retvm_if(package == NULL, -1, "strdup failed\n"); + g_hash_table_insert(preload_rw_table, package, NULL); + return 0; +} + static int __pkgid_list_cb(const pkgmgrinfo_pkginfo_h handle, void *user_data) { int ret = -1; @@ -307,6 +316,21 @@ static int __pkgid_list_cb(const pkgmgrinfo_pkginfo_h handle, void *user_data) return ret; } +static int __preload_rw_pkgid_list_cb(const pkgmgrinfo_pkginfo_h handle, + void *user_data) +{ + int ret; + char *pkgid; + GHashTable *preload_rw_table = (GHashTable *)user_data; + + ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid); + retvm_if(ret < 0, -1, "pkgmgrinfo_pkginfo_get_pkgid failed"); + + ret = __insert_preload_rw_table(preload_rw_table, pkgid); + retvm_if(ret < 0, -1, "__insert_preload_rw_table fail\n"); + return 0; +} + static void __str_trim(char *input) { char *trim_str = input; @@ -739,6 +763,46 @@ catch: return ret; } +static int __find_preload_rw_pkgid_from_db(GHashTable *preload_rw_table) +{ + int ret; + pkgmgrinfo_pkginfo_filter_h handle; + + ret = pkgmgrinfo_pkginfo_filter_create(&handle); + retvm_if(ret != PMINFO_R_OK, -1, + "pkginfo filter handle create failed\n"); + + ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, + PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD, 1); + tryvm_if(ret != PMINFO_R_OK, ret = -1, "pkgmgrinfo_pkginfo_filter_add_bool" + "(PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD) failed\n"); + + ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, + PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE, 1); + tryvm_if(ret != PMINFO_R_OK, ret = -1, "pkgmgrinfo_pkginfo_filter_add_bool" + "(PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE) failed\n"); + + ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, + PMINFO_PKGINFO_PROP_PACKAGE_READONLY, 0); + tryvm_if(ret != PMINFO_R_OK, ret = -1, "pkgmgrinfo_pkginfo_filter_add_bool" + "(PMINFO_PKGINFO_PROP_PACKAGE_READONLY) failed\n"); + + ret = pkgmgrinfo_pkginfo_filter_add_bool(handle, + PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM, 0); + tryvm_if(ret != PMINFO_R_OK, ret = -1, "pkgmgrinfo_pkginfo_filter_add_bool" + "(PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM) failed\n"); + + ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(handle, + __preload_rw_pkgid_list_cb, (void *)preload_rw_table); + err_if(ret != PMINFO_R_OK, + "pkgmgrinfo_pkginfo_filter_foreach_pkginfo() failed\n"); + + ret = 0; +catch: + pkgmgrinfo_pkginfo_filter_destroy(handle); + return ret; +} + static int __find_matched_pkgid_from_list(const char *source_file, const char *target_file) { @@ -864,13 +928,6 @@ static int __unzip_files(char *dest_path) return ret; } -static int __insert_preload_rw_table(GHashTable *preload_rw_table, - const char *pkgid) -{ - g_hash_table_insert(preload_rw_table, strdup(pkgid), NULL); - return 0; -} - static int __install_preload_rw(const char *pkgid, const char *pkgtype, GHashTable *preload_rw_table) { @@ -1271,8 +1328,10 @@ int main(int argc, char *argv[]) preload_rw_table = g_hash_table_new_full( g_str_hash, g_str_equal, free, NULL); - ret = __fill_preload_rw_table(preload_rw_table); - retvm_if(ret < 0, -1, "__fill_preload_rw_table is failed.\n"); + if (__fill_preload_rw_table(preload_rw_table) < 0) { + ret = __find_preload_rw_pkgid_from_db(preload_rw_table); + retvm_if(ret < 0, -1, "__find_preload_rw_pkgid_from_db is failed\n"); + } if (argc == 1) { ret = __process_ro_fota(preload_rw_table); -- 2.7.4 From aef0a17ba441ac6ab2da9af5973077fc14210f15 Mon Sep 17 00:00:00 2001 From: Ilho Kim Date: Mon, 29 Jul 2019 16:27:38 +0900 Subject: [PATCH 12/16] Fix static analysis issue Use strerror_r instead of strerror for thread safety Change-Id: Icf2e750fb4a18250543355ad613db4bae14cf984 Signed-off-by: Ilho Kim --- src/install_preload_pkg.c | 3 ++- src/pkg_upgrade.c | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/install_preload_pkg.c b/src/install_preload_pkg.c index 2218344..77e31e1 100644 --- a/src/install_preload_pkg.c +++ b/src/install_preload_pkg.c @@ -62,6 +62,7 @@ static void __make_preload_rw_list(GList *pkg_list) { FILE *file; + char err_buf[BUFSZE]; char pkg_info[BUFSZE]; if (pkg_list == NULL) @@ -70,7 +71,7 @@ static void __make_preload_rw_list(GList *pkg_list) file = fopen(ALL_PRELOAD_RW_PKG_LIST, "a"); if (file == NULL) { _E("can not open [%s]: %s\n", ALL_PRELOAD_RW_PKG_LIST, - strerror(errno)); + strerror_r(errno, err_buf, sizeof(err_buf))); return; } diff --git a/src/pkg_upgrade.c b/src/pkg_upgrade.c index 9078126..4acf3ed 100644 --- a/src/pkg_upgrade.c +++ b/src/pkg_upgrade.c @@ -160,6 +160,7 @@ static void __make_preload_rw_list(GHashTable *preload_rw_table) } FILE *file = NULL; + char buf[BUF_SIZE]; char tmp_path[BUF_SIZE]; snprintf(tmp_path, BUF_SIZE, "%s.tmp", ALL_PRELOAD_RW_PKG_LIST); @@ -167,8 +168,8 @@ static void __make_preload_rw_list(GHashTable *preload_rw_table) file = fopen(ALL_PRELOAD_RW_PKG_LIST, "w"); if (file == NULL) { - _LOG("can not open [%s]: %s\n", - ALL_PRELOAD_RW_PKG_LIST, strerror(errno)); + _LOG("can not open [%s]: %s\n", ALL_PRELOAD_RW_PKG_LIST, + strerror_r(errno, buf, sizeof(buf))); return; } g_hash_table_foreach(preload_rw_table, __iter_cb, file); @@ -1265,12 +1266,13 @@ static int __process_rw_fota(GHashTable *preload_rw_table) static int __check_tmp_all_preload_rw_pkg_list() { + char buf[BUF_SIZE]; char tmp_path[BUF_SIZE]; snprintf(tmp_path, BUF_SIZE, "%s.tmp", ALL_PRELOAD_RW_PKG_LIST); if (access(tmp_path, F_OK) == 0) { if (rename(tmp_path, ALL_PRELOAD_RW_PKG_LIST)) { _LOG("rename tmp all preload rw pkg list fail : %s\n", - strerror(errno)); + strerror_r(errno, buf, sizeof(buf))); return -1; } } -- 2.7.4 From abc88771ca24f58adacda9ebf5161da9f6920683 Mon Sep 17 00:00:00 2001 From: Kichan Kwon Date: Tue, 6 Aug 2019 09:53:37 +0900 Subject: [PATCH 13/16] Fix typo Change-Id: I99d45aa84d32b61e83182b545c6499904aa2b8a9 Signed-off-by: Kichan Kwon --- src/pkg_upgrade.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pkg_upgrade.c b/src/pkg_upgrade.c index 4acf3ed..7612793 100644 --- a/src/pkg_upgrade.c +++ b/src/pkg_upgrade.c @@ -1345,7 +1345,7 @@ int main(int argc, char *argv[]) ret = __process_rw_fota(preload_rw_table); if (ret < 0) { g_hash_table_destroy(preload_rw_table); - _LOGE("__process_ro_fota is failed.\n"); + _LOGE("__process_rw_fota is failed.\n"); return EXIT_FAILURE; } } else { @@ -1360,7 +1360,7 @@ int main(int argc, char *argv[]) ret = __process_rw_fota(preload_rw_table); if (ret < 0) { g_hash_table_destroy(preload_rw_table); - _LOGE("__process_ro_fota is failed.\n"); + _LOGE("__process_rw_fota is failed.\n"); return EXIT_FAILURE; } } else { -- 2.7.4 From cf3754ccabfa0596abf15580ac4b2ec205534015 Mon Sep 17 00:00:00 2001 From: Ilho Kim Date: Fri, 9 Aug 2019 17:15:44 +0900 Subject: [PATCH 14/16] Release version 0.5.5 Changes: - Fix error when doing FOTA - Fix static analysis issue - Fix typo Change-Id: I75bd87dd660ec853ec397204dda9c735da79820c Signed-off-by: Ilho Kim --- packaging/pkgmgr-tool.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/pkgmgr-tool.spec b/packaging/pkgmgr-tool.spec index dc94fbf..4d8fbc1 100644 --- a/packaging/pkgmgr-tool.spec +++ b/packaging/pkgmgr-tool.spec @@ -1,6 +1,6 @@ Name: pkgmgr-tool Summary: Packager Manager Tool package -Version: 0.5.4 +Version: 0.5.5 Release: 1 Group: Application Framework/Package Management License: Apache-2.0 -- 2.7.4 From c94bd25536d2622810cb52c3686574427d50720e Mon Sep 17 00:00:00 2001 From: Ilho Kim Date: Mon, 12 Aug 2019 15:06:29 +0900 Subject: [PATCH 15/16] Fix db migration script Change package_dependency_info's primary key Change-Id: I136c223cedd7f5681668ae32f1b01044fe316097 Signed-off-by: Ilho Kim --- data/updates/upgrade_to_30004.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/updates/upgrade_to_30004.sh.in b/data/updates/upgrade_to_30004.sh.in index d1214e2..67f66b4 100644 --- a/data/updates/upgrade_to_30004.sh.in +++ b/data/updates/upgrade_to_30004.sh.in @@ -14,7 +14,7 @@ function migrate_parser_db() { " depends_on TEXT NOT NULL,\n" \ " type TEXT NOT NULL,\n" \ " required_version TEXT,\n" \ - " PRIMARY KEY(package, depends_on, type, required_version)\n" \ + " PRIMARY KEY(package, depends_on),\n" \ " FOREIGN KEY(package)\n" \ " REFERENCES package_info(package) ON DELETE CASCADE);" | sqlite3 $dbpath -- 2.7.4 From b5f613edafa36b8b4bf2ce6dcfd5efe529ff5edb Mon Sep 17 00:00:00 2001 From: Ilho Kim Date: Mon, 12 Aug 2019 15:42:54 +0900 Subject: [PATCH 16/16] Add cert DB upgrade script Change-Id: Ia91e0d9120583401cbc009bd819f2205cf5b8d6d Signed-off-by: Ilho Kim --- data/updates/upgrade_to_30002.sh.in | 5 +++++ data/updates/upgrade_to_30003.sh.in | 5 +++++ data/updates/upgrade_to_30004.sh.in | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/data/updates/upgrade_to_30002.sh.in b/data/updates/upgrade_to_30002.sh.in index 6e19fb6..f77086f 100644 --- a/data/updates/upgrade_to_30002.sh.in +++ b/data/updates/upgrade_to_30002.sh.in @@ -6,6 +6,10 @@ source /etc/tizen-platform.conf PARSER_DB_NAME=.pkgmgr_parser.db PARSER_DB_PATH=$TZ_SYS_DB/$PARSER_DB_NAME +function migrate_cert_db() { + echo "PRAGMA user_version=30002;" | sqlite3 $TZ_SYS_DB/.pkgmgr_cert.db +} + function migrate_parser_db() { local dbpath=$1 @@ -25,3 +29,4 @@ function migrate_user_db() { migrate_parser_db $PARSER_DB_PATH migrate_user_db +migrate_cert_db diff --git a/data/updates/upgrade_to_30003.sh.in b/data/updates/upgrade_to_30003.sh.in index 773ab43..b33bdf6 100644 --- a/data/updates/upgrade_to_30003.sh.in +++ b/data/updates/upgrade_to_30003.sh.in @@ -6,6 +6,10 @@ source /etc/tizen-platform.conf PARSER_DB_NAME=.pkgmgr_parser.db PARSER_DB_PATH=$TZ_SYS_DB/$PARSER_DB_NAME +function migrate_cert_db() { + echo "PRAGMA user_version=30003;" | sqlite3 $TZ_SYS_DB/.pkgmgr_cert.db +} + function migrate_parser_db() { local dbpath=$1 @@ -25,3 +29,4 @@ function migrate_user_db() { migrate_parser_db $PARSER_DB_PATH migrate_user_db +migrate_cert_db diff --git a/data/updates/upgrade_to_30004.sh.in b/data/updates/upgrade_to_30004.sh.in index 67f66b4..faedc8b 100644 --- a/data/updates/upgrade_to_30004.sh.in +++ b/data/updates/upgrade_to_30004.sh.in @@ -6,6 +6,10 @@ source /etc/tizen-platform.conf PARSER_DB_NAME=.pkgmgr_parser.db PARSER_DB_PATH=$TZ_SYS_DB/$PARSER_DB_NAME +function migrate_cert_db() { + echo "PRAGMA user_version=30004;" | sqlite3 $TZ_SYS_DB/.pkgmgr_cert.db +} + function migrate_parser_db() { local dbpath=$1 @@ -38,3 +42,4 @@ function migrate_user_db() { migrate_parser_db $PARSER_DB_PATH migrate_user_db +migrate_cert_db -- 2.7.4