diff options
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 = ""; |