llvm.eclass: Add initial tests
[gentoo.git] / eclass / webapp.eclass
index 1dddec1edaff6ef7793ff1130389e55973846577..e11835735cac8574e5908e74cf9588cd3dfb9930 100644 (file)
@@ -1,6 +1,5 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Id$
 
 # @ECLASS: webapp.eclass
 # @MAINTAINER:
@@ -43,9 +42,9 @@ IS_REPLACE=0
 INSTALL_CHECK_FILE="installed_by_webapp_eclass"
 SETUP_CHECK_FILE="setup_by_webapp_eclass"
 
-ETC_CONFIG="${ROOT}etc/vhosts/webapp-config"
-WEBAPP_CONFIG="${ROOT}usr/sbin/webapp-config"
-WEBAPP_CLEANER="${ROOT}usr/sbin/webapp-cleaner"
+ETC_CONFIG="${ROOT%/}/etc/vhosts/webapp-config"
+WEBAPP_CONFIG="${ROOT%/}/usr/sbin/webapp-config"
+WEBAPP_CLEANER="${ROOT%/}/usr/sbin/webapp-cleaner"
 
 # ==============================================================================
 # INTERNAL FUNCTIONS
@@ -78,7 +77,7 @@ webapp_checkfileexists() {
        if [[ ! -e "${my_prefix}${1}" ]]; then
                msg="ebuild fault: file '${1}' not found"
                eerror "$msg"
-               eerror "Please report this as a bug at http://bugs.gentoo.org/"
+               eerror "Please report this as a bug at https://bugs.gentoo.org/"
                die "$msg"
        fi
 }
@@ -338,12 +337,12 @@ webapp_src_preinst() {
                eerror "This ebuild did not call webapp_pkg_setup() at the beginning"
                eerror "of the pkg_setup() function"
                eerror
-               eerror "Please log a bug on http://bugs.gentoo.org"
+               eerror "Please log a bug on https://bugs.gentoo.org"
                eerror
                eerror "You should use emerge -C to remove this package, as the"
                eerror "installation is incomplete"
                eerror
-               die "Ebuild did not call webapp_pkg_setup() - report to http://bugs.gentoo.org"
+               die "Ebuild did not call webapp_pkg_setup() - report to https://bugs.gentoo.org"
        fi
 
        # Hint, see the webapp_read_config() function to find where these are
@@ -366,7 +365,7 @@ webapp_src_preinst() {
 # @DESCRIPTION:
 # The default pkg_setup() for this eclass. This will gather required variables
 # from webapp-config and check if there is an application installed to
-# `${ROOT}/var/www/localhost/htdocs/${PN}/' if USE=vhosts is not set.
+# `${ROOT%/}/var/www/localhost/htdocs/${PN}/' if USE=vhosts is not set.
 #
 # You need to call this function BEFORE anything else has run in your custom
 # pkg_setup().
@@ -390,7 +389,7 @@ webapp_pkg_setup() {
        G_HOSTNAME="localhost"
        webapp_read_config
 
-       local my_dir="${ROOT}${VHOST_ROOT}/${MY_HTDOCSBASE}/${PN}"
+       local my_dir="${ROOT%/}/${VHOST_ROOT}/${MY_HTDOCSBASE}/${PN}"
 
        # if USE=vhosts is enabled OR no application is installed we're done here
        if ! has vhosts ${IUSE} || use vhosts || [[ ! -d "${my_dir}" ]]; then
@@ -412,9 +411,6 @@ webapp_pkg_setup() {
                ewarn "This ebuild may be overwriting important files."
                ewarn
                echo
-               if has "${EAPI:-0}" 0 1 2; then
-                       ebeep 10
-               fi
        elif [[ "$(echo ${my_output} | awk '{ print $1 }')" != "${PN}" ]]; then
                echo
                eerror "You already have ${my_output} installed in ${my_dir}"
@@ -457,7 +453,7 @@ webapp_src_install() {
 # @FUNCTION: webapp_pkg_postinst
 # @DESCRIPTION:
 # The default pkg_postinst() for this eclass. This installs the web application to
-# `${ROOT}/var/www/localhost/htdocs/${PN}/' if USE=vhosts is not set. Otherwise
+# `${ROOT%/}/var/www/localhost/htdocs/${PN}/' if USE=vhosts is not set. Otherwise
 # display a short notice how to install this application with webapp-config.
 #
 # You need to call this function AFTER everything else has run in your custom
@@ -468,17 +464,17 @@ webapp_pkg_postinst() {
        webapp_read_config
 
        # sanity checks, to catch bugs in the ebuild
-       if [[ ! -f "${ROOT}${MY_APPDIR}/${INSTALL_CHECK_FILE}" ]]; then
+       if [[ ! -f "${ROOT%/}/${MY_APPDIR}/${INSTALL_CHECK_FILE}" ]]; then
                eerror
                eerror "This ebuild did not call webapp_src_install() at the end"
                eerror "of the src_install() function"
                eerror
-               eerror "Please log a bug on http://bugs.gentoo.org"
+               eerror "Please log a bug on https://bugs.gentoo.org"
                eerror
                eerror "You should use emerge -C to remove this package, as the"
                eerror "installation is incomplete"
                eerror
-               die "Ebuild did not call webapp_src_install() - report to http://bugs.gentoo.org"
+               die "Ebuild did not call webapp_src_install() - report to https://bugs.gentoo.org"
        fi
 
        if has vhosts ${IUSE}; then