changeset 29:dc247a0bfda9

Added check if hg utility present in system.
author Oleksander Gavenko <gavenko_a@3g.ua>
date Mon, 03 Mar 2008 21:37:31 +0200
parents 134831d4f675
children 9450729571ee
files hg/hgrepsync
diffstat 1 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hg/hgrepsync	Mon Mar 03 21:10:23 2008 +0200
+++ b/hg/hgrepsync	Mon Mar 03 21:37:31 2008 +0200
@@ -35,6 +35,17 @@
     echo $MSG_SIGN: $MSG >>$LOG_FILE 2>&1
 }
 
+# Is hg utility present in system?
+Check_HG_exist() {
+    hg --help 1>/dev/null 2>/dev/null
+    if [ $? = 0 ]; then
+        return 0;
+    else
+        MSG="It seems that mercurial is not installed."
+        return 1;
+    fi
+}
+
 # Check on wrong place.
 Check_HG_REP_CONF_exist() {
     if [ x$HOME = x ] ; then
@@ -87,7 +98,13 @@
 echo ========================= >>$LOG_FILE 2>&1
 date +"%F %T" >>$LOG_FILE 2>&1
 
-if Check_HG_REP_CONF_exist ; then :
+if Check_HG_exist; then :
+else
+    PrintLog
+    exit 1;
+fi
+
+if Check_HG_REP_CONF_exist; then :
 else
     PrintLog
     exit 1;