wok diff mysql/receipt @ rev 18730

Quote root dir in post_install
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Dec 20 15:13:45 2015 +0100 (2015-12-20)
parents d3eb5f4b53ea
children ed8073aa8cf0
line diff
     1.1 --- a/mysql/receipt	Thu Mar 26 09:34:19 2015 +0100
     1.2 +++ b/mysql/receipt	Sun Dec 20 15:13:45 2015 +0100
     1.3 @@ -101,20 +101,20 @@
     1.4  	user=mysql
     1.5  	group=mysql
     1.6  	
     1.7 -	if ! grep -q $user $1/etc/passwd; then
     1.8 +	if ! grep -q $user "$1/etc/passwd"; then
     1.9  		echo -n "Adding user/group $user..."
    1.10 -		chroot $1/ addgroup -S $group
    1.11 -		chroot $1/ adduser -s /bin/false -S -D -H -G $group $user
    1.12 +		chroot "$1/" addgroup -S $group
    1.13 +		chroot "$1/" adduser -s /bin/false -S -D -H -G $group $user
    1.14  		status
    1.15  	fi
    1.16  	# adduser mysql if needed
    1.17 -	if ! grep -q ${user} $1/etc/passwd; then
    1.18 +	if ! grep -q ${user} "$1/etc/passwd"; then
    1.19  		echo -n "Adding user MySQL..."
    1.20 -		chroot $1/ /bin/adduser -s /bin/false -h /dev/null \
    1.21 +		chroot "$1/" /bin/adduser -s /bin/false -h /dev/null \
    1.22  			-g "MySQL Daemon user" -u 27 -H -D -S -G ${group} ${user}
    1.23  		status
    1.24  	fi
    1.25 -	#chroot $1/ /bin/chown ${user}.${group} $(cat $1/$INSTALLED/$PACKAGE/files.list)
    1.26 +	#chroot "$1/" /bin/chown ${user}.${group} $(cat $1/$INSTALLED/$PACKAGE/files.list)
    1.27  	chroot "$1/" /bin/chown -R ${user}.${group} /var/lib/mysql
    1.28  	chroot "$1/" mysql_install_db --user=${user} --basedir=/usr
    1.29  	cat <<EOF
    1.30 @@ -131,9 +131,9 @@
    1.31  pre_install()
    1.32  {
    1.33  	# Cleanup old files
    1.34 -	rm -f $1/usr/libexec/mysql*
    1.35 +	rm -f "$1/usr/libexec/mysql"*
    1.36  	# Mv config
    1.37 -	[ -f $1/etc/my.cnf ] && mv -f $1/etc/my.cnf $1/etc/mysql/my.cnf
    1.38 +	[ -f "$1/etc/my.cnf" ] && mv -f "$1/etc/my.cnf" "$1/etc/mysql/my.cnf"
    1.39  }
    1.40  
    1.41  post_remove()