Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 195771 | Differences between
and this patch

Collapse All | Expand All

(-)eclass/webapp.eclass (-28 / +28 lines)
Lines 107-113 Link Here
107
107
108
function webapp_strip_d ()
108
function webapp_strip_d ()
109
{
109
{
110
	echo "${1}" | sed -e "s|${ED}||g;"
110
	echo "${1}" | sed -e "s|${D}||g;"
111
}
111
}
112
112
113
function webapp_strip_cwd ()
113
function webapp_strip_cwd ()
Lines 128-140 Link Here
128
{
128
{
129
	local m=""
129
	local m=""
130
	for m in "$@" ; do
130
	for m in "$@" ; do
131
		webapp_checkfileexists "${m}" "${ED}"
131
		webapp_checkfileexists "${m}" "${D}"
132
132
133
		local MY_FILE="$(webapp_strip_appdir "${m}")"
133
		local MY_FILE="$(webapp_strip_appdir "${m}")"
134
		MY_FILE="$(webapp_strip_cwd "${MY_FILE}")"
134
		MY_FILE="$(webapp_strip_cwd "${MY_FILE}")"
135
135
136
		elog "(config) ${MY_FILE}"
136
		elog "(config) ${MY_FILE}"
137
		echo "${MY_FILE}" >> ${ED}/${WA_CONFIGLIST}
137
		echo "${MY_FILE}" >> ${D}/${WA_CONFIGLIST}
138
	done
138
	done
139
}
139
}
140
140
Lines 152-159 Link Here
152
	webapp_checkfileexists "${1}"
152
	webapp_checkfileexists "${1}"
153
153
154
	elog "(hook) ${1}"
154
	elog "(hook) ${1}"
155
	cp "${1}" "${ED}/${MY_HOOKSCRIPTSDIR}/$(basename "${1}")" || die "Unable to install ${1} into ${ED}/${MY_HOOKSCRIPTSDIR}/"
155
	cp "${1}" "${D}/${MY_HOOKSCRIPTSDIR}/$(basename "${1}")" || die "Unable to install ${1} into ${D}/${MY_HOOKSCRIPTSDIR}/"
156
	chmod 555 "${ED}/${MY_HOOKSCRIPTSDIR}/$(basename "${1}")"
156
	chmod 555 "${D}/${MY_HOOKSCRIPTSDIR}/$(basename "${1}")"
157
}
157
}
158
158
159
# ------------------------------------------------------------------------
159
# ------------------------------------------------------------------------
Lines 170-176 Link Here
170
	webapp_checkfileexists "${2}"
170
	webapp_checkfileexists "${2}"
171
171
172
	elog "(info) ${2} (lang: ${1})"
172
	elog "(info) ${2} (lang: ${1})"
173
	cp "${2}" "${ED}/${MY_APPDIR}/postinst-${1}.txt"
173
	cp "${2}" "${D}/${MY_APPDIR}/postinst-${1}.txt"
174
}
174
}
175
175
176
# ------------------------------------------------------------------------
176
# ------------------------------------------------------------------------
Lines 187-193 Link Here
187
	webapp_checkfileexists "${2}"
187
	webapp_checkfileexists "${2}"
188
188
189
	elog "(info) ${2} (lang: ${1})"
189
	elog "(info) ${2} (lang: ${1})"
190
	cp "${2}" "${ED}/${MY_APPDIR}/postupgrade-${1}.txt"
190
	cp "${2}" "${D}/${MY_APPDIR}/postupgrade-${1}.txt"
191
}
191
}
192
192
193
# ------------------------------------------------------------------------
193
# ------------------------------------------------------------------------
Lines 211-217 Link Here
211
		shift
211
		shift
212
		for m in "$@" ; do
212
		for m in "$@" ; do
213
			for a in $(find ${ED}/${m}); do
213
			for a in $(find ${ED}/${m}); do
214
				a=${a/${ED}\/\///}
214
				a=${a/${D}\/\///}
215
				webapp_checkfileexists "${a}" "$D"
215
				webapp_checkfileexists "${a}" "$D"
216
				local MY_FILE="$(webapp_strip_appdir "${a}")"
216
				local MY_FILE="$(webapp_strip_appdir "${a}")"
217
				MY_FILE="$(webapp_strip_cwd "${MY_FILE}")"
217
				MY_FILE="$(webapp_strip_cwd "${MY_FILE}")"
Lines 266-272 Link Here
266
	# the other scripts that also rely upon these names
266
	# the other scripts that also rely upon these names
267
267
268
	elog "(${1}) config file '${my_file}'"
268
	elog "(${1}) config file '${my_file}'"
269
	cp "${2}" "${ED}/${MY_SERVERCONFIGDIR}/${my_file}"
269
	cp "${2}" "${D}/${MY_SERVERCONFIGDIR}/${my_file}"
270
}
270
}
271
271
272
# ------------------------------------------------------------------------
272
# ------------------------------------------------------------------------
Lines 290-297 Link Here
290
	# scripts for specific database engines go into their own subdirectory
290
	# scripts for specific database engines go into their own subdirectory
291
	# just to keep things readable on the filesystem
291
	# just to keep things readable on the filesystem
292
292
293
	if [ ! -d "${ED}/${MY_SQLSCRIPTSDIR}/${1}" ]; then
293
	if [ ! -d "${D}/${MY_SQLSCRIPTSDIR}/${1}" ]; then
294
		mkdir -p "${ED}/${MY_SQLSCRIPTSDIR}/${1}" || die "unable to create directory ${ED}/${MY_SQLSCRIPTSDIR}/${1}"
