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

Diff of /eclass/webapp.eclass

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

Revision 1.65 Revision 1.70
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 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/webapp.eclass,v 1.65 2011/05/19 12:03:41 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.70 2011/12/27 17:55:12 fauli Exp $
4 4
5# @ECLASS: webapp.eclass 5# @ECLASS: webapp.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# web-apps@gentoo.org 7# web-apps@gentoo.org
8# @BLURB: functions for installing applications to run under a web server 8# @BLURB: functions for installing applications to run under a web server
9# @DESCRIPTION: 9# @DESCRIPTION:
10# The webapp eclass contains functions to handle web applications with 10# The webapp eclass contains functions to handle web applications with
11# webapp-config. Part of the implementation of GLEP #11 11# webapp-config. Part of the implementation of GLEP #11
12 12
13# @ECLASS-VARIABLE: WABAPP_MINIMAL
14# @DESCRIPTION:
15# Minimal version of webapp-config the package requires for sucessfull install.
16: ${WEBAPP_MINIMAL:=1.50.15}
17
18# @ECLASS-VARIABLE: WEBAPP_DEPEND 13# @ECLASS-VARIABLE: WEBAPP_DEPEND
19# @DESCRIPTION: 14# @DESCRIPTION:
20# An ebuild should use WEBAPP_DEPEND if a custom DEPEND needs to be built, most 15# An ebuild should use WEBAPP_DEPEND if a custom DEPEND needs to be built, most
21# notably in combination with WEBAPP_OPTIONAL. 16# notably in combination with WEBAPP_OPTIONAL.
22: ${WEBAPP_DEPEND:=">=app-admin/webapp-config-${WEBAPP_MINIMAL}"} 17WEBAPP_DEPEND=">=app-admin/webapp-config-1.50.15"
23 18
24# @ECLASS-VARIABLE: WEBAPP_AUTO_INSTALL 19# @ECLASS-VARIABLE: WEBAPP_NO_AUTO_INSTALL
25# @DESCRIPTION: 20# @DESCRIPTION:
26# An ebuild sets this to `no' if an automatic installation and/or upgrade is 21# An ebuild sets this to `yes' if an automatic installation and/or upgrade is
27# not possible. The ebuild should overwrite pkg_postinst() and explain the 22# not possible. The ebuild should overwrite pkg_postinst() and explain the
28# reason for this BEFORE calling webapp_pkg_postinst(). 23# reason for this BEFORE calling webapp_pkg_postinst().
29: ${WEBAPP_AUTO_INSTALL:=yes}
30if [[ -n ${WEBAPP_NO_AUTO_INSTALL} ]]; then
31 WEBAPP_AUTO_INSTALL=no
32 ewarn "QA: using deprecated variable \"WEBAPP_NO_AUTO_INSTALL\"."
33 ewarn "QA: please migrate to WEBAPP_AUTO_INSTALL with inverse logic"
34 ewarn "QA: that defaults to yes."
35fi
36 24
37# @ECLASS-VARIABLE: WEBAPP_OPTIONAL 25# @ECLASS-VARIABLE: WEBAPP_OPTIONAL
38# @DESCRIPTION: 26# @DESCRIPTION:
39# An ebuild sets this to `yes' to make webapp support optional, in which case 27# An ebuild sets this to `yes' to make webapp support optional, in which case
40# you also need to take care of USE-flags and dependencies. 28# you also need to take care of USE-flags and dependencies.
29
41if [[ ${WEBAPP_OPTIONAL} != yes ]]; then 30if [[ "${WEBAPP_OPTIONAL}" != "yes" ]]; then
42 [[ ${WEBAPP_AUTO_INSTALL} == yes ]] && IUSE="vhosts" 31 [[ "${WEBAPP_NO_AUTO_INSTALL}" == "yes" ]] || IUSE="vhosts"
43 : ${SLOT:=${PVR}} 32 SLOT="${PVR}"
44 DEPEND="${WEBAPP_DEPEND}" 33 DEPEND="${WEBAPP_DEPEND}"
45 RDEPEND="${DEPEND}" 34 RDEPEND="${DEPEND}"
46fi 35fi
47 36
48EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install pkg_prerm 37EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install pkg_prerm
65# Load the config file /etc/vhosts/webapp-config 54# Load the config file /etc/vhosts/webapp-config
66# Supports both the old bash version, and the new python version 55# Supports both the old bash version, and the new python version
67webapp_read_config() { 56webapp_read_config() {
68 debug-print-function $FUNCNAME $* 57 debug-print-function $FUNCNAME $*
69 58
59 if has_version '>=app-admin/webapp-config-1.50'; then
70 ENVVAR=$(${WEBAPP_CONFIG} --query ${PN} ${PVR}) || die "Could not read settings from webapp-config!" 60 ENVVAR=$(${WEBAPP_CONFIG} --query ${PN} ${PVR}) || die "Could not read settings from webapp-config!"
71 eval ${ENVVAR} || die 61 eval ${ENVVAR}
62 elif [[ "${WEBAPP_OPTIONAL}" != "yes" ]]; then
63 # ETC_CONFIG might not be available
64 . ${ETC_CONFIG} || die "Unable to read ${ETC_CONFIG}"
65 elif [[ -f "${ETC_CONFIG}" ]]; then
66 # WEBAPP_OPTIONAL is set to yes
67 # and this must run only if ETC_CONFIG actually exists
68 . ${ETC_CONFIG} || die "Unable to read ${ETC_CONFIG}"
69 fi
72} 70}
73 71
74# Check whether a specified file exists in the given directory (`.' by default) 72# Check whether a specified file exists in the given directory (`.' by default)
75webapp_checkfileexists() { 73webapp_checkfileexists() {
76 debug-print-function $FUNCNAME $* 74 debug-print-function $FUNCNAME $*
77 75
78 local msg my_prefix=${2:+${2}/} 76 local my_prefix=${2:+${2}/}
79 77
80 if [[ ! -e "${my_prefix}${1}" ]]; then 78 if [[ ! -e "${my_prefix}${1}" ]]; then
81 msg="ebuild error: file '${1}' not found" 79 msg="ebuild fault: file '${1}' not found"
82 eerror "$msg" 80 eerror "$msg"
83 eerror "Please report this as a bug at http://bugs.gentoo.org/" 81 eerror "Please report this as a bug at http://bugs.gentoo.org/"
84 die "$msg" 82 die "$msg"
85 fi 83 fi
86} 84}
106} 104}
107 105
108webapp_getinstalltype() { 106webapp_getinstalltype() {
109 debug-print-function $FUNCNAME $* 107 debug-print-function $FUNCNAME $*
110 108
111 local my_output my_pn my_pvr
112
113 if ! has vhosts ${IUSE} || use vhosts; then 109 if ! has vhosts ${IUSE} || use vhosts; then
114 return 110 return
115 fi 111 fi
116 112
113 local my_output
117 my_output="$(webapp_check_installedat)" 114 my_output="$(webapp_check_installedat)"
118 115
119 if [[ $? -eq 0 ]]; then 116 if [[ $? -eq 0 ]]; then
120 # something is already installed there 117 # something is already installed there
121 # make sure it isn't the same version 118 # make sure it isn't the same version
122 119
123 my_pn="$(echo ${my_output} | awk '{ print $1 }')" 120 local my_pn="$(echo ${my_output} | awk '{ print $1 }')"
124 my_pvr="$(echo ${my_output} | awk '{ print $2 }')" 121 local my_pvr="$(echo ${my_output} | awk '{ print $2 }')"
125 122
126 REMOVE_PKG="${my_pn}-${my_pvr}" 123 REMOVE_PKG="${my_pn}-${my_pvr}"
127 124
128 if [[ "${my_pn}" == "${PN}" ]]; then 125 if [[ "${my_pn}" == "${PN}" ]]; then
129 if [[ "${my_pvr}" != "${PVR}" ]]; then 126 if [[ "${my_pvr}" != "${PVR}" ]]; then
130 elog "This is an upgrade" 127 elog "This is an upgrade"
131 IS_UPGRADE=1 128 IS_UPGRADE=1
129 # for binpkgs, reset status, var declared in global scope
130 IS_REPLACE=0
132 else 131 else
133 elog "This is a re-installation" 132 elog "This is a re-installation"
134 IS_REPLACE=1 133 IS_REPLACE=1
134 # for binpkgs, reset status, var declared in global scope
135 IS_UPGRADE=0
135 fi 136 fi
136 else 137 else
137 elog "${my_output} is installed there" 138 elog "${my_output} is installed there"
138 fi 139 fi
139 else 140 else
141 # for binpkgs, reset status, var declared in global scope
142 IS_REPLACE=0
143 IS_UPGRADE=0
140 elog "This is an installation" 144 elog "This is an installation"
141 fi 145 fi
142}
143
144# helper for webapp_serverowned()
145_webapp_serverowned() {
146 debug-print-function $FUNCNAME $*
147
148 webapp_checkfileexists "${1}" "${D}"
149 local my_file="$(webapp_strip_appdir "${1}")"
150 my_file="$(webapp_strip_cwd "${my_file}")"
151
152 elog "(server owned) ${my_file}"
153 echo "${my_file}" >> "${D}/${WA_SOLIST}"
154} 146}
155 147
156# ============================================================================== 148# ==============================================================================
157# PUBLIC FUNCTIONS 149# PUBLIC FUNCTIONS
158# ============================================================================== 150# ==============================================================================
189# @DESCRIPTION: 181# @DESCRIPTION:
190# Mark a file config-protected for a web-based application. 182# Mark a file config-protected for a web-based application.
191webapp_configfile() { 183webapp_configfile() {
192 debug-print-function $FUNCNAME $* 184 debug-print-function $FUNCNAME $*
193 185
194 [[ $# -lt 1 ]] && die "${FUNCNAME}: I require at least 1 argument. Please read eclass documentation."
195
196 local m 186 local m
197 for m in "$@"; do 187 for m in "$@"; do
198 webapp_checkfileexists "${m}" "${D}" 188 webapp_checkfileexists "${m}" "${D}"
199 189
200 local my_file="$(webapp_strip_appdir "${m}")" 190 local my_file="$(webapp_strip_appdir "${m}")"
201 my_file="$(webapp_strip_cwd "${my_file}")" 191 my_file="$(webapp_strip_cwd "${my_file}")"
202 192
203 elog "[webapp-config] ${my_file}" 193 elog "(config) ${my_file}"
204 echo "${my_file}" >> ${D}/${WA_CONFIGLIST} 194 echo "${my_file}" >> ${D}/${WA_CONFIGLIST}
205 done 195 done
206} 196}
207 197
208# @FUNCTION: webapp_hook_script 198# @FUNCTION: webapp_hook_script
209# @USAGE: <file> [more files ...] 199# @USAGE: <file>
210# @DESCRIPTION: 200# @DESCRIPTION:
211# Install a script that will run after a virtual copy is created, and 201# Install a script that will run after a virtual copy is created, and
212# before a virtual copy has been removed. 202# before a virtual copy has been removed.
213webapp_hook_script() { 203webapp_hook_script() {
214 debug-print-function $FUNCNAME $* 204 debug-print-function $FUNCNAME $*
215 205
216 [[ $# -lt 1 ]] && die "${FUNCNAME}: I require at least 1 argument. Please read eclass documentation."
217
218 local m
219 for m in "$@"; do
220 webapp_checkfileexists "${m}" 206 webapp_checkfileexists "${1}"
221 207
222 elog "[webapp-hook] ${m}" 208 elog "(hook) ${1}"
223 cp "${1}" "${D}/${MY_HOOKSCRIPTSDIR}/$(basename "${1}")" || die "Unable to install ${1} into \"${D}/${MY_HOOKSCRIPTSDIR}/\"" 209 cp "${1}" "${D}/${MY_HOOKSCRIPTSDIR}/$(basename "${1}")" || die "Unable to install ${1} into ${D}/${MY_HOOKSCRIPTSDIR}/"
224 chmod 555 "${D}/${MY_HOOKSCRIPTSDIR}/$(basename "${1}")" 210 chmod 555 "${D}/${MY_HOOKSCRIPTSDIR}/$(basename "${1}")"
225 done
226} 211}
227 212
228# @FUNCTION: webapp_postinst_txt 213# @FUNCTION: webapp_postinst_txt
229# @USAGE: <lang> <file> [more files ...] 214# @USAGE: <lang> <file>
230# @DESCRIPTION: 215# @DESCRIPTION:
231# Install a text file containing post-installation instructions. 216# Install a text file containing post-installation instructions.
232webapp_postinst_txt() { 217webapp_postinst_txt() {
233 debug-print-function $FUNCNAME $* 218 debug-print-function $FUNCNAME $*
234 219
235 local lang m
236
237 [[ $# -lt 2 ]] && die "${FUNCNAME}: I require at least 2 arguments. Please read eclass documentation."
238
239 lang=${1}
240 shift
241
242 local m
243 for m in "$@"; do
244 webapp_checkfileexists "${m}" 220 webapp_checkfileexists "${2}"
245 221
246 elog "[webapp-info] \"${m}\" (lang: ${lang})" 222 elog "(info) ${2} (lang: ${1})"
247 cp "${m}" "${D}/${MY_APPDIR}/${m}-postinst-${lang}.txt" || die 223 cp "${2}" "${D}/${MY_APPDIR}/postinst-${1}.txt"
248 done
249} 224}
250 225
251# @FUNCTION: webapp_postupgrade_txt 226# @FUNCTION: webapp_postupgrade_txt
252# @USAGE: <lang> <file> [more files ...] 227# @USAGE: <lang> <file>
253# @DESCRIPTION: 228# @DESCRIPTION:
254# Install a text file containing post-upgrade instructions. 229# Install a text file containing post-upgrade instructions.
255webapp_postupgrade_txt() { 230webapp_postupgrade_txt() {
256 debug-print-function $FUNCNAME $* 231 debug-print-function $FUNCNAME $*
257 232
258 local lang m
259
260 [[ $# -lt 2 ]] && die "${FUNCNAME}: I require at least 2 arguments. Please read eclass documentation."
261
262 lang=${1}
263 shift
264
265 local m
266 for m in "$@"; do
267 webapp_checkfileexists "${m}" 233 webapp_checkfileexists "${2}"
268 234
269 elog "[webapp-info] \"${m}\" (lang: ${lang})" 235 elog "(info) ${2} (lang: ${1})"
270 cp "${m}" "${D}/${MY_APPDIR}/${m}-postupgrade-${lang}.txt" || die 236 cp "${2}" "${D}/${MY_APPDIR}/postupgrade-${1}.txt"
271 done 237}
238
239# helper for webapp_serverowned()
240_webapp_serverowned() {
241 debug-print-function $FUNCNAME $*
242
243 webapp_checkfileexists "${1}" "${D}"
244 local my_file="$(webapp_strip_appdir "${1}")"
245 my_file="$(webapp_strip_cwd "${my_file}")"
246
247 elog "(server owned) ${my_file}"
248 echo "${my_file}" >> "${D}/${WA_SOLIST}"
272} 249}
273 250
274# @FUNCTION: webapp_serverowned 251# @FUNCTION: webapp_serverowned
275# @USAGE: [-R] <file> [more files ...] 252# @USAGE: [-R] <file> [more files ...]
276# @DESCRIPTION: 253# @DESCRIPTION:
304# used by default. Note: this function will automagically prepend $1 to the 281# used by default. Note: this function will automagically prepend $1 to the
305# front of your config file's name. 282# front of your config file's name.
306webapp_server_configfile() { 283webapp_server_configfile() {
307 debug-print-function $FUNCNAME $* 284 debug-print-function $FUNCNAME $*
308 285
309 [[ $# -lt 2 ]] && die "${FUNCNAME}: I require at least 2 arguments. Please read eclass documentation."
310
311 webapp_checkfileexists "${2}" 286 webapp_checkfileexists "${2}"
312 287
313 # WARNING: 288 # WARNING:
314 # 289 #
315 # do NOT change the naming convention used here without changing all 290 # do NOT change the naming convention used here without changing all
316 # the other scripts that also rely upon these names 291 # the other scripts that also rely upon these names
317 292
318 local my_file="${1}-${3:-$(basename "${2}")}" 293 local my_file="${1}-${3:-$(basename "${2}")}"
319 294
320 elog "[webapp] Server \"${1}\" config file \"${my_file}\"" 295 elog "(${1}) config file '${my_file}'"
321 cp "${2}" "${D}/${MY_SERVERCONFIGDIR}/${my_file}" 296 cp "${2}" "${D}/${MY_SERVERCONFIGDIR}/${my_file}"
322} 297}
323 298
324# @FUNCTION: webapp_sqlscript 299# @FUNCTION: webapp_sqlscript
325# @USAGE: <db> <file> [version] 300# @USAGE: <db> <file> [version]
329# If a version is given the script should upgrade the database schema from 304# If a version is given the script should upgrade the database schema from
330# the given version to $PVR. 305# the given version to $PVR.
331webapp_sqlscript() { 306webapp_sqlscript() {
332 debug-print-function $FUNCNAME $* 307 debug-print-function $FUNCNAME $*
333 308
334 [[ $# -lt 2 ]] && die "${FUNCNAME}: I require at least 2 arguments. Please read eclass documentation."
335
336 webapp_checkfileexists "${2}" 309 webapp_checkfileexists "${2}"
310
311 dodir "${MY_SQLSCRIPTSDIR}/${1}"
337 312
338 # WARNING: 313 # WARNING:
339 # 314 #
340 # do NOT change the naming convention used here without changing all 315 # do NOT change the naming convention used here without changing all
341 # the other scripts that also rely upon these names 316 # the other scripts that also rely upon these names
342 317
343 insinto "${MY_SQLSCRIPTSDIR}/${1}"
344 insopts -m0600
345 if [[ -n ${3} ]]; then 318 if [[ -n "${3}" ]]; then
346 elog "[webapp] DB: \"${1}\" upgrade script for ${PN}-${3} to ${PVR}" 319 elog "(${1}) upgrade script for ${PN}-${3} to ${PVR}"
347 newins "${2}" "${3}_to_${PVR}.sql" || die 320 cp "${2}" "${D}${MY_SQLSCRIPTSDIR}/${1}/${3}_to_${PVR}.sql"
321 chmod 600 "${D}${MY_SQLSCRIPTSDIR}/${1}/${3}_to_${PVR}.sql"
348 else 322 else
349 elog "[webapp] DB: \"${1}\" create script for ${PN}-${PVR}" 323 elog "(${1}) create script for ${PN}-${PVR}"
350 newins "${2}" "${PVR}_create.sql" 324 cp "${2}" "${D}/${MY_SQLSCRIPTSDIR}/${1}/${PVR}_create.sql"
325 chmod 600 "${D}/${MY_SQLSCRIPTSDIR}/${1}/${PVR}_create.sql"
351 fi 326 fi
352} 327}
353 328
354# @FUNCTION: webapp_src_preinst 329# @FUNCTION: webapp_src_preinst
355# @DESCRIPTION: 330# @DESCRIPTION:
357# For now we just create required webapp-config directories. 332# For now we just create required webapp-config directories.
358webapp_src_preinst() { 333webapp_src_preinst() {
359 debug-print-function $FUNCNAME $* 334 debug-print-function $FUNCNAME $*
360 335
361 # sanity checks, to catch bugs in the ebuild 336 # sanity checks, to catch bugs in the ebuild
362 if [[ ! -f ${T}/${SETUP_CHECK_FILE} ]]; then 337 if [[ ! -f "${T}/${SETUP_CHECK_FILE}" ]]; then
363 eerror 338 eerror
364 eerror "This ebuild did not call webapp_pkg_setup() at the beginning" 339 eerror "This ebuild did not call webapp_pkg_setup() at the beginning"
365 eerror "of the pkg_setup() function" 340 eerror "of the pkg_setup() function"
366 eerror 341 eerror
367 eerror "Please log a bug on http://bugs.gentoo.org" 342 eerror "Please log a bug on http://bugs.gentoo.org"
406 # no longer rely on Portage calling both webapp_pkg_setup() and 381 # no longer rely on Portage calling both webapp_pkg_setup() and
407 # webapp_src_install() within the same shell process 382 # webapp_src_install() within the same shell process
408 touch "${T}/${SETUP_CHECK_FILE}" 383 touch "${T}/${SETUP_CHECK_FILE}"
409 384
410 # special case - some ebuilds *do* need to overwride the SLOT 385 # special case - some ebuilds *do* need to overwride the SLOT
411 [[ ${SLOT} != ${PVR} && ${WEBAPP_MANUAL_SLOT} != yes ]] && \ 386 if [[ "${SLOT}+" != "${PVR}+" && "${WEBAPP_MANUAL_SLOT}" != "yes" ]]; then
412 die "Set WEBAPP_MANUAL_SLOT=\"yes\" if you need to SLOT manually" 387 die "Set WEBAPP_MANUAL_SLOT=\"yes\" if you need to SLOT manually"
388 fi
413 389
414 # pull in the shared configuration file 390 # pull in the shared configuration file
415 G_HOSTNAME="localhost" 391 G_HOSTNAME="localhost"
416 webapp_read_config 392 webapp_read_config
417 393
425 local my_output 401 local my_output
426 my_output="$(webapp_check_installedat)" 402 my_output="$(webapp_check_installedat)"
427 403
428 if [[ $? -ne 0 ]]; then 404 if [[ $? -ne 0 ]]; then
429 # okay, whatever is there, it isn't webapp-config-compatible 405 # okay, whatever is there, it isn't webapp-config-compatible
406 echo
430 ewarn 407 ewarn
431 ewarn "You already have something installed in ${my_dir}" 408 ewarn "You already have something installed in ${my_dir}"
432 ewarn 409 ewarn
433 ewarn "Whatever is in \"${my_dir}\", it's not" 410 ewarn "Whatever is in ${my_dir}, it's not"
434 ewarn "compatible with webapp-config." 411 ewarn "compatible with webapp-config."
435 ewarn 412 ewarn
436 ewarn "This ebuild may be overwriting important files." 413 ewarn "This ebuild may be overwriting important files."
437 ewarn 414 ewarn
415 echo
416 ebeep 10
438 elif [[ "$(echo ${my_output} | awk '{ print $1 }')" != "${PN}" ]]; then 417 elif [[ "$(echo ${my_output} | awk '{ print $1 }')" != "${PN}" ]]; then
439 echo 418 echo
440 eerror "You already have ${my_output} installed in ${my_dir}" 419 eerror "You already have ${my_output} installed in ${my_dir}"
441 eerror 420 eerror
442 eerror "I cannot upgrade a different application" 421 eerror "I cannot upgrade a different application"
443 eerror 422 eerror
444 echo 423 echo
445 die "Cannot upgrade contents of ${my_dir}" 424 die "Cannot upgrade contents of ${my_dir}"
446 fi 425 fi
426
447} 427}
448 428
449# @FUNCTION: webapp_src_install 429# @FUNCTION: webapp_src_install
450# @DESCRIPTION: 430# @DESCRIPTION:
451# This is the default src_install(). For now, we just make sure that root owns 431# This is the default src_install(). For now, we just make sure that root owns
509 webapp_read_config 489 webapp_read_config
510 490
511 local my_mode=-I 491 local my_mode=-I
512 webapp_getinstalltype 492 webapp_getinstalltype
513 493
514 if [[ ${IS_REPLACE} == 1 ]]; then 494 if [[ "${IS_REPLACE}" == "1" ]]; then
515 elog "[webapp] ${PN}-${PVR} is already installed - replacing" 495 elog "${PN}-${PVR} is already installed - replacing"
496 my_mode=-I
516 elif [[ ${IS_UPGRADE} == 1 ]]; then 497 elif [[ "${IS_UPGRADE}" == "1" ]]; then
517 elog "[webapp] ${REMOVE_PKG} is already installed - upgrading" 498 elog "${REMOVE_PKG} is already installed - upgrading"
518 my_mode=-U 499 my_mode=-U
519 else 500 else
520 elog "[webapp] ${PN}-${PVR} is not installed - using install mode" 501 elog "${PN}-${PVR} is not installed - using install mode"
521 fi 502 fi
522 503
523 my_cmd="${WEBAPP_CONFIG} ${my_mode} -h localhost -u root -d ${INSTALL_DIR} ${PN} ${PVR}" 504 my_cmd="${WEBAPP_CONFIG} ${my_mode} -h localhost -u root -d ${INSTALL_DIR} ${PN} ${PVR}"
524 elog "[webapp] Running ${my_cmd}" 505 elog "Running ${my_cmd}"
525 ${my_cmd} 506 ${my_cmd}
526 507
527 echo 508 echo
528 local cleaner="${WEBAPP_CLEANER} -p -C ${PN}" 509 local cleaner="${WEBAPP_CLEANER} -p -C /${PN}"
529 einfo "[webapp] Running ${cleaner}" 510 einfo "Running ${cleaner}"
530 ${cleaner} 511 ${cleaner}
531 else 512 else
532 elog 513 elog
533 elog "The 'vhosts' USE flag is switched ON" 514 elog "The 'vhosts' USE flag is switched ON"
534 elog "This means that Portage will not automatically run webapp-config to" 515 elog "This means that Portage will not automatically run webapp-config to"
570 if has vhosts ${IUSE} && ! use vhosts; then 551 if has vhosts ${IUSE} && ! use vhosts; then
571 echo "${my_output}" | while read x; do 552 echo "${my_output}" | while read x; do
572 if [[ -f "${x}"/.webapp ]]; then 553 if [[ -f "${x}"/.webapp ]]; then
573 . "${x}"/.webapp 554 . "${x}"/.webapp
574 if [[ -n "${WEB_HOSTNAME}" && -n "${WEB_INSTALLDIR}" ]]; then 555 if [[ -n "${WEB_HOSTNAME}" && -n "${WEB_INSTALLDIR}" ]]; then
575 ${WEBAPP_CONFIG} -C -h ${WEB_HOSTNAME} -d ${WEB_INSTALLDIR} 556 ${WEBAPP_CONFIG} -C -h ${WEB_HOSTNAME} -d ${WEB_INSTALLDIR} ${PN} ${PVR}
576 fi 557 fi
577 else 558 else
578 ewarn "[webapp] Cannot find file ${x}/.webapp" 559 ewarn "Cannot find file ${x}/.webapp"
579 fi 560 fi
580 done 561 done
581 elif [[ -n ${my_output} ]]; then 562 elif [[ "${my_output}" != "" ]]; then
582 echo 563 echo
583 ewarn 564 ewarn
584 ewarn "Don't forget to use webapp-config to remove any copies of" 565 ewarn "Don't forget to use webapp-config to remove any copies of"
585 ewarn "${PN}-${PVR} installed in" 566 ewarn "${PN}-${PVR} installed in"
586 ewarn 567 ewarn
587 568
588 echo "${my_output}" | while read x; do 569 echo "${my_output}" | while read x; do
589 if [[ -f "${x}"/.webapp ]]; then 570 if [[ -f "${x}"/.webapp ]]; then
590 ewarn "[webapp] ${x}" 571 ewarn " ${x}"
591 else 572 else
592 ewarn "[webapp] Cannot find file ${x}/.webapp" 573 ewarn "Cannot find file ${x}/.webapp"
593 fi 574 fi
594 done 575 done
595 576
596 ewarn 577 ewarn
597 echo 578 echo

Legend:
Removed from v.1.65  
changed lines
  Added in v.1.70

  ViewVC Help
Powered by ViewVC 1.1.20