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

Diff of /eclass/webapp.eclass

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

Revision 1.51 Revision 1.52
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 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.51 2008/02/22 13:44:41 hollow Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.52 2008/02/22 13:53:38 hollow 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
46 46
47# Check whether a specified file exists in the given directory (`.' by default) 47# Check whether a specified file exists in the given directory (`.' by default)
48webapp_checkfileexists() { 48webapp_checkfileexists() {
49 debug-print-function $FUNCNAME $* 49 debug-print-function $FUNCNAME $*
50 50
51 local my_prefix 51 local my_prefix=${2:+${2}/}
52
53 [ -n "${2}" ] && my_prefix="${2}/" || my_prefix=
54 52
55 if [ ! -e "${my_prefix}${1}" ]; then 53 if [ ! -e "${my_prefix}${1}" ]; then
56 msg="ebuild fault: file '${1}' not found" 54 msg="ebuild fault: file '${1}' not found"
57 eerror "$msg" 55 eerror "$msg"
58 eerror "Please report this as a bug at http://bugs.gentoo.org/" 56 eerror "Please report this as a bug at http://bugs.gentoo.org/"
65 ${WEBAPP_CONFIG} --show-installed -h localhost -d "${INSTALL_DIR}" 2> /dev/null 63 ${WEBAPP_CONFIG} --show-installed -h localhost -d "${INSTALL_DIR}" 2> /dev/null
66} 64}
67 65
68webapp_strip_appdir() { 66webapp_strip_appdir() {
69 debug-print-function $FUNCNAME $* 67 debug-print-function $FUNCNAME $*
70 echo "${1}" | sed -e "s|${MY_APPDIR}/||g;" 68 echo "${1#${MY_APPDIR}/}"
71} 69}
72 70
73webapp_strip_d() { 71webapp_strip_d() {
74 debug-print-function $FUNCNAME $* 72 debug-print-function $FUNCNAME $*
75 echo "${1}" | sed -e "s|${D}||g;" 73 echo "${1#${D}}"
76} 74}
77 75
78webapp_strip_cwd() { 76webapp_strip_cwd() {
79 debug-print-function $FUNCNAME $* 77 debug-print-function $FUNCNAME $*
80 echo "${1}" | sed -e 's|/./|/|g;' 78 echo "${1/#.\///}"
81} 79}
82 80
83webapp_getinstalltype() { 81webapp_getinstalltype() {
84 debug-print-function $FUNCNAME $* 82 debug-print-function $FUNCNAME $*
85 83
229 # WARNING: 227 # WARNING:
230 # 228 #
231 # do NOT change the naming convention used here without changing all 229 # do NOT change the naming convention used here without changing all
232 # the other scripts that also rely upon these names 230 # the other scripts that also rely upon these names
233 231
234 local my_file
235 if [ -z "${3}" ]; then
236 my_file="${1}-$(basename "${2}")" 232 local my_file="${1}-${3:-$(basename "${2}")}"
237 else
238 my_file="${1}-${3}"
239 fi
240 233
241 elog "(${1}) config file '${my_file}'" 234 elog "(${1}) config file '${my_file}'"
242 cp "${2}" "${D}/${MY_SERVERCONFIGDIR}/${my_file}" 235 cp "${2}" "${D}/${MY_SERVERCONFIGDIR}/${my_file}"
243} 236}
244 237

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

  ViewVC Help
Powered by ViewVC 1.1.20