X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=etc%2Fwrt_preinstall_widgets.sh;h=996d6a311df4918879c3b93d7f9e3fbc53f2832a;hb=3ccedacb4233a157f254780f34b97b43eaa78e5d;hp=37325903c2fa3f40b43e3787e2ba79a58049f7da;hpb=9d2a85bcd9d96d0a67f7ca4093c284be7dd66115;p=framework%2Fweb%2Fwrt-installer.git diff --git a/etc/wrt_preinstall_widgets.sh b/etc/wrt_preinstall_widgets.sh index 3732590..996d6a3 100755 --- a/etc/wrt_preinstall_widgets.sh +++ b/etc/wrt_preinstall_widgets.sh @@ -14,18 +14,32 @@ # limitations under the License. # -_working_dir="/opt/media/Downloads/.preinstallWidgets" -_widget_temp="/opt/apps/widget/*"; +_working_dir="/opt/usr/media/Downloads/.preinstallWidgets" +_widget_temp="/opt/share/widget/*" + +#Reinstall widget during booting +_temp_widget_path="/opt/share/widget/temp_info" install_widgets() { _wgt_list=`find $_working_dir -name '*.wgt'` + install_failed=0 for list in $_wgt_list do echo "Install $list" - wrt-installer -i $list + return_string=`wrt-installer -i $list 2>&1 | grep -v plugin` + if [ "$return_string" != "${return_string/successful/}" ]; then + echo "$list widget installation success" + rm -rf $list + else + echo "$list widget installaiton failed" + install_failed=1 + fi done - rm -rf $_working_dir + if [ $install_failed -ne 1 ];then + echo "preinstall success" + rm -rf $_working_dir + fi } restore_widget() { @@ -36,10 +50,6 @@ for file in $_widget_temp; do fi done - -#Reinstall widget during booting -_temp_widget_path=/opt/apps/widget/temp_info - FILE_LIST=`ls $_temp_widget_path` if [ -n "$FILE_LIST" ]; then @@ -49,19 +59,21 @@ if [ -n "$FILE_LIST" ]; then line=`cat $FILE_NAME` echo "----------------------------------------------------------------" echo "UnInstalling widget : $line ..." - wrt-installer -up $line - echo "Installing widget : $line ..." - wrt-installer -i $line + return_string=`wrt-installer -up $line 2>&1 | grep -v plugin` + echo "Result $return_string" done else echo "There is no reinstall widget." fi } -if [ ! -d $_working_dir ]; then - echo "There is no preinstall widget directory - $_working_dir" +#Plugin installation is temporary code for window SDK +/usr/bin/wrt-installer -p + +RECOVER_WIDGETS=`ls $_temp_widget_path` +if [ -n "$RECOVER_WIDGETS" ]; then + echo "Start Recover" restore_widget - exit 1 fi install_widgets