summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorLuca Longinotti <chtekk@gentoo.org>2007-05-12 02:28:51 +0000
committerLuca Longinotti <chtekk@gentoo.org>2007-05-12 02:28:51 +0000
commit1829849dd64368b03be69e3d35648ef4b33731ad (patch)
tree588d25a7b14476bf195bd6fff0c253fbdf0ccd19 /eclass
parentMove from kernel to kernel-misc herd (diff)
downloadhistorical-1829849dd64368b03be69e3d35648ef4b33731ad.tar.gz
historical-1829849dd64368b03be69e3d35648ef4b33731ad.tar.bz2
historical-1829849dd64368b03be69e3d35648ef4b33731ad.zip
Update for Apache 1.X masking.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/apache-module.eclass148
-rw-r--r--eclass/depend.apache.eclass118
2 files changed, 114 insertions, 152 deletions
diff --git a/eclass/apache-module.eclass b/eclass/apache-module.eclass
index 610fea3d5cd9..6fbbc3c81459 100644
--- a/eclass/apache-module.eclass
+++ b/eclass/apache-module.eclass
@@ -1,7 +1,6 @@
-# Copyright 2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License, v2 or later
-# Author Michael Tindal <urilith@gentoo.org>
-# $Header: /var/cvsroot/gentoo-x86/eclass/apache-module.eclass,v 1.18 2006/11/26 21:25:28 vericgar Exp $
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/apache-module.eclass,v 1.19 2007/05/12 02:28:51 chtekk Exp $
inherit depend.apache
@@ -9,7 +8,7 @@ inherit depend.apache
# NOTE: If you use this, be sure you use the need_* call after you have
# defined DEPEND and RDEPEND. Also note that you can not rely on the
-# automatic RDEPEND=DEPEND that portage does if you use this eclass.
+# automatic RDEPEND=DEPEND that Portage does if you use this eclass.
# See bug 107127 for more information.
######
@@ -78,15 +77,15 @@ DOCFILES=""
apache_cd_dir() {
debug-print-function $FUNCNAME $*
- if [ "${APACHE_VERSION}" == "1" ]; then
- [ -n "${APXS1_S}" ] && CD_DIR="${APXS1_S}"
+ if [[ "${APACHE_VERSION}" == "1" ]] ; then
+ [[ -n "${APXS1_S}" ]] && CD_DIR="${APXS1_S}"
else
- [ -n "${APXS2_S}" ] && CD_DIR="${APXS2_S}"
+ [[ -n "${APXS2_S}" ]] && CD_DIR="${APXS2_S}"
fi
- # XXX - is this really needed? can't we just return ${S}?
- if [ -z "${CD_DIR}" ]; then
- if [ -d ${S}/src ] ; then
+ # XXX - Is this really needed? Can't we just return ${S}?
+ if [[ -z "${CD_DIR}" ]] ; then
+ if [[ -d "${S}/src" ]] ; then
CD_DIR="${S}/src"
else
CD_DIR="${S}"
@@ -94,7 +93,7 @@ apache_cd_dir() {
fi
debug-print apache_cd_dir: "CD_DIR=${CD_DIR}"
- echo ${CD_DIR}
+ echo "${CD_DIR}"
}
####
@@ -105,22 +104,22 @@ apache_cd_dir() {
apache_mod_file() {
debug-print-function $FUNCNAME $*
- if [ "${APACHE_VERSION}" == "1" ]; then
- [ -n "${APACHE1_MOD_FILE}" ] && MOD_FILE="${APACHE1_MOD_FILE}"
- [ -z "${MOD_FILE}" ] && MOD_FILE="$(apache_cd_dir)/${PN}.so"
+ if [[ "${APACHE_VERSION}" == "1" ]] ; then
+ [[ -n "${APACHE1_MOD_FILE}" ]] && MOD_FILE="${APACHE1_MOD_FILE}"
+ [[ -z "${MOD_FILE}" ]] && MOD_FILE="$(apache_cd_dir)/${PN}.so"
else
- [ -n "${APACHE2_MOD_FILE}" ] && MOD_FILE="${APACHE2_MOD_FILE}"
- [ -z "${MOD_FILE}" ] && MOD_FILE="$(apache_cd_dir)/.libs/${PN}.so"
+ [[ -n "${APACHE2_MOD_FILE}" ]] && MOD_FILE="${APACHE2_MOD_FILE}"
+ [[ -z "${MOD_FILE}" ]] && MOD_FILE="$(apache_cd_dir)/.libs/${PN}.so"
fi
- debug-print apache_mod_file: MOD_FILE=${MOD_FILE}
- echo ${MOD_FILE}
+ debug-print apache_mod_file: "MOD_FILE=${MOD_FILE}"
+ echo "${MOD_FILE}"
}
####
## apache_doc_magic
##
-## Some magic for picking out html files from ${DOCFILES}. It takes
+## Some magic for picking out html files from ${DOCFILES}. It takes
## an optional first argument `html'; if the first argument is equals
## `html', only html files are returned, otherwise normal (non-html)
## docs are returned.
@@ -128,27 +127,24 @@ apache_mod_file() {
apache_doc_magic() {
debug-print-function $FUNCNAME $*
- if [ -n "${DOCFILES}" ]; then
- if [ "x$1" == "xhtml" ]; then
+ if [[ -n "${DOCFILES}" ]] ; then
+ if [[ "x$1" == "xhtml" ]] ; then
DOCS="`echo ${DOCFILES} | sed -e 's/ /\n/g' | sed -e '/^[^ ]*.html$/ !d'`"
else
DOCS="`echo ${DOCFILES} | sed 's, *[^ ]*\+.html, ,g'`"
fi
- debug-print apache_doc_magic: DOCS=${DOCS}
- echo ${DOCS}
+ debug-print apache_doc_magic: "DOCS=${DOCS}"
+ echo "${DOCS}"
fi
}
######
-## Apache 1.x ebuild functions
+## Apache 1.x ebuild functions - !!! DEPRECATED !!!
######
####
-## apache1_src_compile
-## The default action is to call ${APXS11} with the value of
-## ${APXS1_ARGS}. If a module requires a different build setup
-## than this, use ${APXS1} in your own src_compile routine.
+## apache1_src_compile - !!! DEPRECATED !!!
####
apache1_src_compile() {
debug-print-function $FUNCNAME $*
@@ -160,16 +156,7 @@ apache1_src_compile() {
}
####
-## apache1_src_install
-##
-## This installs the files into apache's directories. The module is installed
-## from a directory chosen as above (APXS2_S or ${S}/src). In addition,
-## this function can also set the executable permission on files listed in EXECFILES.
-## The configuration file name is listed in APACHE1_MOD_CONF without the .conf extensions,
-## so if you configuration is 55_mod_foo.conf, APACHE1_MOD_CONF would be 55_mod_foo.
-## DOCFILES contains the list of files you want filed as documentation. The name of the
-## module can also be specified using the APACHE1_MOD_FILE or defaults to
-## .libs/${PN}.so.
+## apache1_src_install - !!! DEPRECATED !!!
####
apache1_src_install() {
debug-print-function $FUNCNAME $*
@@ -200,9 +187,7 @@ apache1_src_install() {
}
####
-## apache1_pkg_postinst
-##
-## Prints the standard config message, unless APACHE1_NO_CONFIG is set to yes.
+## apache1_pkg_postinst - !!! DEPRECATED !!!
####
apache1_pkg_postinst() {
debug-print-function $FUNCNAME $*
@@ -218,7 +203,7 @@ apache1_pkg_postinst() {
if [ -n "${APACHE1_MOD_CONF}" ] ; then
einfo
einfo "Configuration file installed as"
- einfo " ${APACHE1_MODULES_CONFDIR}/$(basename ${APACHE1_MOD_CONF}).conf"
+ einfo " ${APACHE1_MODULES_CONFDIR}/$(basename ${APACHE1_MOD_CONF}).conf"
einfo "You may want to edit it before turning the module on in /etc/conf.d/apache"
einfo
fi
@@ -231,46 +216,43 @@ apache1_pkg_postinst() {
####
## apache2_pkg_setup
##
-## Checks to see if APACHE2_MT_UNSAFE is set to anything other than "no". If it is, then
+## Checks to see if APACHE2_MT_UNSAFE is set to anything other than "no". If it is, then
## we check what the MPM style used by Apache is, if it isnt prefork, we let the user
## know they need prefork, and then exit the build.
####
apache2_pkg_setup() {
debug-print-function $FUNCNAME $*
- if [ -n "${APACHE2_SAFE_MPMS}" ]; then
-
+ if [[ -n "${APACHE2_SAFE_MPMS}" ]] ; then
INSTALLED_MPM="$(${ROOT}/usr/sbin/apxs2 -q MPM_NAME)"
if hasq ${INSTALLED_MPM} ${APACHE2_SAFE_MPMS} ; then
INSTALLED_MPM_SAFE="yes"
fi
- if [ -z "${INSTALLED_MPM_SAFE}" ] ; then
+ if [[ -z "${INSTALLED_MPM_SAFE}" ]] ; then
eerror "The module you are trying to install (${PN})"
eerror "will only work with one of the following MPMs:"
- eerror " ${APACHE2_SAFE_MPMS}"
+ eerror " ${APACHE2_SAFE_MPMS}"
eerror "You do not currently have any of these MPMs installed."
eerror "Please re-install apache with the correct mpm-* USE flag set."
die "No safe MPM installed."
fi
-
fi
-
}
####
## apache2_src_compile
##
## The default action is to call ${APXS2} with the value of
-## ${APXS2_ARGS}. If a module requires a different build setup
+## ${APXS2_ARGS}. If a module requires a different build setup
## than this, use ${APXS2} in your own src_compile routine.
####
apache2_src_compile() {
debug-print-function $FUNCNAME $*
CD_DIR=$(apache_cd_dir)
- cd ${CD_DIR} || die "cd ${CD_DIR} failed"
+ cd "${CD_DIR}" || die "cd ${CD_DIR} failed"
APXS2_ARGS="${APXS2_ARGS:--c ${PN}.c}"
${APXS2} ${APXS2_ARGS} || die "${APXS2} ${APXS2_ARGS} failed"
}
@@ -278,8 +260,8 @@ apache2_src_compile() {
####
## apache2_src_install
##
-## This installs the files into apache's directories. The module is installed
-## from a directory chosen as above (APXS2_S or ${S}/src). In addition,
+## This installs the files into apache's directories. The module is installed
+## from a directory chosen as above (APXS2_S or ${S}/src). In addition,
## this function can also set the executable permission on files listed in EXECFILES.
## The configuration file name is listed in CONFFILE without the .conf extensions,
## so if you configuration is 55_mod_foo.conf, CONFFILE would be 55_mod_foo.
@@ -289,39 +271,39 @@ apache2_src_install() {
debug-print-function $FUNCNAME $*
CD_DIR=$(apache_cd_dir)
- cd ${CD_DIR} || die "cd ${CD_DIR} failed"
+ cd "${CD_DIR}" || die "cd ${CD_DIR} failed"
MOD_FILE=$(apache_mod_file)
- exeinto ${APACHE2_MODULESDIR}
+ exeinto "${APACHE2_MODULESDIR}"
doexe ${MOD_FILE} || die "internal ebuild error: '${MOD_FILE}' not found"
- [ -n "${APACHE2_EXECFILES}" ] && doexe ${APACHE2_EXECFILES}
+ [[ -n "${APACHE2_EXECFILES}" ]] && doexe ${APACHE2_EXECFILES}
- if [ -n "${APACHE2_MOD_CONF}" ] ; then
- insinto ${APACHE2_MODULES_CONFDIR}
- doins ${FILESDIR}/${APACHE2_MOD_CONF}.conf || die "internal ebuild error: '${FILESDIR}/${APACHE2_MOD_CONF}.conf' not found."
+ if [[ -n "${APACHE2_MOD_CONF}" ]] ; then
+ insinto "${APACHE2_MODULES_CONFDIR}"
+ doins "${FILESDIR}/${APACHE2_MOD_CONF}.conf" || die "internal ebuild error: '${FILESDIR}/${APACHE2_MOD_CONF}.conf' not found"
fi
- if [ -n "${APACHE2_VHOSTFILE}" ]; then
- insinto ${APACHE2_VHOSTDIR}
- doins ${FILESDIR}/${APACHE2_VHOSTFILE}.conf
+ if [[ -n "${APACHE2_VHOSTFILE}" ]] ; then
+ insinto "${APACHE2_VHOSTDIR}"
+ doins "${FILESDIR}/${APACHE2_VHOSTFILE}.conf" || die "internal ebuild error: '${FILESDIR}/${APACHE2_VHOSTFILE}.conf' not found"
fi
- cd ${S}
+ cd "${S}"
- if [ -n "${DOCFILES}" ] ; then
+ if [[ -n "${DOCFILES}" ]] ; then
OTHER_DOCS=$(apache_doc_magic)
HTML_DOCS=$(apache_doc_magic html)
- [ -n "${OTHER_DOCS}" ] && dodoc ${OTHER_DOCS}
- [ -n "${HTML_DOCS}" ] && dohtml ${HTML_DOCS}
+ [[ -n "${OTHER_DOCS}" ]] && dodoc ${OTHER_DOCS}
+ [[ -n "${HTML_DOCS}" ]] && dohtml ${HTML_DOCS}
fi
}
apache2_pkg_postinst() {
debug-print-function $FUNCNAME $*
- if [ -n "${APACHE2_MOD_DEFINE}" ]; then
+ if [[ -n "${APACHE2_MOD_DEFINE}" ]] ; then
local my_opts="-D ${APACHE2_MOD_DEFINE// / -D }"
einfo
@@ -329,7 +311,8 @@ apache2_pkg_postinst() {
einfo "add '${my_opts}' to APACHE2_OPTS."
einfo
fi
- if [ -n "${APACHE2_MOD_CONF}" ] ; then
+
+ if [[ -n "${APACHE2_MOD_CONF}" ]] ; then
einfo
einfo "Configuration file installed as"
einfo " ${APACHE2_MODULES_CONFDIR}/$(basename ${APACHE2_MOD_CONF}).conf"
@@ -337,8 +320,7 @@ apache2_pkg_postinst() {
einfo
fi
- if [ -n "${APACHE2_SAFE_MPMS}" ]; then
-
+ if [[ -n "${APACHE2_SAFE_MPMS}" ]] ; then
INSTALLED_MPM="$(${ROOT}/usr/sbin/apxs2 -q MPM_NAME)"
if ! hasq ${INSTALLED_MPM} ${APACHE2_SAFE_MPMS} ; then
@@ -347,30 +329,28 @@ apache2_pkg_postinst() {
INSTALLED_MPM_SAFE="${INSTALLED_MPM_SAFE} ${mpm}"
fi
- if [ -n "${INSTALLED_MPM_UNSAFE}" ] ; then
+ if [[ -n "${INSTALLED_MPM_UNSAFE}" ]] ; then
ewarn "You have one or more MPMs installed that will not work with"
ewarn "this module (${PN}). Please make sure that you only enable"
ewarn "this module if you are using one of the following MPMs:"
- ewarn " ${INSTALLED_MPM_SAFE}"
+ ewarn " ${INSTALLED_MPM_SAFE}"
fi
-
fi
-
}
######
-## Apache dual (1.x or 2.x) ebuild functions
+## Apache dual (1.x or 2.x) ebuild functions - Apache 1.X DEPRECATED!
##
-## This is where the magic happens. We provide dummy routines of all of the functions
-## provided by all of the specifics. We use APACHE_ECLASS_VER_* to see which versions
-## to call. If a function is provided by a given section (ie pkg_postinst in Apache 2.x)
+## This is where the magic happens. We provide dummy routines of all of the functions
+## provided by all of the specifics. We use APACHE_ECLASS_VER_* to see which versions
+## to call. If a function is provided by a given section (ie pkg_postinst in Apache 2.x)
## the exported routine simply does nothing.
######
apache-module_pkg_setup() {
debug-print-function $FUNCNAME $*
- if [ ${APACHE_VERSION} -eq '2' ]; then
+ if [[ ${APACHE_VERSION} -eq "2" ]] ; then
apache2_pkg_setup
fi
}
@@ -378,7 +358,7 @@ apache-module_pkg_setup() {
apache-module_src_compile() {
debug-print-function $FUNCNAME $*
- if [ ${APACHE_VERSION} -eq '1' ]; then
+ if [[ ${APACHE_VERSION} -eq "1" ]] ; then
apache1_src_compile
else
apache2_src_compile
@@ -388,7 +368,7 @@ apache-module_src_compile() {
apache-module_src_install() {
debug-print-function $FUNCNAME $*
- if [ ${APACHE_VERSION} -eq '1' ]; then
+ if [[ ${APACHE_VERSION} -eq "1" ]] ; then
apache1_src_install
else
apache2_src_install
@@ -398,7 +378,7 @@ apache-module_src_install() {
apache-module_pkg_postinst() {
debug-print-function $FUNCNAME $*
- if [ ${APACHE_VERSION} -eq '1' ]; then
+ if [[ ${APACHE_VERSION} -eq "1" ]] ; then
apache1_pkg_postinst
else
apache2_pkg_postinst
@@ -406,5 +386,3 @@ apache-module_pkg_postinst() {
}
EXPORT_FUNCTIONS pkg_setup src_compile src_install pkg_postinst
-
-# vim:ts=4
diff --git a/eclass/depend.apache.eclass b/eclass/depend.apache.eclass
index 7ce0b8e3eb45..ad9e6104a4da 100644
--- a/eclass/depend.apache.eclass
+++ b/eclass/depend.apache.eclass
@@ -1,6 +1,6 @@
-# Copyright 1999-2005 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.29 2007/01/01 22:27:01 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/depend.apache.eclass,v 1.30 2007/05/12 02:28:51 chtekk Exp $
inherit multilib
@@ -23,11 +23,11 @@ inherit multilib
####
## APACHE_VERSION
##
-## Stores the version of apache we are going to be ebuilding. This variable is
+## Stores the version of apache we are going to be ebuilding. This variable is
## set by the need_apache{|1|2} functions.
##
####
-#APACHE_VERSION='2'
+#APACHE_VERSION="2"
####
## APXS1, APXS2
@@ -56,8 +56,7 @@ APACHE2_BASEDIR="/usr/$(get_libdir)/apache2"
####
## APACHE1_CONFDIR, APACHE2_CONFDIR
##
-## Paths to the configuration file directories (usually under
-## $APACHE?_BASEDIR/conf)
+## Paths to the configuration file directories
####
APACHE1_CONFDIR="/etc/apache"
APACHE2_CONFDIR="/etc/apache2"
@@ -90,7 +89,7 @@ APACHE2_MODULESDIR="${APACHE2_BASEDIR}/modules"
## APACHE1_DEPEND, APACHE2_DEPEND
## APACHE2_0_DEPEND, APACHE2_2_DEPEND
##
-## Dependencies for apache 1.x and apache 2.x
+## Dependencies for Apache 1.x and Apache 2.x
####
APACHE1_DEPEND="=net-www/apache-1*"
APACHE2_DEPEND="=net-www/apache-2*"
@@ -105,21 +104,19 @@ APACHE2_2_DEPEND="=net-www/apache-2.2*"
####
NEED_APACHE_DEPEND="apache2? ( ${APACHE2_DEPEND} ) !apache2? ( ${APACHE1_DEPEND} )"
-WANT_APACHE_DEPEND="apache2? ( ${APACHE2_DEPEND} ) !apache2? ( apache? ( ${APACHE1_DEPEND} ) )"
+WANT_APACHE_DEPEND="apache2? ( ${APACHE2_DEPEND} )"
####
-# uses_apache1()
-#
-# sets up all of the environment variables required by an apache1 module
+# uses_apache1() - !!! DEPRECATED !!!
####
uses_apache1() {
debug-print-function $FUNCNAME $*
# WARNING: Do not use these variables with anything that is put
# into the dependency cache (DEPEND/RDEPEND/etc)
- APACHE_VERSION='1'
- APXS="$APXS1"
- USE_APACHE2=
+ APACHE_VERSION="1"
+ APXS="${APXS1}"
+ USE_APACHE2=""
APACHECTL="${APACHECTL1}"
APACHE_BASEDIR="${APACHE1_BASEDIR}"
APACHE_CONFDIR="${APACHE1_CONFDIR}"
@@ -138,9 +135,9 @@ uses_apache2() {
debug-print-function $FUNCNAME $*
# WARNING: Do not use these variables with anything that is put
# into the dependency cache (DEPEND/RDEPEND/etc)
- APACHE_VERSION='2'
- USE_APACHE2=2
- APXS="$APXS2"
+ APACHE_VERSION="2"
+ USE_APACHE2="2"
+ APXS="${APXS2}"
APACHECTL="${APACHECTL2}"
APACHE_BASEDIR="${APACHE2_BASEDIR}"
APACHE_CONFDIR="${APACHE2_CONFDIR}"
@@ -151,34 +148,28 @@ uses_apache2() {
doesnt_use_apache() {
debug-print-function $FUNCNAME $*
- APACHE_VERSION='0'
- USE_APACHE=
+ APACHE_VERSION="0"
+ USE_APACHE=""
}
####
-## need_apache1
-##
-## An ebuild calls this to get the dependency information
-## for apache-1.x. An ebuild should use this in order for
-## future changes to the build infrastructure to happen
-## seamlessly. All an ebuild needs to do is include the
-## line need_apache1 somewhere.
+## need_apache1 - !!! DEPRECATED !!!
####
need_apache1() {
debug-print-function $FUNCNAME $*
DEPEND="${DEPEND} ${APACHE1_DEPEND}"
RDEPEND="${RDEPEND} ${APACHE1_DEPEND}"
- APACHE_VERSION='1'
+ APACHE_VERSION="1"
}
####
## need_apache2
##
## An ebuild calls this to get the dependency information
-## for apache-2.x. An ebuild should use this in order for
+## for apache-2.x. An ebuild should use this in order for
## future changes to the build infrastructure to happen
-## seamlessly. All an ebuild needs to do is include the
+## seamlessly. All an ebuild needs to do is include the
## line need_apache2 somewhere.
####
need_apache2() {
@@ -186,7 +177,7 @@ need_apache2() {
DEPEND="${DEPEND} ${APACHE2_DEPEND}"
RDEPEND="${RDEPEND} ${APACHE2_DEPEND}"
- APACHE_VERSION='2'
+ APACHE_VERSION="2"
}
####
@@ -194,7 +185,7 @@ need_apache2() {
##
## Works like need_apache2 above, but its used by modules
## that only support apache 2.0 and do not work with
-## higher versions
+## higher versions.
##
####
need_apache2_0() {
@@ -202,14 +193,15 @@ need_apache2_0() {
DEPEND="${DEPEND} ${APACHE2_0_DEPEND}"
RDEPEND="${RDEPEND} ${APACHE2_0_DEPEND}"
- APACHE_VERSION='2'
+ APACHE_VERSION="2"
}
####
## need_apache2_2
##
## Works like need_apache2 above, but its used by modules
-## that only support apache 2.2.
+## that only support apache 2.2 and do not work with
+## lower versions.
##
####
need_apache2_2() {
@@ -217,13 +209,12 @@ need_apache2_2() {
DEPEND="${DEPEND} ${APACHE2_2_DEPEND}"
RDEPEND="${RDEPEND} ${APACHE2_2_DEPEND}"
- APACHE_VERSION='2'
+ APACHE_VERSION="2"
}
####
## DO NOT CHANGE THIS FUNCTION UNLESS YOU UNDERSTAND THE CONSEQUENCES IT
-## WILL HAVE ON THE CACHE! There MUST be a apache2? () block in DEPEND for
-## things to work correct in the dependency calculation stage.
+## WILL HAVE ON THE CACHE!
##
## This function can take a variable amount of arguments specifying the
## versions of apache the ebuild supports
@@ -239,23 +230,23 @@ need_apache() {
local supports13 supports20 supports22 supports2x
- if [ $# -eq 0 ]; then
- supports13=yes
- supports2x=yes
+ if [[ $# -eq 0 ]] ; then
+ supports13="yes"
+ supports2x="yes"
else
- while [ $# -gt 0 ]; do
+ while [[ $# -gt 0 ]] ; do
case "$1" in
- 1.3) supports13=yes; shift;;
- 2.0) supports20=yes; shift;;
- 2.2) supports22=yes; shift;;
- 2.x) supports2x=yes; shift;;
- *) die "Unknown version specifier: $1";;
+ 1.3) supports13="yes"; shift;;
+ 2.0) supports20="yes"; shift;;
+ 2.2) supports22="yes"; shift;;
+ 2.x) supports2x="yes"; shift;;
+ *) die "Unknown version specifier: $1";;
esac
done
fi
- if [[ "${supports20}" == "yes" && "${supports22}" == "yes" ]]; then
- supports2x=yes;
+ if [[ "${supports20}" == "yes" ]] && [[ "${supports22}" == "yes" ]] ; then
+ supports2x="yes";
fi
debug-print "supports13: ${supports13}"
@@ -263,28 +254,24 @@ need_apache() {
debug-print "supports22: ${supports22}"
debug-print "supports2x: ${supports2x}"
- if [ "${supports13}" != "yes" ]; then
- if [ "${supports2x}" == "yes" ]; then
+ if [[ "${supports13}" != "yes" ]] ; then
+ if [[ "${supports2x}" == "yes" ]] ; then
need_apache2
- elif [ "${supports20}" == "yes" ]; then
+ elif [[ "${supports20}" == "yes" ]] ; then
need_apache2_0
- elif [ "${supports22}" == "yes" ]; then
+ elif [[ "${supports22}" == "yes" ]] ; then
need_apache2_2
fi
- elif [ "${supports13}" == "yes" ]; then
- if [[ "${supports2x}" == "yes" ||
- "${supports20}" == "yes" ||
- "${supports22}" == "yes" ]]; then
-
- # we support both apache-1.3 and apache-2.*, set up USE-flag based
+ elif [[ "${supports13}" == "yes" ]] ; then
+ if [[ "${supports2x}" == "yes" || "${supports20}" == "yes" || "${supports22}" == "yes" ]] ; then
+ # We support both apache-1.3 and apache-2.*, set up USE-flag based
# DEPEND and RDEPEND, determined by which apache-2.x we support
-
IUSE="${IUSE} apache2"
- if [ "${supports2x}" != "yes" ]; then
- if [ "${supports20}" == "yes" ]; then
+ if [[ "${supports2x}" != "yes" ]] ; then
+ if [[ "${supports20}" == "yes" ]] ; then
NEED_APACHE_DEPEND="apache2? ( ${APACHE2_0_DEPEND} ) !apache2? ( ${APACHE1_DEPEND} )"
- elif [ "${supports22}" == "yes" ]; then
+ elif [[ "${supports22}" == "yes" ]] ; then
NEED_APACHE_DEPEND="apache2? ( ${APACHE2_2_DEPEND} ) !apache2? ( ${APACHE1_DEPEND} )"
fi
fi
@@ -292,7 +279,7 @@ need_apache() {
DEPEND="${DEPEND} ${NEED_APACHE_DEPEND}"
RDEPEND="${RDEPEND} ${NEED_APACHE_DEPEND}"
- if useq apache2; then
+ if use apache2 ; then
uses_apache2
else
uses_apache1
@@ -301,19 +288,16 @@ need_apache() {
need_apache1
fi
fi
-
}
want_apache() {
debug-print-function $FUNCNAME $*
- IUSE="${IUSE} apache apache2"
+ IUSE="${IUSE} apache2"
DEPEND="${DEPEND} ${WANT_APACHE_DEPEND}"
RDEPEND="${RDEPEND} ${WANT_APACHE_DEPEND}"
- if useq apache2 ; then
+ if use apache2 ; then
uses_apache2
- elif useq apache ; then
- uses_apache1
else
doesnt_use_apache
fi