[Groonga-mysql-commit] mroonga/mroonga at 9dabfad [master] rpm centos: check whether mroonga_libgroonga_version is empty or not

Back to archive index

HAYASHI Kentaro null+****@clear*****
Sun Sep 29 17:19:19 JST 2013


HAYASHI Kentaro	2013-09-29 17:19:19 +0900 (Sun, 29 Sep 2013)

  New Revision: 9dabfad27d5e1a9fe07f69fe51ce7ed1f626f92e
  https://github.com/mroonga/mroonga/commit/9dabfad27d5e1a9fe07f69fe51ce7ed1f626f92e

  Message:
    rpm centos: check whether mroonga_libgroonga_version is empty or not

  Modified files:
    packages/rpm/centos/mysql-mroonga.spec.in

  Modified: packages/rpm/centos/mysql-mroonga.spec.in (+12 -6)
===================================================================
--- packages/rpm/centos/mysql-mroonga.spec.in    2013-09-29 17:06:06 +0900 (4b1ef67)
+++ packages/rpm/centos/mysql-mroonga.spec.in    2013-09-29 17:19:19 +0900 (ddded56)
@@ -127,12 +127,18 @@ mysql -u root -e "quit"
 if [ $? -ne 0 ]; then
     password_option="-p"
 fi
-version=`mysql -e "show variables like 'mroonga_libgroonga_version'" | \
-    grep mroonga | cut -f 2 | sed -e 's/\.//g'`
-current_version=`expr $version`
+current_version=0
 version=`echo %{groonga_required_version} | sed -e 's/\.//g'`
 required_version=`expr $version`
-if [ $current_version -lt $required_version ]; then
+version=`mysql -e "show variables like 'mroonga_libgroonga_version'" | \
+    grep mroonga | cut -f 2 | sed -e 's/\.//g'`
+if [ -n "$version" ]; then
+    current_version=`expr $version`
+fi
+if [ "$1" = 2 ] ; then
+if [ $current_version -eq 0 ]; then
+    :
+elif [ $current_version -lt $required_version ]; then
     sql="
     USE mysql;
     DROP FUNCTION IF EXISTS mroonga_snippet;
@@ -152,8 +158,7 @@ if [ $current_version -lt $required_version ]; then
     echo "run the following command after restarting mysql server:";
     echo "  $command"
     exit 0
-fi
-if [ "$1" = 2 ] ; then
+else
     sql="
     USE mysql;
     DROP FUNCTION IF EXISTS mroonga_snippet;
@@ -169,6 +174,7 @@ if [ "$1" = 2 ] ; then
           (echo "run the following command to unregister mroonga:"; \
            echo "  $command")
 fi
+fi
 sql="
 DELETE IGNORE FROM mysql.plugin WHERE name = 'mroonga';
 INSTALL PLUGIN mroonga SONAME 'ha_mroonga.so';
-------------- next part --------------
HTML����������������������������...
다운로드 



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