From 59d48bcec97e1eb961465d3b0c46ecfa720dfd3b Mon Sep 17 00:00:00 2001 From: Andrzej Surdej Date: Thu, 25 Apr 2013 13:17:19 +0200 Subject: [PATCH] Fix for reset scripts. [Issue#] LINUXWRT-278 [Problem] N/A [Cause] N/A [Solution] Uninstall widget before database reseting. Remove smack files. (Use --old to not uninstall) [Verification] Install some widgets. Run wrt_reset_all.sh with and without '--old' opt. Change-Id: Icedab43ca89e0462757d93f6f0a263e8d2bf8b8f --- etc/wrt_commons_reset_db.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/etc/wrt_commons_reset_db.sh b/etc/wrt_commons_reset_db.sh index fb2d4bf..8fd3f3c 100755 --- a/etc/wrt_commons_reset_db.sh +++ b/etc/wrt_commons_reset_db.sh @@ -15,11 +15,17 @@ # rm -rf /opt/share/widget/system/* - +uninstall_widgets=1 +if [ "$1" == "--old" ] +then + echo "Uninstalling turned off" + uninstall_widgets=0 +fi #Removing of widget desktop icons WIDGET_EXEC_PATH=/opt/usr/apps/ WIDGET_PRELOAD_EXEC_PATH=/usr/apps/ WIDGET_DESKTOP_PATH=/opt/share/applications/ +SMACK_RULES_PATH=/etc/smack/accesses.d/ WRT_DB=/opt/dbspace/.wrt.db PLUGINS_INSTALLATION_REQUIRED_PATH=/opt/share/widget/ PLUGINS_INSTALLATION_REQUIRED=plugin-installation-required @@ -29,6 +35,10 @@ then PKG_NAME_SET=$(sqlite3 $WRT_DB 'select tizen_appid from WidgetInfo;') for appid in $PKG_NAME_SET do + if [ $uninstall_widgets -eq 1 ] + then + wrt-installer -un $appid 2&>1 >/dev/null + fi pkgId=`echo "$appid" | cut -f1 -d"."` rm -rf ${WIDGET_EXEC_PATH}${pkgId} rm -rf ${WIDGET_PRELOAD_EXEC_PATH}${pkgId} @@ -36,6 +46,10 @@ then if [ -f ${widget_desktop_file} ]; then rm -f $widget_desktop_file; fi + widget_smack_rule="${SMACK_RULES_PATH}${pkgId}" + if [ -f ${widget_smack_rule} ]; then + rm -f $widget_smack_rule; + fi done else echo "${WRT_DB} doesn't exist" -- 2.34.1