From 2c327a2c9dcf522d375d0e540f1145d30c079e9b Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Fri, 18 Aug 2017 10:28:42 +0900 Subject: [PATCH] Fix upgrade script - Remove unused function - Add function to remove files at previous location(/opt/usr/apps) after coping it to new location Change-Id: I7a48df2d6c9a78aa6c8d0f4f7e8dbfdcabb3e829 Signed-off-by: Junghyun Yeon --- data/700.pkgmgr.patch.sh.in | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/data/700.pkgmgr.patch.sh.in b/data/700.pkgmgr.patch.sh.in index cd0f1f9..7bf1c09 100644 --- a/data/700.pkgmgr.patch.sh.in +++ b/data/700.pkgmgr.patch.sh.in @@ -194,6 +194,18 @@ function move_user_wgt_files(){ } +function remove_previous_files(){ + echo "#remove files from previous location" + echo "SELECT package FROM package_info WHERE package_readonly='false' COLLATE NOCASE;" | + sqlite3 $PARSER_BACKUP_DB_PATH > $DB_RESULT_FILE + + while read package + do + rm -rf $OPT_USR_APPS/$package + done < $DB_RESULT_FILE + rm -f $DB_RESULT_FILE +} + function initdb(){ echo "#pkg_initdb" pkg_initdb --ro --partial-rw @@ -206,20 +218,6 @@ function initdb(){ pkg_initdb --uid 5001 } -function migrate_user_tpk(){ - #run manifest direct install of user tpk pkgs - echo ".separator \" \" - SELECT package, LOWER(package_type) FROM package_info WHERE package_readonly='false' COLLATE NOCASE AND (package_type='tpk' COLLATE NOCASE OR package_type='wgt' COLLATE NOCASE);" | - sqlite3 $PARSER_BACKUP_DB_PATH > $DB_RESULT_FILE - - while read package type - do - echo "processing $package..." - $type-backend -y $package - done < $DB_RESULT_FILE - rm -f $DB_RESULT_FILE -} - function remove_files_for_deleted_packages(){ #delete userdata of packages which are removed in 3.0 echo "#delete userdata of removed packages" @@ -388,6 +386,7 @@ remove_unregistered_pkg move_user_tpk_files move_user_wgt_files +remove_previous_files initdb init_user_tpk_packages -- 2.7.4