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 1JSYry-0003aC-39 for garchives@archives.gentoo.org; Fri, 22 Feb 2008 14:27:22 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EF815E028D; Fri, 22 Feb 2008 14:27:20 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id A5A69E028D for ; Fri, 22 Feb 2008 14:27:20 +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 35F0B66724 for ; Fri, 22 Feb 2008 14:27:20 +0000 (UTC) Received: from hollow by stork.gentoo.org with local (Exim 4.68) (envelope-from ) id 1JSYru-00045b-IX for gentoo-commits@lists.gentoo.org; Fri, 22 Feb 2008 14:27:18 +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: Fri, 22 Feb 2008 14:27:18 +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: 40089a9f-74ca-46e6-82f6-75a9c7020494 X-Archives-Hash: ae6749cc919f30a6aff914fa0fd1f6ef hollow 08/02/22 14:27:18 Modified: webapp.eclass Log: get rid of too much indention; consistency cleanup Revision Changes Path 1.54 eclass/webapp.eclass file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.ecla= ss?rev=3D1.54&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.ecla= ss?rev=3D1.54&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.ecla= ss?r1=3D1.53&r2=3D1.54 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.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- webapp.eclass 22 Feb 2008 14:06:05 -0000 1.53 +++ webapp.eclass 22 Feb 2008 14:27:17 -0000 1.54 @@ -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.53 2008/02/2= 2 14:06:05 hollow Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.54 2008/02/2= 2 14:27:17 hollow Exp $ # # @ECLASS: webapp.eclass # @MAINTAINER: @@ -80,35 +80,33 @@ =20 webapp_getinstalltype() { debug-print-function $FUNCNAME $* + use vhosts && return =20 - if ! use vhosts; then - local my_output + local my_output + my_output=3D"$(webapp_check_installedat)" + + if [[ $? -eq 0 ]]; then + # something is already installed there + # make sure it isn't the same version + + local my_pn=3D"$(echo ${my_output} | awk '{ print $1 }')" + local my_pvr=3D"$(echo ${my_output} | awk '{ print $2 }')" =20 - my_output=3D"$(webapp_check_installedat)" + REMOVE_PKG=3D"${my_pn}-${my_pvr}" =20 - if [[ $? -eq 0 ]]; then - # something is already installed there - # make sure it isn't the same version - - local my_pn=3D"$(echo ${my_output} | awk '{ print $1 }')" - local my_pvr=3D"$(echo ${my_output} | awk '{ print $2 }')" - - REMOVE_PKG=3D"${my_pn}-${my_pvr}" - - if [[ "${my_pn}" =3D=3D "${PN}" ]]; then - if [[ "${my_pvr}" !=3D "${PVR}" ]]; then - elog "This is an upgrade" - IS_UPGRADE=3D1 - else - elog "This is a re-installation" - IS_REPLACE=3D1 - fi + if [[ "${my_pn}" =3D=3D "${PN}" ]]; then + if [[ "${my_pvr}" !=3D "${PVR}" ]]; then + elog "This is an upgrade" + IS_UPGRADE=3D1 else - elog "${my_output} is installed there" + elog "This is a re-installation" + IS_REPLACE=3D1 fi else - elog "This is an installation" + elog "${my_output} is installed there" fi + else + elog "This is an installation" fi } =20 @@ -123,15 +121,15 @@ webapp_configfile() { debug-print-function $FUNCNAME $* =20 - local m=3D"" + local m for m in "$@"; do webapp_checkfileexists "${m}" "${D}" =20 - local MY_FILE=3D"$(webapp_strip_appdir "${m}")" - MY_FILE=3D"$(webapp_strip_cwd "${MY_FILE}")" + local my_file=3D"$(webapp_strip_appdir "${m}")" + my_file=3D"$(webapp_strip_cwd "${my_file}")" =20 - elog "(config) ${MY_FILE}" - echo "${MY_FILE}" >> ${D}/${WA_CONFIGLIST} + elog "(config) ${my_file}" + echo "${my_file}" >> ${D}/${WA_CONFIGLIST} done } =20 @@ -185,29 +183,28 @@ webapp_serverowned() { debug-print-function $FUNCNAME $* =20 - local a=3D"" - local m=3D"" + local a m if [[ "${1}" =3D=3D "-R" ]]; then shift for m in "$@"; do for a in $(find ${D}/${m}); do a=3D${a/${D}\/\///} webapp_checkfileexists "${a}" "$D" - local MY_FILE=3D"$(webapp_strip_appdir "${a}")" - MY_FILE=3D"$(webapp_strip_cwd "${MY_FILE}")" + local my_file=3D"$(webapp_strip_appdir "${a}")" + my_file=3D"$(webapp_strip_cwd "${my_file}")" =20 - elog "(server owned) ${MY_FILE}" - echo "${MY_FILE}" >> "${D}/${WA_SOLIST}" + elog "(server owned) ${my_file}" + echo "${my_file}" >> "${D}/${WA_SOLIST}" done done else for m in "$@"; do webapp_checkfileexists "${m}" "$D" - local MY_FILE=3D"$(webapp_strip_appdir "${m}")" - MY_FILE=3D"$(webapp_strip_cwd "${MY_FILE}")" + local my_file=3D"$(webapp_strip_appdir "${m}")" + my_file=3D"$(webapp_strip_cwd "${my_file}")" =20 - elog "(server owned) ${MY_FILE}" - echo "${MY_FILE}" >> "${D}/${WA_SOLIST}" + elog "(server owned) ${my_file}" + echo "${my_file}" >> "${D}/${WA_SOLIST}" done fi } @@ -247,9 +244,7 @@ =20 webapp_checkfileexists "${2}" =20 - if [[ ! -d "${D}/${MY_SQLSCRIPTSDIR}/${1}" ]]; then - mkdir -p "${D}/${MY_SQLSCRIPTSDIR}/${1}" || die "unable to create dire= ctory ${D}/${MY_SQLSCRIPTSDIR}/${1}" - fi + dodir "${MY_SQLSCRIPTSDIR}/${1}" =20 # WARNING: # @@ -336,30 +331,27 @@ G_HOSTNAME=3D"localhost" webapp_read_config =20 - # are we installing a webapp-config solution over the top of a - # non-webapp-config solution? - if ! use vhosts; then - local my_dir=3D"${ROOT}${VHOST_ROOT}/${MY_HTDOCSBASE}/${PN}" - local my_output + local my_dir=3D"${ROOT}${VHOST_ROOT}/${MY_HTDOCSBASE}/${PN}" =20 - if [[ -d "${my_dir}" ]]; then - my_output=3D"$(webapp_check_installedat)" + # if USE=3Dvhosts is enabled OR no application is installed we're done = here + use vhosts || [[ ! -d "${my_dir}" ]] && return =20 - if [[ $? -ne 0 ]]; then - # okay, whatever is there, it isn't webapp-config-compatible - ewarn "You already have something installed in ${my_dir}" - ewarn - ewarn "Whatever is in ${my_dir}, it's not" - ewarn "compatible with webapp-config." - ewarn - ewarn "This ebuild may be overwriting important files." - ewarn - elif [[ "$(echo ${my_output} | awk '{ print $1 }')" !=3D "${PN}" ]]; = then - eerror "${my_dir} contains ${my_output}" - eerror "I cannot upgrade that" - die "Cannot upgrade contents of ${my_dir}" - fi - fi + local my_output + my_output=3D"$(webapp_check_installedat)" + + if [[ $? -ne 0 ]]; then + # okay, whatever is there, it isn't webapp-config-compatible + ewarn "You already have something installed in ${my_dir}" + ewarn + ewarn "Whatever is in ${my_dir}, it's not" + ewarn "compatible with webapp-config." + ewarn + ewarn "This ebuild may be overwriting important files." + ewarn + elif [[ "$(echo ${my_output} | awk '{ print $1 }')" !=3D "${PN}" ]]; th= en + eerror "${my_dir} contains ${my_output}" + eerror "I cannot upgrade that" + die "Cannot upgrade contents of ${my_dir}" fi } =20 --=20 gentoo-commits@lists.gentoo.org mailing list