Navigation Menu

Skip to content

Commit

Permalink
[debian] check whether is groonga plugin installed.
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jul 29, 2011
1 parent 6ff1c37 commit 6e7ea65
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 6 additions & 4 deletions debian/mysql-server-groonga.postinst
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions debian/mysql-server-groonga.postrm
Expand Up @@ -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
Expand Down

0 comments on commit 6e7ea65

Please sign in to comment.