fix: enable Alpine community repo in ha_automatic_packages.sh before apk installs

Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/0e7fb54a-7428-4f42-ad0e-8176f2fc3787

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-28 08:39:32 +00:00
parent a55cae7f7b
commit 3ff5df873f

View File

@@ -183,6 +183,12 @@ done
[ "$VERBOSE" = true ] && echo "installing packages $PACKAGES"
if [ "$PACKMANAGER" = "apt" ]; then apt-get update > /dev/null; fi
if [ "$PACKMANAGER" = "pacman" ]; then pacman -Sy > /dev/null; fi
if [ "$PACKMANAGER" = "apk" ] && [ -f /etc/apk/repositories ] && ! grep -q "community" /etc/apk/repositories; then
ALPINE_VER=$(cat /etc/alpine-release 2>/dev/null | cut -d. -f1,2)
if [ -n "$ALPINE_VER" ]; then
echo "https://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VER}/community" >> /etc/apk/repositories
fi
fi
# Install apps one by one to allow failures
# shellcheck disable=SC2086