From bf4ef1147494a41ae0e33b9f062e52ed1eaebeb7 Mon Sep 17 00:00:00 2001 From: Simon L Date: Thu, 10 Nov 2022 20:46:18 +0100 Subject: [PATCH] fix removing of build dependencies Signed-off-by: Simon L --- Containers/nextcloud/start.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Containers/nextcloud/start.sh b/Containers/nextcloud/start.sh index a53d13b8..48cb2cd9 100644 --- a/Containers/nextcloud/start.sh +++ b/Containers/nextcloud/start.sh @@ -91,17 +91,19 @@ if [ -n "$ADDITIONAL_PHP_EXTENSIONS" ]; then fi fi done + if [ "$PHP_DEPS_ARE_INSTALLED" = 1 ]; then + rm -rf /tmp/pear + runDeps="$( \ + scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ + | tr ',' '\n' \ + | sort -u \ + | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ + )"; + # shellcheck disable=SC2086 + apk add --virtual .nextcloud-phpext-rundeps $runDeps >/dev/null + apk del .build-deps >/dev/null + fi fi - rm -rf /tmp/pear - runDeps="$( \ - scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \ - | tr ',' '\n' \ - | sort -u \ - | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ - )"; - # shellcheck disable=SC2086 - apk add --virtual .nextcloud-phpext-rundeps $runDeps >/dev/null - apk del .build-deps >/dev/null touch /additional-php-extensions-are-installed fi