public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Benedikt Boehm (hollow)" <hollow@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in eclass: webapp.eclass
Date: Fri, 22 Feb 2008 14:33:36 +0000	[thread overview]
Message-ID: <E1JSYy0-0004A2-5f@stork.gentoo.org> (raw)

hollow      08/02/22 14:33:36

  Modified:             webapp.eclass
  Log:
  DRY up webapp_serverowned; extend warning messages

Revision  Changes    Path
1.55                 eclass/webapp.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.eclass?rev=1.55&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.eclass?rev=1.55&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.eclass?r1=1.54&r2=1.55

Index: webapp.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- webapp.eclass	22 Feb 2008 14:27:17 -0000	1.54
+++ webapp.eclass	22 Feb 2008 14:33:35 -0000	1.55
@@ -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.54 2008/02/22 14:27:17 hollow Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.55 2008/02/22 14:33:35 hollow Exp $
 #
 # @ECLASS: webapp.eclass
 # @MAINTAINER:
@@ -174,6 +174,18 @@
 	cp "${2}" "${D}/${MY_APPDIR}/postupgrade-${1}.txt"
 }
 
+# helper for webapp_serverowned()
+_webapp_serverowned() {
+	debug-print-function $FUNCNAME $*
+
+	webapp_checkfileexists "${1}" "${D}"
+	local my_file="$(webapp_strip_appdir "${1}")"
+	my_file="$(webapp_strip_cwd "${my_file}")"
+
+	elog "(server owned) ${my_file}"
+	echo "${my_file}" >> "${D}/${WA_SOLIST}"
+}
+
 # @FUNCTION: webapp_serverowned
 # @USAGE: [-R] <file> [more files ...]
 # @DESCRIPTION:
@@ -187,24 +199,14 @@
 	if [[ "${1}" == "-R" ]]; then
 		shift
 		for m in "$@"; do
-			for a in $(find ${D}/${m}); do
-				a=${a/${D}\/\///}
-				webapp_checkfileexists "${a}" "$D"
-				local my_file="$(webapp_strip_appdir "${a}")"
-				my_file="$(webapp_strip_cwd "${my_file}")"
-
-				elog "(server owned) ${my_file}"
-				echo "${my_file}" >> "${D}/${WA_SOLIST}"
+			find "${D}${m}" | while read a; do
+				a=$(webapp_strip_d "${a}")
+				_webapp_serverowned "${a}"
 			done
 		done
 	else
 		for m in "$@"; do
-			webapp_checkfileexists "${m}" "$D"
-			local my_file="$(webapp_strip_appdir "${m}")"
-			my_file="$(webapp_strip_cwd "${my_file}")"
-
-			elog "(server owned) ${my_file}"
-			echo "${my_file}" >> "${D}/${WA_SOLIST}"
+			_webapp_serverowned "${m}"
 		done
 	fi
 }
@@ -341,6 +343,8 @@
 
 	if [[ $? -ne 0 ]]; then
 		# okay, whatever is there, it isn't webapp-config-compatible
+		echo
+		ewarn
 		ewarn "You already have something installed in ${my_dir}"
 		ewarn
 		ewarn "Whatever is in ${my_dir}, it's not"
@@ -348,9 +352,15 @@
 		ewarn
 		ewarn "This ebuild may be overwriting important files."
 		ewarn
+		echo
+		ebeep 10
 	elif [[ "$(echo ${my_output} | awk '{ print $1 }')" != "${PN}" ]]; then
-		eerror "${my_dir} contains ${my_output}"
-		eerror "I cannot upgrade that"
+		echo
+		eerror "You already have ${my_output} installed in ${my_dir}"
+		eerror
+		eerror "I cannot upgrade a different application"
+		eerror
+		echo
 		die "Cannot upgrade contents of ${my_dir}"
 	fi
 }
@@ -386,12 +396,12 @@
 		echo
 		elog "vhosts USE flag not set - auto-installing using webapp-config"
 
-		webapp_getinstalltype
-
 		G_HOSTNAME="localhost"
-		local my_mode=-I
 		webapp_read_config
 
+		local my_mode=-I
+		webapp_getinstalltype
+
 		if [[ "${IS_REPLACE}" == "1" ]]; then
 			elog "${PN}-${PVR} is already installed - replacing"
 			my_mode=-I



-- 
gentoo-commits@lists.gentoo.org mailing list



             reply	other threads:[~2008-02-22 14:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-22 14:33 Benedikt Boehm (hollow) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-07-02 14:02 [gentoo-commits] gentoo-x86 commit in eclass: webapp.eclass Devan Franchini (twitch153)
2012-07-18 14:59 Anthony G. Basile (blueness)
2012-07-15 22:45 Doug Goldstein (cardoe)
2011-07-27  7:50 Fabio Erculiani (lxnay)
2011-07-26 19:25 Fabio Erculiani (lxnay)
2011-07-12  7:48 Fabio Erculiani (lxnay)
2011-05-19 12:05 Tomas Chvatal (scarabeus)
2010-05-09 22:32 Jeremy Olexa (darkside)
2008-03-23  0:11 Benedikt Boehm (hollow)
2008-03-04 18:54 Benedikt Boehm (hollow)
2008-03-04 18:44 Benedikt Boehm (hollow)
2008-03-04 18:41 Benedikt Boehm (hollow)
2008-02-23 23:54 Benedikt Boehm (hollow)
2008-02-22 15:33 Benedikt Boehm (hollow)
2008-02-22 14:59 Benedikt Boehm (hollow)
2008-02-22 14:44 Benedikt Boehm (hollow)
2008-02-22 14:27 Benedikt Boehm (hollow)
2008-02-22 14:06 Benedikt Boehm (hollow)
2008-02-22 13:53 Benedikt Boehm (hollow)
2008-02-22 13:44 Benedikt Boehm (hollow)
2008-02-22 10:03 Benedikt Boehm (hollow)
2008-02-22  9:33 Benedikt Boehm (hollow)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1JSYy0-0004A2-5f@stork.gentoo.org \
    --to=hollow@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox