diff options
author | Benedikt Boehm <hollow@gentoo.org> | 2008-02-22 13:53:38 +0000 |
---|---|---|
committer | Benedikt Boehm <hollow@gentoo.org> | 2008-02-22 13:53:38 +0000 |
commit | e02650c76b9b0ba587ae559eb1c179c322880eac (patch) | |
tree | b0a4d683fed156b5a6ce9d726cfcfb31c424f7e3 /eclass/webapp.eclass | |
parent | Add a new revision to reduce copy-on-write pages, also fix the sed for the pk... (diff) | |
download | gentoo-2-e02650c76b9b0ba587ae559eb1c179c322880eac.tar.gz gentoo-2-e02650c76b9b0ba587ae559eb1c179c322880eac.tar.bz2 gentoo-2-e02650c76b9b0ba587ae559eb1c179c322880eac.zip |
replace sed and [] calls with bash expansion
Diffstat (limited to 'eclass/webapp.eclass')
-rw-r--r-- | eclass/webapp.eclass | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/eclass/webapp.eclass b/eclass/webapp.eclass index 14fb897d461f..b8ddc335acfd 100644 --- a/eclass/webapp.eclass +++ b/eclass/webapp.eclass @@ -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.51 2008/02/22 13:44:41 hollow Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.52 2008/02/22 13:53:38 hollow Exp $ # # @ECLASS: webapp.eclass # @MAINTAINER: @@ -48,9 +48,7 @@ webapp_read_config() { webapp_checkfileexists() { debug-print-function $FUNCNAME $* - local my_prefix - - [ -n "${2}" ] && my_prefix="${2}/" || my_prefix= + local my_prefix=${2:+${2}/} if [ ! -e "${my_prefix}${1}" ]; then msg="ebuild fault: file '${1}' not found" @@ -67,17 +65,17 @@ webapp_check_installedat() { webapp_strip_appdir() { debug-print-function $FUNCNAME $* - echo "${1}" | sed -e "s|${MY_APPDIR}/||g;" + echo "${1#${MY_APPDIR}/}" } webapp_strip_d() { debug-print-function $FUNCNAME $* - echo "${1}" | sed -e "s|${D}||g;" + echo "${1#${D}}" } webapp_strip_cwd() { debug-print-function $FUNCNAME $* - echo "${1}" | sed -e 's|/./|/|g;' + echo "${1/#.\///}" } webapp_getinstalltype() { @@ -231,12 +229,7 @@ webapp_server_configfile() { # do NOT change the naming convention used here without changing all # the other scripts that also rely upon these names - local my_file - if [ -z "${3}" ]; then - my_file="${1}-$(basename "${2}")" - else - my_file="${1}-${3}" - fi + local my_file="${1}-${3:-$(basename "${2}")}" elog "(${1}) config file '${my_file}'" cp "${2}" "${D}/${MY_SERVERCONFIGDIR}/${my_file}" |