/[gentoo-x86]/eclass/mysql_fx.eclass
Gentoo

Diff of /eclass/mysql_fx.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 Revision 1.4
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql_fx.eclass,v 1.3 2006/01/14 19:00:32 vivo Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mysql_fx.eclass,v 1.4 2006/01/24 19:14:00 vivo Exp $
4 4
5# Author: Francesco Riosa <vivo at gentoo.org> 5# Author: Francesco Riosa <vivo at gentoo.org>
6# Maintainer: Francesco Riosa <vivo at gentoo.org> 6# Maintainer: Francesco Riosa <vivo at gentoo.org>
7 7
8# helper function, version (integer) may have section separated by dots 8# helper function, version (integer) may have section separated by dots
85 done < "${index_file}" 85 done < "${index_file}"
86 ${my_test_fx} $flags "${pname}" \ 86 ${my_test_fx} $flags "${pname}" \
87 && for (( i=0 ; $i < $ndsc ; i++ )) ; do einfo "> ${dsc[$i]}" ; done 87 && for (( i=0 ; $i < $ndsc ; i++ )) ; do einfo "> ${dsc[$i]}" ; done
88} 88}
89 89
90 90# * char mysql_strip_double_slash()
91# void mysql_init_vars()
92#
93# initialize global variables
94# 2005-11-19 <vivo at gentoo.org>
95mysql_init_vars() {
96
97 if [[ ${SLOT} -eq 0 ]] ; then
98 MY_SUFFIX=""
99 else
100 MY_SUFFIX=${MY_SUFFIX:-"-${SLOT}"}
101 fi
102 MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR:-"/usr/share/mysql${MY_SUFFIX}"}
103 MY_SYSCONFDIR=${MY_SYSCONFDIR="/etc/mysql${MY_SUFFIX}"}
104 MY_LIBDIR=${MY_LIBDIR="/usr/$(get_libdir)/mysql${MY_SUFFIX}"}
105 MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="/var/lib/mysql${MY_SUFFIX}"}
106 MY_LOGDIR=${MY_LOGDIR="/var/log/mysql${MY_SUFFIX}"}
107 MY_INCLUDEDIR=${MY_INCLUDEDIR="/usr/include/mysql${MY_SUFFIX}"}
108
109 if [ -z "${DATADIR}" ]; then
110 DATADIR=""
111 if [ -f "${SYSCONFDIR}/my.cnf" ] ; then
112 DATADIR=`"my_print_defaults${MY_SUFFIX}" mysqld 2>/dev/null | sed -ne '/datadir/s|^--datadir=||p' | tail -n1`
113 if [ -z "${DATADIR}" ]; then
114 DATADIR=`grep ^datadir "${SYSCONFDIR}/my.cnf" | sed -e 's/.*=\s*//'`
115 fi
116 fi
117 if [ -z "${DATADIR}" ]; then
118 DATADIR="${MY_LOCALSTATEDIR}"
119 einfo "Using default DATADIR"
120 fi
121 einfo "MySQL DATADIR is ${DATADIR}"
122
123 if [ -z "${PREVIOUS_DATADIR}" ] ; then
124 if [ -a "${DATADIR}" ] ; then
125 ewarn "Previous datadir found, it's YOUR job to change"
126 ewarn "ownership and have care of it"
127 PREVIOUS_DATADIR="yes"
128 export PREVIOUS_DATADIR
129 else
130 PREVIOUS_DATADIR="no"
131 export PREVIOUS_DATADIR
132 fi
133 fi
134 fi
135
136 export MY_SUFFIX MY_SHAREDSTATEDIR MY_SYSCONFDIR
137 export MY_LIBDIR MY_LOCALSTATEDIR MY_LOGDIR
138 export MY_INCLUDEDIR
139 export DATADIR
140}
141
142# void mysql_init_vars()
143# 91#
144# initialize global variables 92# initialize global variables
145# 2005-11-19 <vivo at gentoo.org> 93# 2005-11-19 <vivo at gentoo.org>
146mysql_strip_double_slash() { 94mysql_strip_double_slash() {
147 local path="${1}" 95 local path="${1}"

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.20