X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsynfigstudio-cph-monitor;h=000b83a2d6628d1b59c7e63ee40d2bb95436fe53;hb=c7efa619796407db833eb61ac1f41deb4cca78c8;hp=02fc18a672a722c843161ca0bdd5f989dbbd847a;hpb=e8e10402449a7a1850dd5f4ab3e0e72d04af3f84;p=synfig.git diff --git a/synfig-studio/trunk/synfigstudio-cph-monitor b/synfig-studio/trunk/synfigstudio-cph-monitor index 02fc18a..000b83a 100755 --- a/synfig-studio/trunk/synfigstudio-cph-monitor +++ b/synfig-studio/trunk/synfigstudio-cph-monitor @@ -17,12 +17,16 @@ trap writelog INT init() { +echo "Synfig Crash Monitor is a tool to collect statistics about synfig crashes." +echo "All information is collected locally in ~/.synfig/cph directory." +echo echo `date +%H:%M` "Synfig Crash Monitor started." STARTED=0 RUNTIME=0 VERSION='' RELEASE='' BRANCH='' +REVISION_ID='' CRASH=0 [ ! -d ~/.synfig/cph ] && mkdir -p ~/.synfig/cph || true } @@ -45,7 +49,7 @@ writelog() fi fi #write log - echo $VERSION/$BRANCH/$RELEASE $RUNTIME $CRASH >> ~/.synfig/cph/log + echo $VERSION/$BRANCH/$RELEASE/$REVISION_ID $RUNTIME $CRASH >> ~/.synfig/cph/log CRASH=0 RUNTIME=0 else @@ -94,27 +98,32 @@ dumpstats() mainloop() { while true; do - if ( ps -f -u `whoami`|egrep "synfigstudio$" >/dev/null ) ; then + export PS=$(ps -f -u `whoami`) + if ( ( echo "$PS" |egrep "synfigstudio$" >/dev/null ) || ( echo "$PS" | egrep "synfigstudio " >/dev/null ) ) ; then #synfigstudio process exist if [[ $STARTED == 0 ]]; then STARTED=1 RUNTIME=0 #get version - P=$(ps -f -u `whoami`|egrep "synfigstudio$"| tr -s ' '| cut -d ' ' -f 8) + if ( echo "$PS" |egrep "synfigstudio$" >/dev/null ) ; then + P=$( echo "$PS" |egrep "synfigstudio$"| tr -s ' '| cut -d ' ' -f 8) + else + P=$( echo "$PS" |egrep "synfigstudio "| tr -s ' '| cut -d ' ' -f 8) + fi echo if [ ! -e $P ]; then P=`which $P` fi - echo $P P=`dirname $P` - echo " Assuming synfig installed in $P." VERSION=`$P/synfig --info|head -n 1|cut -d '-' -f 2` - RELEASE=`$P/synfig --info|egrep "Development version:"|cut -d ' ' -f 3` - BRANCH=`$P/synfig --info|egrep "Branch:"|cut -d ' ' -f 2` + RELEASE=`$P/synfig --info|egrep "Revision:"|cut -d ' ' -f 2` + BRANCH=`$P/synfig --info|egrep "Branch:"|cut -d ' ' -f 2-3` + REVISION_ID=`$P/synfig --info|egrep "Revision ID:"|cut -d ' ' -f 3` if [[ $BRANCH == '(no branch)' ]]; then - BRANCH=`$P/synfig --info|egrep "Revision ID:"|cut -d ' ' -f 3` + BRANCH=$REVISION_ID fi - echo `date +%H:%M` "Synfig $VERSION.$RELEASE.$BRANCH started." + echo `date +%H:%M` "Synfig $VERSION.$RELEASE.$BRANCH.$REVISION_ID started." + echo `date +%H:%M` "Assuming Synfig installed in $P." else let RUNTIME=$RUNTIME+1 fi