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];