From 4462c58ade980a83e60c78b41709bd8d4662b8ec Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 7 Jan 2025 10:35:00 +0100 Subject: handle pie --- class/Parser.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'class') diff --git a/class/Parser.php b/class/Parser.php index 3ef11a4..ca00ac8 100644 --- a/class/Parser.php +++ b/class/Parser.php @@ -278,8 +278,6 @@ class Parser } } self::log("Write $tot packages"); - } else { - self::log("Bad primary.xml"); } return $tot; } @@ -337,16 +335,21 @@ class Parser // Parse the provides foreach ($fmt as $fmt2) { $prov = $fmt2->attributes()['name']; - if (preg_match('/^php-composer\((.*)\)$/', $prov, $reg)) { - list($vend, $proj) = explode('/', $reg[1], 2); + if (preg_match('/^php-(composer|pie)\((.*)\)$/', $prov, $reg)) { + $type = $reg[1]; + $name = $reg[2]; + if (!strpos($name, '/')) { + continue; + } + list($vend, $proj) = explode('/', $name, 2); if ($vend == 'zendframework') { if (!$composer) { // only if empty to keep laminas - $composer = $reg[1]; + $composer = $name; } } else if (substr($reg[1], 0, 4) != 'ext-' - && substr($reg[1], -15) != '-implementation' + && substr($name, -15) != '-implementation' && !in_array($reg[1], $excl)) { - $composer = $reg[1]; + $composer = $name; } } } -- cgit