diff options
author | Remi Collet <remi@remirepo.net> | 2021-02-03 11:13:52 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2021-02-03 11:13:52 +0100 |
commit | 8fffcf71fa7b7427fd8f76066a8bfca0631cd1df (patch) | |
tree | 84d63cc32f0b3252d942d5ee2229e50593130784 | |
parent | ce0e24d41ca611073971051ef16bc83e3ce54368 (diff) |
fix when no php-composer() in provides
-rw-r--r-- | checkpkgist.json | 1 | ||||
-rwxr-xr-x | checkpkgist.php | 17 |
2 files changed, 16 insertions, 2 deletions
diff --git a/checkpkgist.json b/checkpkgist.json index e758cae..61be41b 100644 --- a/checkpkgist.json +++ b/checkpkgist.json @@ -42,5 +42,6 @@ "php-phpseclib3": "phpseclib\/phpseclib", "php-sanmai-phpunit-legacy-adapter": "sanmai\/phpunit-legacy-adapter", "php-laminas-code4": "laminas\/laminas-code", + "php-friendsofphp-proxy-manager-lts": "friendsofphp\/proxy-manager-lts", "phinx": "robmorgan\/phinx" } diff --git a/checkpkgist.php b/checkpkgist.php index 418c875..756c429 100755 --- a/checkpkgist.php +++ b/checkpkgist.php @@ -151,18 +151,31 @@ function run($name, $rpm) { } $rpmmainver = "n/a"; $rpminfo['Providename'] = ["php-composer($name)"]; - $rpminfo['Provideversion'] = $rpmmainver; + $rpminfo['Provideversion'] =[$rpmmainver]; } + $cpt = 0; foreach($rpminfo['Providename'] as $i => $n) { if (preg_match('/php-composer\((.*)\)/', $n, $res)) { - $rpmver = $rpminfo['Provideversion'][$i]; $name = $res[1]; } else { + unset($rpminfo['Providename'][$i]); continue; } if (strpos($name, '-implementation') || strpos($name, '-api') || strpos($name, '/zend')) { + unset($rpminfo['Providename'][$i]); continue; } + $cpt++; + } + if (!$cpt) { + $rpminfo['Providename'] = ["php-composer($name)"]; + $rpminfo['Provideversion'] =[$rpmmainver]; + } + foreach($rpminfo['Providename'] as $i => $n) { + if (preg_match('/php-composer\((.*)\)/', $n, $res)) { + $rpmver = $rpminfo['Provideversion'][$i]; + $name = $res[1]; + } $pkgs = $client->getPackage($name); if ($pkgs && isset($pkgs['packages'][$name])) { $maxver = ""; |