[Groonga-commit] droonga/droonga-engine at d89950e [master] Skip installation of platform packages if not needed

Back to archive index

SHIMODA Piro Hiroshi null+****@clear*****
Thu Sep 25 02:16:34 JST 2014


SHIMODA "Piro" Hiroshi	2014-09-25 02:16:34 +0900 (Thu, 25 Sep 2014)

  New Revision: d89950e56402dae5f98339951ac5ed595efecbbe
  https://github.com/droonga/droonga-engine/commit/d89950e56402dae5f98339951ac5ed595efecbbe

  Message:
    Skip installation of platform packages if not needed

  Modified files:
    install.sh

  Modified: install.sh (+23 -0)
===================================================================
--- install.sh    2014-09-25 02:00:48 +0900 (69cfa48)
+++ install.sh    2014-09-25 02:16:34 +0900 (3ff7c10)
@@ -42,6 +42,10 @@ DROONGA_BASE_DIR=/home/$USER/droonga
 : ${VERSION:=release}
 : ${HOST:=Auto Detect}
 
+REQUIRED_COMMANDS=gem
+[ "$VERSION" = "master" ] &&
+  REQUIRED_COMMANDS="$REQUIRED_COMMANDS git"
+
 case $(uname) in
   Darwin|*BSD|CYGWIN*) sed="sed -E" ;;
   *)                   sed="sed -r" ;;
@@ -51,6 +55,15 @@ exist_command() {
   type "$1" > /dev/null 2>&1
 }
 
+exist_all_commands() {
+  for command in $@; do
+    if ! exist_command $command; then
+      return 1
+    fi
+  done
+  return 0
+}
+
 exist_user() {
   id "$1" > /dev/null 2>&1
 }
@@ -63,6 +76,16 @@ prepare_user() {
   fi
 }
 
+prepare_environment() {
+  if exist_all_commands $REQUIRED_COMMANDS; then
+    return 0
+  fi
+
+  echo "Preparing the environment..."
+  prepare_environment_in_$PLATFORM
+  return 0
+}
+
 setup_configuration_directory() {
   echo ""
   echo "Setting up the configuration directory..."
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index