From d7234759311efb6a41768c7de25fb3eb22dbc72d Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sat, 23 May 2026 23:42:38 -0500 Subject: [PATCH] fix: updates_xml_build strips type prefix from element to prevent pkg_pkg_ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same duplication bug as joomla_build.php — uses for packages and strips existing type prefixes before prepending. Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) --- cli/updates_xml_build.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli/updates_xml_build.php b/cli/updates_xml_build.php index 947564d..bfebc69 100644 --- a/cli/updates_xml_build.php +++ b/cli/updates_xml_build.php @@ -102,6 +102,8 @@ if (preg_match('/]*type="([^"]+)"/', $xml, $m)) $extType = $m[1]; $extElement = ''; if (preg_match('/([^<]+)<\/element>/', $xml, $m)) $extElement = $m[1]; +// For packages, prefer to avoid pkg_pkg_ duplication +if (empty($extElement) && preg_match('/([^<]+)<\/packagename>/', $xml, $m)) $extElement = $m[1]; if (empty($extElement) && preg_match('/plugin="([^"]+)"/', $xml, $m)) $extElement = $m[1]; if (empty($extElement) && preg_match('/module="([^"]+)"/', $xml, $m)) $extElement = $m[1]; if (empty($extElement)) { @@ -112,6 +114,8 @@ if (empty($extElement)) { $extElement = $fname; } } +// Strip existing type prefix to prevent duplication (e.g. pkg_mokowaas → mokowaas) +$extElement = preg_replace('/^(pkg_|com_|mod_|plg_\w+_|tpl_|lib_)/', '', $extElement); $extClient = ''; if (preg_match('/]*client="([^"]+)"/', $xml, $m)) $extClient = $m[1];