From: Stephane Desneux Date: Fri, 27 Feb 2015 09:39:54 +0000 (+0100) Subject: serialize calls to pkgcmd to avoid installation errors X-Git-Tag: accepted/tizen/3.0.2014.q4/common/20150227.101655^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;p=profile%2Fcommon%2Fwrt-widgets.git serialize calls to pkgcmd to avoid installation errors Change-Id: I543fc1c5fdeef33cd3a30d87a731c013bfb26785 Signed-off-by: Stephane Desneux --- diff --git a/install_widgets.sh b/install_widgets.sh index d5e8801..2390873 100755 --- a/install_widgets.sh +++ b/install_widgets.sh @@ -18,9 +18,9 @@ function do_install() { local try=1 local ok=0 while [ $try -le 3 ]; do - pkgcmd -i -q -t wgt -p $wgtdir/$wgt && { ok=1; break; } + flock -w 30 -e /tmp/pkgcmd_lock pkgcmd -i -q -t wgt -p $wgtdir/$wgt && { ok=1; break; } try=$((try+1)) - sleep 3 + sleep 1 done [ $ok -eq 1 ] && { info "$wgt installed successfully"