1 |
hollow 08/02/22 14:33:36 |
2 |
|
3 |
Modified: webapp.eclass |
4 |
Log: |
5 |
DRY up webapp_serverowned; extend warning messages |
6 |
|
7 |
Revision Changes Path |
8 |
1.55 eclass/webapp.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.eclass?rev=1.55&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.eclass?rev=1.55&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/webapp.eclass?r1=1.54&r2=1.55 |
13 |
|
14 |
Index: webapp.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v |
17 |
retrieving revision 1.54 |
18 |
retrieving revision 1.55 |
19 |
diff -u -r1.54 -r1.55 |
20 |
--- webapp.eclass 22 Feb 2008 14:27:17 -0000 1.54 |
21 |
+++ webapp.eclass 22 Feb 2008 14:33:35 -0000 1.55 |
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.54 2008/02/22 14:27:17 hollow Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.55 2008/02/22 14:33:35 hollow Exp $ |
27 |
# |
28 |
# @ECLASS: webapp.eclass |
29 |
# @MAINTAINER: |
30 |
@@ -174,6 +174,18 @@ |
31 |
cp "${2}" "${D}/${MY_APPDIR}/postupgrade-${1}.txt" |
32 |
} |
33 |
|
34 |
+# helper for webapp_serverowned() |
35 |
+_webapp_serverowned() { |
36 |
+ debug-print-function $FUNCNAME $* |
37 |
+ |
38 |
+ webapp_checkfileexists "${1}" "${D}" |
39 |
+ local my_file="$(webapp_strip_appdir "${1}")" |
40 |
+ my_file="$(webapp_strip_cwd "${my_file}")" |
41 |
+ |
42 |
+ elog "(server owned) ${my_file}" |
43 |
+ echo "${my_file}" >> "${D}/${WA_SOLIST}" |
44 |
+} |
45 |
+ |
46 |
# @FUNCTION: webapp_serverowned |
47 |
# @USAGE: [-R] <file> [more files ...] |
48 |
# @DESCRIPTION: |
49 |
@@ -187,24 +199,14 @@ |
50 |
if [[ "${1}" == "-R" ]]; then |
51 |
shift |
52 |
for m in "$@"; do |
53 |
- for a in $(find ${D}/${m}); do |
54 |
- a=${a/${D}\/\///} |
55 |
- webapp_checkfileexists "${a}" "$D" |
56 |
- local my_file="$(webapp_strip_appdir "${a}")" |
57 |
- my_file="$(webapp_strip_cwd "${my_file}")" |
58 |
- |
59 |
- elog "(server owned) ${my_file}" |
60 |
- echo "${my_file}" >> "${D}/${WA_SOLIST}" |
61 |
+ find "${D}${m}" | while read a; do |
62 |
+ a=$(webapp_strip_d "${a}") |
63 |
+ _webapp_serverowned "${a}" |
64 |
done |
65 |
done |
66 |
else |
67 |
for m in "$@"; do |
68 |
- webapp_checkfileexists "${m}" "$D" |
69 |
- local my_file="$(webapp_strip_appdir "${m}")" |
70 |
- my_file="$(webapp_strip_cwd "${my_file}")" |
71 |
- |
72 |
- elog "(server owned) ${my_file}" |
73 |
- echo "${my_file}" >> "${D}/${WA_SOLIST}" |
74 |
+ _webapp_serverowned "${m}" |
75 |
done |
76 |
fi |
77 |
} |
78 |
@@ -341,6 +343,8 @@ |
79 |
|
80 |
if [[ $? -ne 0 ]]; then |
81 |
# okay, whatever is there, it isn't webapp-config-compatible |
82 |
+ echo |
83 |
+ ewarn |
84 |
ewarn "You already have something installed in ${my_dir}" |
85 |
ewarn |
86 |
ewarn "Whatever is in ${my_dir}, it's not" |
87 |
@@ -348,9 +352,15 @@ |
88 |
ewarn |
89 |
ewarn "This ebuild may be overwriting important files." |
90 |
ewarn |
91 |
+ echo |
92 |
+ ebeep 10 |
93 |
elif [[ "$(echo ${my_output} | awk '{ print $1 }')" != "${PN}" ]]; then |
94 |
- eerror "${my_dir} contains ${my_output}" |
95 |
- eerror "I cannot upgrade that" |
96 |
+ echo |
97 |
+ eerror "You already have ${my_output} installed in ${my_dir}" |
98 |
+ eerror |
99 |
+ eerror "I cannot upgrade a different application" |
100 |
+ eerror |
101 |
+ echo |
102 |
die "Cannot upgrade contents of ${my_dir}" |
103 |
fi |
104 |
} |
105 |
@@ -386,12 +396,12 @@ |
106 |
echo |
107 |
elog "vhosts USE flag not set - auto-installing using webapp-config" |
108 |
|
109 |
- webapp_getinstalltype |
110 |
- |
111 |
G_HOSTNAME="localhost" |
112 |
- local my_mode=-I |
113 |
webapp_read_config |
114 |
|
115 |
+ local my_mode=-I |
116 |
+ webapp_getinstalltype |
117 |
+ |
118 |
if [[ "${IS_REPLACE}" == "1" ]]; then |
119 |
elog "${PN}-${PVR} is already installed - replacing" |
120 |
my_mode=-I |
121 |
|
122 |
|
123 |
|
124 |
-- |
125 |
gentoo-commits@l.g.o mailing list |