null+****@clear*****
null+****@clear*****
2011年 7月 29日 (金) 16:38:44 JST
Kouhei Sutou 2011-07-29 07:38:44 +0000 (Fri, 29 Jul 2011)
New Revision: 6e7ea651c9b47bbad623c83afee66f9ffecb991a
Log:
[debian] check whether is groonga plugin installed.
Modified files:
debian/mysql-server-groonga.postinst
debian/mysql-server-groonga.postrm
Modified: debian/mysql-server-groonga.postinst (+6 -4)
===================================================================
--- debian/mysql-server-groonga.postinst 2011-07-28 21:55:51 +0000 (1f03a3f)
+++ debian/mysql-server-groonga.postinst 2011-07-29 07:38:44 +0000 (6442261)
@@ -5,11 +5,13 @@ set -e
prevver="$2"
install_plugin() {
- cat <<EOS | mysql --defaults-file=/etc/mysql/debian.cnf
-INSTALL PLUGIN groonga SONAME 'ha_groonga.so';
-CREATE FUNCTION last_insert_grn_id RETURNS INTEGER soname 'ha_groonga.so';
+ cat <<EOS | mysql --defaults-file=/etc/mysql/debian.cnf || true
+if (!`SELECT 1 FROM information_schema.plugins WHERE plugin_name="groonga"`)
+{
+ INSTALL PLUGIN groonga SONAME 'ha_groonga.so';
+ CREATE FUNCTION last_insert_grn_id RETURNS INTEGER soname 'ha_groonga.so';
+}
EOS
- true
}
case "$1" in
Modified: debian/mysql-server-groonga.postrm (+5 -2)
===================================================================
--- debian/mysql-server-groonga.postrm 2011-07-28 21:55:51 +0000 (b02041c)
+++ debian/mysql-server-groonga.postrm 2011-07-29 07:38:44 +0000 (cc47aad)
@@ -3,8 +3,11 @@
set -e
cat <<EOS | mysql --defaults-file=/etc/mysql/debian.cnf || true
-DROP FUNCTION last_insert_grn_id;
-UNINSTALL PLUGIN groonga;
+if (`SELECT 1 FROM information_schema.plugins WHERE plugin_name="groonga"`)
+{
+ DROP FUNCTION last_insert_grn_id;
+ UNINSTALL PLUGIN groonga;
+}
EOS
if [ "$1" = "purge" ]; then