Navigation Menu

Skip to content

Commit

Permalink
package rpm: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Dec 16, 2015
1 parent dabbca2 commit 19b8d85
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
8 changes: 4 additions & 4 deletions packages/rpm/centos/mysql55-mroonga.spec.in
Expand Up @@ -97,10 +97,10 @@ rm -rf $RPM_BUILD_ROOT

%post
mysql_command=`scl enable mysql55 'which mysql'`
password_option=""
$mysql_command -u root -e "quit" > /dev/null 2>&1
if [ $? -ne 0 ]; then
password_option="-p"
if $mysql_command -u root -e "quit" > /dev/null 2>&1; then
password_option=""
else
password_option="-p"
fi
current_version=0
version=`echo %{groonga_required_version} | sed -e 's/\.//g'`
Expand Down
8 changes: 4 additions & 4 deletions packages/rpm/centos/mysql56-community-mroonga.spec.in
Expand Up @@ -103,10 +103,10 @@ else
fi

mysql_command=`which mysql`
password_option=""
$mysql_command -u root -e "quit" > /dev/null 2>&1
if [ $? -ne 0 ]; then
password_option="-p"
if $mysql_command -u root -e "quit" > /dev/null 2>&1; then
password_option=""
else
password_option="-p"
fi
current_version=0
version=`echo %{groonga_required_version} | sed -e 's/\.//g'`
Expand Down
8 changes: 5 additions & 3 deletions packages/rpm/centos/percona-server-56-mroonga.spec.in
Expand Up @@ -97,9 +97,11 @@ fi

mysql_command=`which mysql`
password_option=""
$mysql_command -u root -e "quit" > /dev/null 2>&1
if [ $? -ne 0 ]; then
password_option="-p"

if $mysql_command -u root -e "quit" > /dev/null 2>&1; then
password_option=""
else
password_option="-p"
fi
current_version=0
version=`echo %{groonga_required_version} | sed -e 's/\.//g'`
Expand Down

0 comments on commit 19b8d85

Please sign in to comment.