install_widgets: improvements accepted/tizen_3.0.2015.q2_common tizen_3.0.2015.q2_common accepted/tizen/3.0.2015.q2/common/20150626.103155 submit/tizen_3.0.2015.q2_common/20150626.103114
authorJosé Bollo <jose.bollo@open.eurogiciel.org>
Fri, 26 Jun 2015 07:41:25 +0000 (09:41 +0200)
committerStephane Desneux <stephane.desneux@open.eurogiciel.org>
Fri, 26 Jun 2015 10:29:44 +0000 (12:29 +0200)
- add initialisation of empty bases by issuing 'pkgcmd -l'
- thus add developer in the loop
- removes unused file

Change-Id: I1c4de1264849570b7d69843bead2cc8cf8796a38
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
install.conf
install_widgets.sh
packaging/wrt-widgets.spec
prepare_widgets.sh [deleted file]
xwalk_widgets_preinstall.service

index c52c7b80af1f5187bd4bb28acced9e024dd05c8d..7eae8b11f72d1f2f01908af1b5d67029639ef194 100644 (file)
@@ -2,3 +2,4 @@ alice:annex.wgt
 bob:bubblewrap.wgt go.wgt
 carol:
 guest:mancala.wgt
+developer:
index 239087384b39bc13d6afe63d3c04719001facd65..b5a1acbb9ecac2752dbe37361e6cf6eb11cdfc38 100755 (executable)
@@ -11,31 +11,31 @@ function do_install() {
        info "------------- wrt_widgets install start --------------"
 
        local wgtdir=${TZ_SYS_SHARE}/widget_demo
-       if [ -n "$(ls $wgtdir/*.wgt 2> /dev/null)" ]; then
-               local nbinstall=0
-               for wgt in $(grep "^$USER" $wgtdir/install.conf | cut -f2 -d':'); do
-                       info "installing $wgt" 
-                       local try=1
-                       local ok=0
-                       while [ $try -le 3 ]; do
-                               flock -w 30 -e /tmp/pkgcmd_lock pkgcmd -i -q -t wgt -p $wgtdir/$wgt && { ok=1; break; }
-                               try=$((try+1))
-                               sleep 1
-                       done
-                       [ $ok -eq 1 ] && {
-                               info "$wgt installed successfully" 
-                               nbinstall=$((nbinstall+1))
-                       } || info "failed to install $wgt" 
+       local nbinstall=0
+       for wgt in $(grep "^$USER" $wgtdir/install.conf | cut -f2 -d':'); do
+               info "installing $wgt" 
+               local try=1
+               local ok=0
+               while [ $try -le 3 ]; do
+                       flock -w 30 -e /tmp/pkgcmd_lock pkgcmd -i -q -t wgt -p $wgtdir/$wgt && { ok=1; break; }
+                       try=$((try+1))
+                       sleep 1
                done
-
-               # signal tz-launcher that new apps were installed
-               info "$nbinstall applications installed" 
-               if [ $nbinstall -gt 0 ]; then
-                       info "sending restart signal to tz-launcher"
-                       pkill -USR1 -U $UID tz-launcher
-               fi
+               [ $ok -eq 1 ] && {
+                       info "$wgt installed successfully" 
+                       nbinstall=$((nbinstall+1))
+               } || info "failed to install $wgt" 
+       done
+
+       # signal tz-launcher that new apps were installed
+       info "$nbinstall applications installed" 
+       if [ $nbinstall -gt 0 ]; then
+               info "sending restart signal to tz-launcher"
+               pkill -USR1 -U $UID tz-launcher
        else
-          info "$wgtdir doesn't contains any widgets (.wgt)" 
+               info "$wgtdir hasn't installed widget (.wgt), init the bases..."
+               pkgcmd -l
+               info "init done"
        fi
 
        info "------------- wrt_widgets install end --------------"
index addeb2f726f3cfa5a7dc0b528220a62e78a154eb..5ff2673b73b1e7c0cc0f75309e6ae075c4625b6d 100644 (file)
@@ -25,7 +25,6 @@ cp %{SOURCE1001} .
 
 mkdir -p %{buildroot}/%{_bindir}
 cp install_widgets.sh %{buildroot}/%{_bindir}
-cp prepare_widgets.sh %{buildroot}/%{_bindir}
 
 mkdir -p  %{buildroot}/%{TZ_SYS_SHARE}/widget_demo
 cp -r apps/*.wgt %{buildroot}/%{TZ_SYS_SHARE}/widget_demo/
@@ -50,6 +49,5 @@ rm -f %{_unitdir_user}/default.target.wants/xwalk_widgets_preinstall.service
 %defattr(-,root,root)
 %{TZ_SYS_SHARE}/widget_demo/*
 %attr(755,root,root) %{_bindir}/install_widgets.sh
-%attr(755,root,root) %{_bindir}/prepare_widgets.sh
 %{_unitdir_user}/xwalk_widgets_preinstall.service
 
diff --git a/prepare_widgets.sh b/prepare_widgets.sh
deleted file mode 100755 (executable)
index ac85903..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-##### vconf create table from settings package #########################
-# Set vconf values with -g/-u options
-
-source /etc/tizen-platform.conf
-
-rm -rf ${TZ_SYS_DATA}/setting/set_info
-
-#### Bluetotth API ####################################################
-vconftool set -t string db/menu_widget/regionformat "en_GB.UTF-8"
-vconftool set -t int db/menu_widget/regionformat_time1224 "1"
-vconftool set -t string db/setting/accessibility/font_name "HelveticaNeue"
-
-########################################################################
-#  PC Specific Environment settings
-
-mkdir -p ${TZ_SYS_RW_PACKAGES}
-
-##### WA : To allow multi-user launch  ##########
-chmod -R a+rw ${TZ_SYS_DB}/
-
index 781432d45d6010af8b2b75897ab71e14a934655f..effe23ec73026b0b7623ec686363fd14cb68b81c 100644 (file)
@@ -5,6 +5,7 @@ ConditionPathExists=!%h/.applications/install_done
 [Service]
 Type=idle
 ExecStart=/usr/bin/install_widgets.sh
+TimeoutSec=0
 
 [Install]
 WantedBy=default.target