Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-commits
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "Benedikt Boehm (hollow)" <hollow@g.o>
Subject: gentoo-x86 commit in eclass: webapp.eclass
Date: Sat, 23 Feb 2008 23:54:41 +0000
hollow      08/02/23 23:54:41

  Modified:             webapp.eclass
  Log:
  make IUSE=vhosts optional

Revision  Changes    Path
1.59                 eclass/webapp.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.eclass?rev=1.59&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.eclass?rev=1.59&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.eclass?r1=1.58&r2=1.59

Index: webapp.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- webapp.eclass	22 Feb 2008 15:33:32 -0000	1.58
+++ webapp.eclass	23 Feb 2008 23:54:40 -0000	1.59
@@ -1,6 +1,6 @@
 # Copyright 1999-2006 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.58 2008/02/22 15:33:32 hollow Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.59 2008/02/23 23:54:40 hollow Exp $
 #
 # @ECLASS: webapp.eclass
 # @MAINTAINER:
@@ -10,8 +10,14 @@
 # The webapp eclass contains functions to handle web applications with
 # webapp-config. Part of the implementation of GLEP #11
 
+# @ECLASS-VARIABLE: WEBAPP_NO_AUTO_INSTALL
+# @DESCRIPTION:
+# An ebuild sets this to `yes' if an automatic installation and/or upgrade is
+# not possible. The ebuild should overwrite pkg_postinst() and explain the
+# reason for this BEFORE calling webapp_pkg_postinst().
+[[ "${WEBAPP_NO_AUTO_INSTALL}" == "yes" ]] || IUSE="vhosts"
+
 SLOT="${PVR}"
-IUSE="vhosts"
 DEPEND=">=app-admin/webapp-config-1.50.15"
 RDEPEND="${DEPEND}"
 
@@ -81,7 +87,10 @@
 
 webapp_getinstalltype() {
 	debug-print-function $FUNCNAME $*
-	use vhosts && return
+
+	if ! has vhosts ${IUSE} || use vhosts; then
+		return
+	fi
 
 	local my_output
 	my_output="$(webapp_check_installedat)"
@@ -344,7 +353,9 @@
 	local my_dir="${ROOT}${VHOST_ROOT}/${MY_HTDOCSBASE}/${PN}"
 
 	# if USE=vhosts is enabled OR no application is installed we're done here
-	use vhosts || [[ ! -d "${my_dir}" ]] && return
+	if ! has vhosts ${IUSE} || use vhosts || [[ ! -d "${my_dir}" ]]; then
+		return
+	fi
 
 	local my_output
 	my_output="$(webapp_check_installedat)"
@@ -442,37 +453,50 @@
 		die "Ebuild did not call webapp_src_install() - report to http://bugs.gentoo.org"
 	fi
 
-	if ! use vhosts; then
-		echo
-		elog "vhosts USE flag not set - auto-installing using webapp-config"
-
-		G_HOSTNAME="localhost"
-		webapp_read_config
-
-		local my_mode=-I
-		webapp_getinstalltype
+	if has vhosts ${IUSE}; then
+		if ! use vhosts; then
+			echo
+			elog "vhosts USE flag not set - auto-installing using webapp-config"
+
+			G_HOSTNAME="localhost"
+			webapp_read_config
+
+			local my_mode=-I
+			webapp_getinstalltype
+
+			if [[ "${IS_REPLACE}" == "1" ]]; then
+				elog "${PN}-${PVR} is already installed - replacing"
+				my_mode=-I
+			elif [[ "${IS_UPGRADE}" == "1" ]]; then
+				elog "${REMOVE_PKG} is already installed - upgrading"
+				my_mode=-U
+			else
+				elog "${PN}-${PVR} is not installed - using install mode"
+			fi
 
-		if [[ "${IS_REPLACE}" == "1" ]]; then
-			elog "${PN}-${PVR} is already installed - replacing"
-			my_mode=-I
-		elif [[ "${IS_UPGRADE}" == "1" ]]; then
-			elog "${REMOVE_PKG} is already installed - upgrading"
-			my_mode=-U
+			my_cmd="${WEBAPP_CONFIG} ${my_mode} -h localhost -u root -d ${INSTALL_DIR} ${PN} ${PVR}"
+			elog "Running ${my_cmd}"
+			${my_cmd}
+
+			echo
+			local cleaner="${WEBAPP_CLEANER} -p -C ${PN}"
+			einfo "Running ${cleaner}"
+			${cleaner}
 		else
-			elog "${PN}-${PVR} is not installed - using install mode"
+			elog
+			elog "The 'vhosts' USE flag is switched ON"
+			elog "This means that Portage will not automatically run webapp-config to"
+			elog "complete the installation."
+			elog
+			elog "To install ${PN}-${PVR} into a virtual host, run the following command:"
+			elog
+			elog "    webapp-config -I -h <host> -d ${PN} ${PN} ${PVR}"
+			elog
+			elog "For more details, see the webapp-config(8) man page"
 		fi
-
-		my_cmd="${WEBAPP_CONFIG} ${my_mode} -h localhost -u root -d ${INSTALL_DIR} ${PN} ${PVR}"
-		elog "Running ${my_cmd}"
-		${my_cmd}
-
-		echo
-		local cleaner="${WEBAPP_CLEANER} -p -C ${PN}"
-		einfo "Running ${cleaner}"
-		${cleaner}
 	else
 		elog
-		elog "The 'vhosts' USE flag is switched ON"
+		elog "This ebuild does not support the 'vhosts' USE flag."
 		elog "This means that Portage will not automatically run webapp-config to"
 		elog "complete the installation."
 		elog
@@ -497,7 +521,7 @@
 	[[ $? -ne 0 ]] && return
 
 	local x
-	if ! use vhosts; then
+	if has vhosts ${IUSE} && ! use vhosts; then
 		echo "${my_output}" | while read x; do
 			if [[ -f "${x}"/.webapp ]]; then
 				. "${x}"/.webapp



-- 
gentoo-commits@g.o mailing list


Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
gentoo-x86 commit in eclass: webapp.eclass
Next by thread:
gentoo-x86 commit in eclass: webapp.eclass
Previous by date:
portage r9375 - in main/branches/prefix: bin pym/_emerge pym/portage pym/portage/dbapi pym/portage/sets pym/repoman
Next by date:
gentoo-x86 commit in www-apps/twiki: metadata.xml twiki-4.1.2.ebuild ChangeLog twiki-4.2.0.ebuild


Updated Jul 06, 2010

Summary: Archive of the gentoo-commits mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.