Do not call w-c to remove a vhost copy of a web app if USE=vhosts. Bug 136959
authorRenat Lumpau <rl03@gentoo.org>
Wed, 3 Jan 2007 20:16:39 +0000 (20:16 +0000)
committerRenat Lumpau <rl03@gentoo.org>
Wed, 3 Jan 2007 20:16:39 +0000 (20:16 +0000)
eclass/webapp.eclass

index e6ec8547e888de0658a10a2146e49f61bc5b3677..e63936bd54d0880fe6f50dad7708bb4d58dec6c7 100644 (file)
@@ -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.47 2006/12/31 19:16:31 rl03 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.48 2007/01/03 20:16:39 rl03 Exp $
 #
 # eclass/webapp.eclass
 #                              Eclass for installing applications to run under a web server
@@ -527,21 +527,23 @@ function webapp_pkg_prerm ()
                return
        fi
 
-       for x in ${my_output} ; do
-               [ -f ${x}/.webapp ] && . ${x}/.webapp || ewarn "Cannot find file ${x}/.webapp"
+       if ! use vhosts ; then # remove any installed copies
 
-               if [ -z "${WEB_HOSTNAME}" -o -z "${WEB_INSTALLDIR}" ]; then
-                       ewarn "Don't forget to use webapp-config to remove the copy of"
-                       ewarn "${PN}-${PVR} installed in"
-                       ewarn
-                       ewarn "    ${x}"
-                       ewarn
-               else
-                       # we have enough information to remove the virtual copy ourself
+               for x in ${my_output} ; do
+                       [ -f ${x}/.webapp ] && . ${x}/.webapp || ewarn "Cannot find file ${x}/.webapp"
+                       if [ "${WEB_HOSTNAME}" -a "${WEB_INSTALLDIR}" ]; then
+                               ${WEBAPP_CONFIG} -C -h ${WEB_HOSTNAME} -d ${WEB_INSTALLDIR}
+                       fi
+               done
+       else # don't remove anything, but warn user. bug #136959
 
-                       ${WEBAPP_CONFIG} -C -h ${WEB_HOSTNAME} -d ${WEB_INSTALLDIR}
+               ewarn "Don't forget to use webapp-config to remove any copies of"
+               ewarn "${PN}-${PVR} installed in"
+               ewarn
 
-                       # if the removal fails - we carry on anyway!
-               fi
-       done
+               for x in ${my_output} ; do
+                       [ -f ${x}/.webapp ] && . ${x}/.webapp || ewarn "Cannot find file ${x}/.webapp"
+                       ewarn "    ${x}"
+               done
+       fi
 }