Skip to content

Commit e05a351

Browse files
committed
Update tools.func
1 parent 053e5ab commit e05a351

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

misc/tools.func

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3671,16 +3671,16 @@ EOF
36713671
return 1
36723672
fi
36733673

3674-
# Build module list - don't pre-check, let apt-get handle it
3675-
local MODULE_LIST="php${PHP_VERSION}=${AVAILABLE_PHP_VERSION}-*"
3674+
# Build module list - without version pinning (preferences.d handles it)
3675+
local MODULE_LIST="php${PHP_VERSION}"
36763676

36773677
IFS=',' read -ra MODULES <<<"$COMBINED_MODULES"
36783678
for mod in "${MODULES[@]}"; do
3679-
MODULE_LIST+=" php${PHP_VERSION}-${mod}=${AVAILABLE_PHP_VERSION}-*"
3679+
MODULE_LIST+=" php${PHP_VERSION}-${mod}"
36803680
done
36813681

36823682
if [[ "$PHP_FPM" == "YES" ]]; then
3683-
MODULE_LIST+=" php${PHP_VERSION}-fpm=${AVAILABLE_PHP_VERSION}-*"
3683+
MODULE_LIST+=" php${PHP_VERSION}-fpm"
36843684
fi
36853685

36863686
# install apache2 with PHP support if requested
@@ -3691,17 +3691,14 @@ EOF
36913691
msg_error "Failed to install Apache"
36923692
return 1
36933693
}
3694-
install_packages_with_retry "libapache2-mod-php${PHP_VERSION}=${AVAILABLE_PHP_VERSION}-*" || {
3694+
install_packages_with_retry "libapache2-mod-php${PHP_VERSION}" || {
36953695
msg_warn "Failed to install libapache2-mod-php${PHP_VERSION}, continuing without Apache module"
36963696
}
36973697
fi
36983698
fi
36993699

3700-
# Install PHP packages with explicit version constraints
3701-
msg_info "Installing PHP ${PHP_VERSION} packages (version ${AVAILABLE_PHP_VERSION})"
3700+
# Install PHP packages (pinning via preferences.d ensures correct version)
37023701
if ! install_packages_with_retry $MODULE_LIST; then
3703-
msg_warn "Failed to install PHP packages with version constraints, attempting individual installation"
3704-
37053702
# Install main package first (critical)
37063703
install_packages_with_retry "php${PHP_VERSION}" || {
37073704
msg_error "Failed to install php${PHP_VERSION}"
@@ -3710,25 +3707,19 @@ EOF
37103707

37113708
# Try to install Apache module individually if requested
37123709
if [[ "$PHP_APACHE" == "YES" ]]; then
3713-
install_packages_with_retry "libapache2-mod-php${PHP_VERSION}" || {
3714-
msg_warn "Could not install libapache2-mod-php${PHP_VERSION}"
3715-
}
3710+
install_packages_with_retry "libapache2-mod-php${PHP_VERSION}" || true
37163711
fi
37173712

37183713
# Try to install modules individually - skip those that don't exist
37193714
for pkg in "${MODULES[@]}"; do
37203715
if apt-cache search "^php${PHP_VERSION}-${pkg}\$" 2>/dev/null | grep -q "^php${PHP_VERSION}-${pkg}"; then
3721-
install_packages_with_retry "php${PHP_VERSION}-${pkg}" || {
3722-
msg_warn "Could not install php${PHP_VERSION}-${pkg}"
3723-
}
3716+
install_packages_with_retry "php${PHP_VERSION}-${pkg}" || true
37243717
fi
37253718
done
37263719

37273720
if [[ "$PHP_FPM" == "YES" ]]; then
37283721
if apt-cache search "^php${PHP_VERSION}-fpm\$" 2>/dev/null | grep -q "^php${PHP_VERSION}-fpm"; then
3729-
install_packages_with_retry "php${PHP_VERSION}-fpm" || {
3730-
msg_warn "Could not install php${PHP_VERSION}-fpm"
3731-
}
3722+
install_packages_with_retry "php${PHP_VERSION}-fpm" || true
37323723
fi
37333724
fi
37343725
fi

0 commit comments

Comments
 (0)