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

Collapse All | Expand All

(-)a/php.eselect (-8 / +27 lines)
Lines 83-90 Link Here
83
	echo ${ret}
83
	echo ${ret}
84
}
84
}
85
85
86
apache2_link="${EROOT}"$(get_active_libdir)/apache2/modules/libphp5$(get_libname)
87
88
cleanup() {
86
cleanup() {
89
	local target=$(find_targets_$1 | tail -n 1)
87
	local target=$(find_targets_$1 | tail -n 1)
90
	[[ -z $target ]] && 
88
	[[ -z $target ]] && 
Lines 107-112 Link Here
107
	for target in $(find_targets); do
105
	for target in $(find_targets); do
108
		for libdir in $(get_libdirs); do
106
		for libdir in $(get_libdirs); do
109
			[[ -f ${EROOT}${libdir}/$target/apache2/libphp5$(get_libname) ]] && echo $target
107
			[[ -f ${EROOT}${libdir}/$target/apache2/libphp5$(get_libname) ]] && echo $target
108
			[[ -f ${EROOT}${libdir}/$target/apache2/libphp7$(get_libname) ]] && echo $target
110
		done
109
		done
111
	done | sort -u
110
	done | sort -u
112
}
111
}
Lines 139-157 Link Here
139
}
138
}
140
139
141
get_active_cli() {
140
get_active_cli() {
142
	readlink -e "${EROOT}"/usr/bin/php | sed -ne "s:.*/usr/.*/\(php[0-9]\.[0-9][0-9]*\)/bin/php:\1:p"
141
	local target=$(canonicalise "${EROOT}"/usr/bin/php)
142
	if [[ -a "${target}" ]] ; then
143
		echo "${target}" | sed -ne "s:.*/usr/.*/\(php[0-9]\.[0-9][0-9]*\)/bin/php:\1:p"
144
	fi
143
}
145
}
144
146
145
get_active_cgi() {
147
get_active_cgi() {
146
	readlink -e "${EROOT}"/usr/bin/php-cgi | sed -ne "s:.*/usr/.*/\(php[0-9]\.[0-9]\)/bin/php-cgi:\1:p"
148
	local target=$(canonicalise "${EROOT}"/usr/bin/php-cgi)
149
	if [[ -a "${target}" ]] ; then
150
		echo "${target}" | sed -ne "s:.*/usr/.*/\(php[0-9]\.[0-9][0-9]*\)/bin/php-cgi:\1:p"
151
	fi
147
}
152
}
148
153
149
get_active_fpm() {
154
get_active_fpm() {
150
	readlink -e "${EROOT}"/usr/bin/php-fpm | sed -ne "s:.*/usr/.*/\(php[0-9]\.[0-9]\)/bin/php-fpm:\1:p"
155
	local target=$(canonicalise "${EROOT}"/usr/bin/php-fpm)
156
	if [[ -a "${target}" ]] ; then
157
		echo "${target}" | sed -ne "s:.*/usr/.*/\(php[0-9]\.[0-9][0-9]*\)/bin/php-fpm:\1:p"
158
	fi
151
}
159
}
152
160
153
get_active_apache2() {
161
get_active_apache2() {
154
	readlink -e "${EROOT}"$(get_active_libdir)/apache2/modules/libphp5$(get_libname) | sed -ne "s:.*/usr/.*/\(php[0-9]\.[0-9]\)/apache2/libphp5$(get_libname):\1:p"
162
	local target
163
	if [[ -L "${EROOT}"$(get_active_libdir)/apache2/modules/libphp5$(get_libname) ]] ; then
164
		target=$(canonicalise "${EROOT}"$(get_active_libdir)/apache2/modules/libphp5$(get_libname))
165
		if [[ -a "${target}" ]] ; then
166
			echo "${target}" | sed -ne "s:.*/usr/.*/\(php[0-9]\.[0-9]\)/apache2/libphp5$(get_libname):\1:p"
167
		fi
168
	elif [[ -L "${EROOT}"$(get_active_libdir)/apache2/modules/libphp7$(get_libname) ]] ; then
169
		target=$(canonicalise "${EROOT}"$(get_active_libdir)/apache2/modules/libphp7$(get_libname))
170
		if [[ -a "${target}" ]] ; then
171
			echo "${target}" | sed -ne "s:.*/usr/.*/\(php[0-9]\.[0-9]\)/apache2/libphp7$(get_libname):\1:p"
172
		fi
173
	fi
155
}
174
}
156
175
157
resolv_target() {
176
resolv_target() {
Lines 217-224 Link Here
217
	local libdir t=$(resolv_target apache2 $1)
236
	local libdir t=$(resolv_target apache2 $1)
218
	[[ -z $t ]] && die -q "Bad target"
237
	[[ -z $t ]] && die -q "Bad target"
219
	for libdir in $(get_libdirs); do
238
	for libdir in $(get_libdirs); do
220
		ln -sf ../../$t/apache2/libphp5$(get_libname) "${EROOT}"${libdir}/apache2/modules/ || \
239
		ln -sf ../../$t/apache2/libphp{$t:0:1}$(get_libname) "${EROOT}"${libdir}/apache2/modules/ || \
221
			die -q "Failed to set symlink for ${EPREFIX}${libdir}/apache2/modules/libphp5$(get_libname)"
240
			die -q "Failed to set symlink for ${EPREFIX}${libdir}/apache2/modules/libphp${t:0:1}$(get_libname)"
222
	done
241
	done
223
	echo "You have to run \`${EPREFIX}/etc/init.d/apache2 restart' for the changes to take effect"
242
	echo "You have to run \`${EPREFIX}/etc/init.d/apache2 restart' for the changes to take effect"
224
}
243
}

Return to bug 552156