@@ -140,44 +140,41 @@ ln -snf $VTTOP/go/zk/zkctl/zksrv.sh $VTROOT/bin/zksrv.sh
140140ln -snf $VTTOP /test/vthook-test.sh $VTROOT /vthook/test.sh
141141
142142# install mysql
143- if [ -z " $MYSQL_FLAVOR " ]; then
144- export MYSQL_FLAVOR=MariaDB
145- fi
146- case " $MYSQL_FLAVOR " in
147- " MySQL56" )
148- myversion=` $VT_MYSQL_ROOT /bin/mysql --version | grep ' Distrib 5\.6' `
149- [ " $myversion " != " " ] || fail " Couldn't find MySQL 5.6 in $VT_MYSQL_ROOT . Set VT_MYSQL_ROOT to override search location."
150- echo " Found MySQL 5.6 installation in $VT_MYSQL_ROOT ."
143+ case " ${MYSQL_FLAVOR} " in
144+ " MySQL56" | " Percona" )
145+ myversion=` ${VT_MYSQL_ROOT} /bin/mysql --version | grep ' Distrib 5\.6' `
146+ [ " $myversion " != " " ] || fail " Couldn't find MySQL 5.6 in ${VT_MYSQL_ROOT} . Set VT_MYSQL_ROOT to override search location."
147+ echo " Found MySQL 5.6 installation in ${VT_MYSQL_ROOT} ."
151148 ;;
152149
153150 " MariaDB" )
154- myversion=` $VT_MYSQL_ROOT /bin/mysql --version | grep MariaDB`
155- [ " $myversion " != " " ] || fail " Couldn't find MariaDB in $VT_MYSQL_ROOT . Set VT_MYSQL_ROOT to override search location."
156- echo " Found MariaDB installation in $VT_MYSQL_ROOT ."
151+ myversion=` ${ VT_MYSQL_ROOT} /bin/mysql --version | grep MariaDB`
152+ [ " $myversion " != " " ] || fail " Couldn't find MariaDB in ${ VT_MYSQL_ROOT} . Set VT_MYSQL_ROOT to override search location."
153+ echo " Found MariaDB installation in ${ VT_MYSQL_ROOT} ."
157154 ;;
158155
159156 * )
160- fail " Unsupported MYSQL_FLAVOR $MYSQL_FLAVOR "
157+ fail " Unsupported MYSQL_FLAVOR ${ MYSQL_FLAVOR} "
161158 ;;
162159
163160esac
164161
165162# save the flavor that was used in bootstrap, so it can be restored
166163# every time dev.env is sourced.
167- echo " $MYSQL_FLAVOR " > $VTROOT /dist/MYSQL_FLAVOR
164+ echo " ${ MYSQL_FLAVOR} " > $VTROOT /dist/MYSQL_FLAVOR
168165
169166# generate pkg-config, so go can use mysql C client
170- [ -x $VT_MYSQL_ROOT /bin/mysql_config ] || fail " Cannot execute $VT_MYSQL_ROOT /bin/mysql_config. Did you install a client dev package?"
167+ [ -x ${ VT_MYSQL_ROOT} /bin/mysql_config ] || fail " Cannot execute ${ VT_MYSQL_ROOT} /bin/mysql_config. Did you install a client dev package?"
171168
172169cp $VTTOP /config/gomysql.pc.tmpl $VTROOT /lib/gomysql.pc
173- echo " Version:" " $( $VT_MYSQL_ROOT /bin/mysql_config --version) " >> $VTROOT /lib/gomysql.pc
174- echo " Cflags:" " $( $VT_MYSQL_ROOT /bin/mysql_config --cflags) -ggdb -fPIC" >> $VTROOT /lib/gomysql.pc
175- if [ " $MYSQL_FLAVOR " == " MariaDB" ]; then
170+ echo " Version:" " $( ${ VT_MYSQL_ROOT} /bin/mysql_config --version) " >> $VTROOT /lib/gomysql.pc
171+ echo " Cflags:" " $( ${ VT_MYSQL_ROOT} /bin/mysql_config --cflags) -ggdb -fPIC" >> $VTROOT /lib/gomysql.pc
172+ if [ " ${ MYSQL_FLAVOR} " == " MariaDB" ] || [ " ${MYSQL_FLAVOR} " == " Percona " ]; then
176173 # Use static linking because the shared library doesn't export
177174 # some internal functions we use, like cli_safe_read.
178- echo " Libs:" " $( $VT_MYSQL_ROOT /bin/mysql_config --libs_r | sed -r ' s,-lmysqlclient(_r)?,-l:libmysqlclient.a -lstdc++,' ) " >> $VTROOT /lib/gomysql.pc
175+ echo " Libs:" " $( ${ VT_MYSQL_ROOT} /bin/mysql_config --libs_r | sed -r ' s,-lmysqlclient(_r)?,-l:libmysqlclient.a -lstdc++,' ) " >> $VTROOT /lib/gomysql.pc
179176else
180- echo " Libs:" " $( $VT_MYSQL_ROOT /bin/mysql_config --libs_r) " >> $VTROOT /lib/gomysql.pc
177+ echo " Libs:" " $( ${ VT_MYSQL_ROOT} /bin/mysql_config --libs_r) " >> $VTROOT /lib/gomysql.pc
181178fi
182179
183180# install bson
0 commit comments