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 /checkpkgist.php | |
parent | ce0e24d41ca611073971051ef16bc83e3ce54368 (diff) |
fix when no php-composer() in provides
Diffstat (limited to 'checkpkgist.php')
-rwxr-xr-x | checkpkgist.php | 17 |
1 files changed, 15 insertions, 2 deletions
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 = ""; |