takeover check on deploy-drupal.sh

This commit is contained in:
2026-09-25 14:46:06 +02:00
parent a7d53e2cd8
commit 757ffce68a
+17 -2
View File
@@ -44,12 +44,27 @@ if [ -s /tmp/deploy-lock-old ] && [ -s /tmp/deploy-lock-new ]; then
case "$dir" in
web/modules/*)
for mod in $ENABLED_MODS; do
find "$dir" -name "$mod.info.yml" 2>/dev/null | grep -q . && TO_UNINSTALL_MODS="$TO_UNINSTALL_MODS $mod"
if find "$dir" -name "$mod.info.yml" 2>/dev/null | grep -q .; then
# Takeover check: if the extension's code also lives outside the
# removed package (e.g. taken over as a custom module), keep it
# enabled - composer install will just remove the old copy.
if find web/modules web/themes -name "$mod.info.yml" -not -path "$dir/*" 2>/dev/null | grep -q .; then
echo "SKIP $mod: code exists outside removed package $pkg (takeover), keeping enabled"
else
TO_UNINSTALL_MODS="$TO_UNINSTALL_MODS $mod"
fi
fi
done
;;
web/themes/*)
for th in $ENABLED_THEMES; do
find "$dir" -name "$th.info.yml" 2>/dev/null | grep -q . && TO_UNINSTALL_THEMES="$TO_UNINSTALL_THEMES $th"
if find "$dir" -name "$th.info.yml" 2>/dev/null | grep -q .; then
if find web/modules web/themes -name "$th.info.yml" -not -path "$dir/*" 2>/dev/null | grep -q .; then
echo "SKIP $th: code exists outside removed package $pkg (takeover), keeping enabled"
else
TO_UNINSTALL_THEMES="$TO_UNINSTALL_THEMES $th"
fi
fi
done
;;
esac