Adjust "docker-php-ext-configure" to also install deps, but have "docker-php-ext-install" remove them if and only if it was "docker-php-ext-*" which installed them.

This commit is contained in:
Tianon Gravi 2016-06-06 11:01:36 -07:00
parent 81ceba1318
commit 1ad06eced2
2 changed files with 32 additions and 4 deletions

View File

@ -13,6 +13,21 @@ if [ -z "$ext" ] || ! [ -d "$extDir" ]; then
fi
shift
pm='unknown'
if [ -e /lib/apk/db/installed ]; then
pm='apk'
fi
if [ "$pm" = 'apk' ]; then
if \
[ -n "$PHPIZE_DEPS" ] \
&& ! apk info --installed .phpize-deps > /dev/null \
&& ! apk info --installed .phpize-deps-configure > /dev/null \
; then
apk add --no-cache --virtual .phpize-deps-configure $PHPIZE_DEPS
fi
fi
set -x
cd "$extDir"
phpize

View File

@ -55,8 +55,21 @@ if [ -z "$exts" ]; then
exit 1
fi
if [ -e /lib/apk/db/installed ] && [ -n "$PHPIZE_DEPS" ]; then
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS
pm='unknown'
if [ -e /lib/apk/db/installed ]; then
pm='apk'
fi
apkDel=
if [ "$pm" = 'apk' ]; then
if [ -n "$PHPIZE_DEPS" ]; then
if apk info --installed .phpize-deps-configure > /dev/null; then
apkDel='.phpize-deps-configure'
elif ! apk info --installed .phpize-deps > /dev/null; then
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS
apkDel='.phpize-deps'
fi
fi
fi
for ext in $exts; do
@ -74,6 +87,6 @@ for ext in $exts; do
)
done
if [ -e /lib/apk/db/installed ] && [ -n "$PHPIZE_DEPS" ]; then
apk del .phpize-deps
if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then
apk del $apkDel
fi