[Release] wrt-commons_0.2.112
[framework/web/wrt-commons.git] / etc / wrt_commons_reset_db.sh
1 #!/bin/sh
2 # Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 #
4 #    Licensed under the Apache License, Version 2.0 (the "License");
5 #    you may not use this file except in compliance with the License.
6 #    You may obtain a copy of the License at
7 #
8 #        http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #    Unless required by applicable law or agreed to in writing, software
11 #    distributed under the License is distributed on an "AS IS" BASIS,
12 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #    See the License for the specific language governing permissions and
14 #    limitations under the License.
15 #
16
17 rm -rf /opt/share/widget/system/*
18
19 #Removing of widget desktop icons
20 WIDGET_EXEC_PATH=/opt/usr/apps/
21 WIDGET_PRELOAD_EXEC_PATH=/usr/apps/
22 WIDGET_DESKTOP_PATH=/opt/share/applications/
23 WRT_DB=/opt/dbspace/.wrt.db
24 PLUGINS_INSTALLATION_REQUIRED_PATH=/opt/share/widget/
25 PLUGINS_INSTALLATION_REQUIRED=plugin-installation-required
26
27 if [ -f ${WRT_DB} ]
28 then
29     PKG_NAME_SET=$(sqlite3 $WRT_DB 'select tizen_appid from WidgetInfo;')
30     for appid in $PKG_NAME_SET
31     do
32         pkgId=`echo "$appid" | cut -f1 -d"."`
33         rm -rf ${WIDGET_EXEC_PATH}${pkgId}
34         rm -rf ${WIDGET_PRELOAD_EXEC_PATH}${pkgId}
35         widget_desktop_file="${WIDGET_DESKTOP_PATH}${appid}.desktop";
36         if [ -f ${widget_desktop_file} ]; then
37             rm -f $widget_desktop_file;
38         fi
39     done
40 else
41     echo "${WRT_DB} doesn't exist"
42 fi
43
44 wrt_commons_create_clean_db.sh
45 if [ -e ${PLUGINS_INSTALLATION_REQUIRED_PATH} ] && [ -d ${PLUGINS_INSTALLATION_REQUIRED_PATH} ]
46 then
47     touch ${PLUGINS_INSTALLATION_REQUIRED_PATH}${PLUGINS_INSTALLATION_REQUIRED}
48 fi