summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-07-27 18:12:33 +0200
committerRemi Collet <fedora@famillecollet.com>2014-07-27 18:12:33 +0200
commit7ec0a6cdb038b205b7102165556c70b1c0b2e2eb (patch)
treecf6928fd790994cd8938c54cc3b8f49cf8785c9f
parent55d9cf592c48e2829296bc8889cd8c72c779b4e2 (diff)
retrieve vendor from composer package, for filtering
-rw-r--r--class/Parser.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/class/Parser.php b/class/Parser.php
index cdb984f..d4f6269 100644
--- a/class/Parser.php
+++ b/class/Parser.php
@@ -481,11 +481,22 @@ class Parser
$tot = 0;
foreach($pktable->request(array('ORDER'=>'rpmname')) as $rec) {
if ($rep = $pk->getPackage($rec['pkgname'])) {
+ $v = explode('/', $rec['pkgname']);
+ switch(count($v)) {
+ case 3:
+ $vendor = $v[0] . '/'.$v[1];
+ break;
+ case 2:
+ $vendor = "packagist/" . $v[0];
+ break;
+ default:
+ $vendor = "packagist";
+ }
$id = false;
if ($rep['stable']) {
$id = $uptable->record(
'composer',
- 'packagist',
+ $vendor,
$rec['rpmname'],
$rep['stable'],
true
@@ -494,7 +505,7 @@ class Parser
if ($rep['unstable']) {
$id = $uptable->record(
'composer',
- 'packagist',
+ $vendor,
$rec['rpmname'],
$rep['unstable'],
false,