Gentoo Archives: gentoo-commits

From: "Benedikt Boehm (hollow)" <hollow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: webapp.eclass
Date: Fri, 22 Feb 2008 14:27:22
Message-Id: E1JSYru-00045b-IX@stork.gentoo.org
1 hollow 08/02/22 14:27:18
2
3 Modified: webapp.eclass
4 Log:
5 get rid of too much indention; consistency cleanup
6
7 Revision Changes Path
8 1.54 eclass/webapp.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.eclass?rev=1.54&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.eclass?rev=1.54&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.eclass?r1=1.53&r2=1.54
13
14 Index: webapp.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v
17 retrieving revision 1.53
18 retrieving revision 1.54
19 diff -u -r1.53 -r1.54
20 --- webapp.eclass 22 Feb 2008 14:06:05 -0000 1.53
21 +++ webapp.eclass 22 Feb 2008 14:27:17 -0000 1.54
22 @@ -1,6 +1,6 @@
23 # Copyright 1999-2006 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.53 2008/02/22 14:06:05 hollow Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.54 2008/02/22 14:27:17 hollow Exp $
27 #
28 # @ECLASS: webapp.eclass
29 # @MAINTAINER:
30 @@ -80,35 +80,33 @@
31
32 webapp_getinstalltype() {
33 debug-print-function $FUNCNAME $*
34 + use vhosts && return
35
36 - if ! use vhosts; then
37 - local my_output
38 + local my_output
39 + my_output="$(webapp_check_installedat)"
40 +
41 + if [[ $? -eq 0 ]]; then
42 + # something is already installed there
43 + # make sure it isn't the same version
44 +
45 + local my_pn="$(echo ${my_output} | awk '{ print $1 }')"
46 + local my_pvr="$(echo ${my_output} | awk '{ print $2 }')"
47
48 - my_output="$(webapp_check_installedat)"
49 + REMOVE_PKG="${my_pn}-${my_pvr}"
50
51 - if [[ $? -eq 0 ]]; then
52 - # something is already installed there
53 - # make sure it isn't the same version
54 -
55 - local my_pn="$(echo ${my_output} | awk '{ print $1 }')"
56 - local my_pvr="$(echo ${my_output} | awk '{ print $2 }')"
57 -
58 - REMOVE_PKG="${my_pn}-${my_pvr}"
59 -
60 - if [[ "${my_pn}" == "${PN}" ]]; then
61 - if [[ "${my_pvr}" != "${PVR}" ]]; then
62 - elog "This is an upgrade"
63 - IS_UPGRADE=1
64 - else
65 - elog "This is a re-installation"
66 - IS_REPLACE=1
67 - fi
68 + if [[ "${my_pn}" == "${PN}" ]]; then
69 + if [[ "${my_pvr}" != "${PVR}" ]]; then
70 + elog "This is an upgrade"
71 + IS_UPGRADE=1
72 else
73 - elog "${my_output} is installed there"
74 + elog "This is a re-installation"
75 + IS_REPLACE=1
76 fi
77 else
78 - elog "This is an installation"
79 + elog "${my_output} is installed there"
80 fi
81 + else
82 + elog "This is an installation"
83 fi
84 }
85
86 @@ -123,15 +121,15 @@
87 webapp_configfile() {
88 debug-print-function $FUNCNAME $*
89
90 - local m=""
91 + local m
92 for m in "$@"; do
93 webapp_checkfileexists "${m}" "${D}"
94
95 - local MY_FILE="$(webapp_strip_appdir "${m}")"
96 - MY_FILE="$(webapp_strip_cwd "${MY_FILE}")"
97 + local my_file="$(webapp_strip_appdir "${m}")"
98 + my_file="$(webapp_strip_cwd "${my_file}")"
99
100 - elog "(config) ${MY_FILE}"
101 - echo "${MY_FILE}" >> ${D}/${WA_CONFIGLIST}
102 + elog "(config) ${my_file}"
103 + echo "${my_file}" >> ${D}/${WA_CONFIGLIST}
104 done
105 }
106
107 @@ -185,29 +183,28 @@
108 webapp_serverowned() {
109 debug-print-function $FUNCNAME $*
110
111 - local a=""
112 - local m=""
113 + local a m
114 if [[ "${1}" == "-R" ]]; then
115 shift
116 for m in "$@"; do
117 for a in $(find ${D}/${m}); do
118 a=${a/${D}\/\///}
119 webapp_checkfileexists "${a}" "$D"
120 - local MY_FILE="$(webapp_strip_appdir "${a}")"
121 - MY_FILE="$(webapp_strip_cwd "${MY_FILE}")"
122 + local my_file="$(webapp_strip_appdir "${a}")"
123 + my_file="$(webapp_strip_cwd "${my_file}")"
124
125 - elog "(server owned) ${MY_FILE}"
126 - echo "${MY_FILE}" >> "${D}/${WA_SOLIST}"
127 + elog "(server owned) ${my_file}"
128 + echo "${my_file}" >> "${D}/${WA_SOLIST}"
129 done
130 done
131 else
132 for m in "$@"; do
133 webapp_checkfileexists "${m}" "$D"
134 - local MY_FILE="$(webapp_strip_appdir "${m}")"
135 - MY_FILE="$(webapp_strip_cwd "${MY_FILE}")"
136 + local my_file="$(webapp_strip_appdir "${m}")"
137 + my_file="$(webapp_strip_cwd "${my_file}")"
138
139 - elog "(server owned) ${MY_FILE}"
140 - echo "${MY_FILE}" >> "${D}/${WA_SOLIST}"
141 + elog "(server owned) ${my_file}"
142 + echo "${my_file}" >> "${D}/${WA_SOLIST}"
143 done
144 fi
145 }
146 @@ -247,9 +244,7 @@
147
148 webapp_checkfileexists "${2}"
149
150 - if [[ ! -d "${D}/${MY_SQLSCRIPTSDIR}/${1}" ]]; then
151 - mkdir -p "${D}/${MY_SQLSCRIPTSDIR}/${1}" || die "unable to create directory ${D}/${MY_SQLSCRIPTSDIR}/${1}"
152 - fi
153 + dodir "${MY_SQLSCRIPTSDIR}/${1}"
154
155 # WARNING:
156 #
157 @@ -336,30 +331,27 @@
158 G_HOSTNAME="localhost"
159 webapp_read_config
160
161 - # are we installing a webapp-config solution over the top of a
162 - # non-webapp-config solution?
163 - if ! use vhosts; then
164 - local my_dir="${ROOT}${VHOST_ROOT}/${MY_HTDOCSBASE}/${PN}"
165 - local my_output
166 + local my_dir="${ROOT}${VHOST_ROOT}/${MY_HTDOCSBASE}/${PN}"
167
168 - if [[ -d "${my_dir}" ]]; then
169 - my_output="$(webapp_check_installedat)"
170 + # if USE=vhosts is enabled OR no application is installed we're done here
171 + use vhosts || [[ ! -d "${my_dir}" ]] && return
172
173 - if [[ $? -ne 0 ]]; then
174 - # okay, whatever is there, it isn't webapp-config-compatible
175 - ewarn "You already have something installed in ${my_dir}"
176 - ewarn
177 - ewarn "Whatever is in ${my_dir}, it's not"
178 - ewarn "compatible with webapp-config."
179 - ewarn
180 - ewarn "This ebuild may be overwriting important files."
181 - ewarn
182 - elif [[ "$(echo ${my_output} | awk '{ print $1 }')" != "${PN}" ]]; then
183 - eerror "${my_dir} contains ${my_output}"
184 - eerror "I cannot upgrade that"
185 - die "Cannot upgrade contents of ${my_dir}"
186 - fi
187 - fi
188 + local my_output
189 + my_output="$(webapp_check_installedat)"
190 +
191 + if [[ $? -ne 0 ]]; then
192 + # okay, whatever is there, it isn't webapp-config-compatible
193 + ewarn "You already have something installed in ${my_dir}"
194 + ewarn
195 + ewarn "Whatever is in ${my_dir}, it's not"
196 + ewarn "compatible with webapp-config."
197 + ewarn
198 + ewarn "This ebuild may be overwriting important files."
199 + ewarn
200 + elif [[ "$(echo ${my_output} | awk '{ print $1 }')" != "${PN}" ]]; then
201 + eerror "${my_dir} contains ${my_output}"
202 + eerror "I cannot upgrade that"
203 + die "Cannot upgrade contents of ${my_dir}"
204 fi
205 }
206
207
208
209
210 --
211 gentoo-commits@l.g.o mailing list