[arch-commits] Commit in mariadb/trunk (PKGBUILD mariadb.install)
Bartłomiej Piotrowski
bpiotrowski at nymeria.archlinux.org
Tue Feb 26 16:28:38 UTC 2013
Date: Tuesday, February 26, 2013 @ 17:28:38
Author: bpiotrowski
Revision: 84979
upgpkg: mariadb 5.5.29-4
- simplify install script
- pass $datadir to mysql_install_db
Modified:
mariadb/trunk/PKGBUILD
mariadb/trunk/mariadb.install
-----------------+
PKGBUILD | 2 +-
mariadb.install | 16 +++++-----------
2 files changed, 6 insertions(+), 12 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2013-02-26 16:22:29 UTC (rev 84978)
+++ PKGBUILD 2013-02-26 16:28:38 UTC (rev 84979)
@@ -4,7 +4,7 @@
pkgbase=mariadb
pkgname=('libmariadbclient' 'mariadb-clients' 'mariadb')
pkgver=5.5.29
-pkgrel=3
+pkgrel=4
arch=('i686' 'x86_64')
license=('GPL')
url='http://mariadb.org/'
Modified: mariadb.install
===================================================================
--- mariadb.install 2013-02-26 16:22:29 UTC (rev 84978)
+++ mariadb.install 2013-02-26 16:28:38 UTC (rev 84979)
@@ -1,13 +1,15 @@
-post_install(){
+if [[ $(command -v my_print_defaults >/dev/null 2>&1) ]]; then
datadir=$(my_print_defaults mysqld | sed -n "s/^--datadir=//p")
- [[ -z $datadir ]] && datadir=/var/lib/mysql
+fi
+[[ -z $datadir ]] && datadir=/var/lib/mysql
+post_install(){
groupadd -g 89 mysql &>/dev/null
useradd -u 89 -g mysql -d $datadir -s /bin/false mysql &>/dev/null
if [[ ! -e $datadir ]]; then
install -dm700 $datadir
- usr/bin/mysql_install_db --user=mysql --basedir=/usr
+ usr/bin/mysql_install_db --user=mysql --basedir=/usr --datadir=$datadir
chown -R mysql:mysql var/lib/mysql &>/dev/null
fi
@@ -15,17 +17,9 @@
}
post_upgrade(){
- datadir=$(my_print_defaults mysqld | sed -n "s/^--datadir=//p")
- [[ -z $datadir ]] && datadir=/var/lib/mysql
-
getent group mysql >/dev/null 2>&1 || groupadd -g 89 mysql &>/dev/null
getent passwd mysql >/dev/null 2>&1 || useradd -u 89 -g mysql -d $datadir -s /bin/false mysql &>/dev/null
- if [[ "$(vercmp $2 5.5)" -lt 0 ]]; then
- echo ">>> Major version update. Consider restart the service, and"
- echo " then running mysql_upgrade after it."
- fi
-
if [[ "$(vercmp $2 5.5.25-4)" -lt 0 ]] && [[ -d /data ]]; then
for x in data/*; do
cp -r $x $datadir/
More information about the arch-commits
mailing list