From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1JT4CZ-0002ib-Vl for garchives@archives.gentoo.org; Sat, 23 Feb 2008 23:54:44 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1C70CE0381; Sat, 23 Feb 2008 23:54:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id C9991E0381 for ; Sat, 23 Feb 2008 23:54:42 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 578BEB4A11 for ; Sat, 23 Feb 2008 23:54:42 +0000 (UTC) Received: from hollow by stork.gentoo.org with local (Exim 4.68) (envelope-from ) id 1JT4CX-0002b9-6N for gentoo-commits@lists.gentoo.org; Sat, 23 Feb 2008 23:54:41 +0000 From: "Benedikt Boehm (hollow)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, hollow@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in eclass: webapp.eclass X-VCS-Repository: gentoo-x86 X-VCS-Files: webapp.eclass X-VCS-Directories: eclass X-VCS-Committer: hollow X-VCS-Committer-Name: Benedikt Boehm Content-Type: text/plain; charset=utf8 Message-Id: Sender: Benedikt Boehm Date: Sat, 23 Feb 2008 23:54:41 +0000 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 88cf5184-0fdb-4b6d-a908-fb0a62cea00d X-Archives-Hash: e39dc53cee1c814d43d3cb10aa2b7ddb hollow 08/02/23 23:54:41 Modified: webapp.eclass Log: make IUSE=3Dvhosts optional Revision Changes Path 1.59 eclass/webapp.eclass file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.ecla= ss?rev=3D1.59&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.ecla= ss?rev=3D1.59&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.ecla= ss?r1=3D1.58&r2=3D1.59 Index: webapp.eclass =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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/2= 2 15:33:32 hollow Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.59 2008/02/2= 3 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 =20 +# @ECLASS-VARIABLE: WEBAPP_NO_AUTO_INSTALL +# @DESCRIPTION: +# An ebuild sets this to `yes' if an automatic installation and/or upgra= de is +# not possible. The ebuild should overwrite pkg_postinst() and explain t= he +# reason for this BEFORE calling webapp_pkg_postinst(). +[[ "${WEBAPP_NO_AUTO_INSTALL}" =3D=3D "yes" ]] || IUSE=3D"vhosts" + SLOT=3D"${PVR}" -IUSE=3D"vhosts" DEPEND=3D">=3Dapp-admin/webapp-config-1.50.15" RDEPEND=3D"${DEPEND}" =20 @@ -81,7 +87,10 @@ =20 webapp_getinstalltype() { debug-print-function $FUNCNAME $* - use vhosts && return + + if ! has vhosts ${IUSE} || use vhosts; then + return + fi =20 local my_output my_output=3D"$(webapp_check_installedat)" @@ -344,7 +353,9 @@ local my_dir=3D"${ROOT}${VHOST_ROOT}/${MY_HTDOCSBASE}/${PN}" =20 # if USE=3Dvhosts 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 =20 local my_output my_output=3D"$(webapp_check_installedat)" @@ -442,37 +453,50 @@ die "Ebuild did not call webapp_src_install() - report to http://bugs.= gentoo.org" fi =20 - if ! use vhosts; then - echo - elog "vhosts USE flag not set - auto-installing using webapp-config" - - G_HOSTNAME=3D"localhost" - webapp_read_config - - local my_mode=3D-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=3D"localhost" + webapp_read_config + + local my_mode=3D-I + webapp_getinstalltype + + if [[ "${IS_REPLACE}" =3D=3D "1" ]]; then + elog "${PN}-${PVR} is already installed - replacing" + my_mode=3D-I + elif [[ "${IS_UPGRADE}" =3D=3D "1" ]]; then + elog "${REMOVE_PKG} is already installed - upgrading" + my_mode=3D-U + else + elog "${PN}-${PVR} is not installed - using install mode" + fi =20 - if [[ "${IS_REPLACE}" =3D=3D "1" ]]; then - elog "${PN}-${PVR} is already installed - replacing" - my_mode=3D-I - elif [[ "${IS_UPGRADE}" =3D=3D "1" ]]; then - elog "${REMOVE_PKG} is already installed - upgrading" - my_mode=3D-U + my_cmd=3D"${WEBAPP_CONFIG} ${my_mode} -h localhost -u root -d ${INSTA= LL_DIR} ${PN} ${PVR}" + elog "Running ${my_cmd}" + ${my_cmd} + + echo + local cleaner=3D"${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-confi= g 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 -d ${PN} ${PN} ${PVR}" + elog + elog "For more details, see the webapp-config(8) man page" fi - - my_cmd=3D"${WEBAPP_CONFIG} ${my_mode} -h localhost -u root -d ${INSTAL= L_DIR} ${PN} ${PVR}" - elog "Running ${my_cmd}" - ${my_cmd} - - echo - local cleaner=3D"${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 =20 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 --=20 gentoo-commits@lists.gentoo.org mailing list