294
		mkdir -p "${D}/${MY_SQLSCRIPTSDIR}/${1}" || die "unable to create directory ${D}/${MY_SQLSCRIPTSDIR}/${1}"
295
	fi
295
	fi
296
296
297
	# warning:
297
	# warning:
Lines 303-315 Link Here
303
	if [ -n "${3}" ]; then
303
	if [ -n "${3}" ]; then
304
		# yes we are
304
		# yes we are
305
		elog "(${1}) upgrade script from ${PN}-${PVR} to ${3}"
305
		elog "(${1}) upgrade script from ${PN}-${PVR} to ${3}"
306
		cp "${2}" "${ED}${MY_SQLSCRIPTSDIR}/${1}/${3}_to_${PVR}.sql"
306
		cp "${2}" "${D}${MY_SQLSCRIPTSDIR}/${1}/${3}_to_${PVR}.sql"
307
		chmod 600 "${ED}${MY_SQLSCRIPTSDIR}/${1}/${3}_to_${PVR}.sql"
307
		chmod 600 "${D}${MY_SQLSCRIPTSDIR}/${1}/${3}_to_${PVR}.sql"
308
	else
308
	else
309
		# no, we are not
309
		# no, we are not
310
		elog "(${1}) create script for ${PN}-${PVR}"
310
		elog "(${1}) create script for ${PN}-${PVR}"
311
		cp "${2}" "${ED}/${MY_SQLSCRIPTSDIR}/${1}/${PVR}_create.sql"
311
		cp "${2}" "${D}/${MY_SQLSCRIPTSDIR}/${1}/${PVR}_create.sql"
312
		chmod 600 "${ED}/${MY_SQLSCRIPTSDIR}/${1}/${PVR}_create.sql"
312
		chmod 600 "${D}/${MY_SQLSCRIPTSDIR}/${1}/${PVR}_create.sql"
313
	fi
313
	fi
314
}
314
}
315
315
Lines 327-335 Link Here
327
	chmod -R u-s "${ED}/"
327
	chmod -R u-s "${ED}/"
328
	chmod -R g-s "${ED}/"
328
	chmod -R g-s "${ED}/"
329
329
330
	keepdir "${MY_PERSISTDIR}"
330
	keepdir "${MY_PERSISTDIR/${EPREFIX}/}"
331
	fowners "root:0" "${MY_PERSISTDIR}"
331
	fowners "root:0" "${MY_PERSISTDIR/${EPREFIX}/}"
332
	fperms 755 "${MY_PERSISTDIR}"
332
	fperms 755 "${MY_PERSISTDIR/${EPREFIX}/}"
333
333
334
	# to test whether or not the ebuild has correctly called this function
334
	# to test whether or not the ebuild has correctly called this function
335
	# we add an empty file to the filesystem
335
	# we add an empty file to the filesystem
Lines 338-344 Link Here
338
	# no longer rely on Portage calling both webapp_src_install() and
338
	# no longer rely on Portage calling both webapp_src_install() and
339
	# webapp_pkg_postinst() within the same shell process
339
	# webapp_pkg_postinst() within the same shell process
340
340
341
	touch "${ED}/${MY_APPDIR}/${INSTALL_CHECK_FILE}"
341
	touch "${D}/${MY_APPDIR}/${INSTALL_CHECK_FILE}"
342
}
342
}
343
343
344
# ------------------------------------------------------------------------
344
# ------------------------------------------------------------------------
Lines 433-446 Link Here
433
{
433
{
434
	# create the directories that we need
434
	# create the directories that we need
435
435
436
	dodir "${MY_HTDOCSDIR}"
436
	dodir "${MY_HTDOCSDIR/${EPREFIX}/}"
437
	dodir "${MY_HOSTROOTDIR}"
437
	dodir "${MY_HOSTROOTDIR/${EPREFIX}/}"
438
	dodir "${MY_CGIBINDIR}"
438
	dodir "${MY_CGIBINDIR/${EPREFIX}/}"
439
	dodir "${MY_ICONSDIR}"
439
	dodir "${MY_ICONSDIR/${EPREFIX}/}"
440
	dodir "${MY_ERRORSDIR}"
440
	dodir "${MY_ERRORSDIR/${EPREFIX}/}"
441
	dodir "${MY_SQLSCRIPTSDIR}"
441
	dodir "${MY_SQLSCRIPTSDIR/${EPREFIX}/}"
442
	dodir "${MY_HOOKSCRIPTSDIR}"
442
	dodir "${MY_HOOKSCRIPTSDIR/${EPREFIX}/}"
443
	dodir "${MY_SERVERCONFIGDIR}"
443
	dodir "${MY_SERVERCONFIGDIR/${EPREFIX}/}"
444
}
444
}
445
445
446
function webapp_pkg_postinst ()
446
function webapp_pkg_postinst ()
Lines 449-455 Link Here
449
449
450
	# sanity checks, to catch bugs in the ebuild
450
	# sanity checks, to catch bugs in the ebuild
451
451
452
	if [ ! -f "${EROOT}${MY_APPDIR}/${INSTALL_CHECK_FILE}" ]; then
452
	if [ ! -f "${ROOT}${MY_APPDIR}/${INSTALL_CHECK_FILE}" ]; then
453
		eerror
453
		eerror
454
		eerror "This ebuild did not call webapp_src_install() at the end"
454
		eerror "This ebuild did not call webapp_src_install() at the end"
455
		eerror "of the src_install() function"
455
		eerror "of the src_install() function"

Return to bug 195771