summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2011-12-26 13:19:32 +0000
committerRomain d'Alverny <rda@mageia.org>2011-12-26 13:19:32 +0000
commit82106831a81223f5ab02bc8928988343058e51b1 (patch)
tree08b4ffa8512985444b54ff874119c4f68903c306
parentd1d425119890e493a823abd55fcf691b5728c5fa (diff)
downloadpkgsubmit-82106831a81223f5ab02bc8928988343058e51b1.tar
pkgsubmit-82106831a81223f5ab02bc8928988343058e51b1.tar.gz
pkgsubmit-82106831a81223f5ab02bc8928988343058e51b1.tar.bz2
pkgsubmit-82106831a81223f5ab02bc8928988343058e51b1.tar.xz
pkgsubmit-82106831a81223f5ab02bc8928988343058e51b1.zip
adjust returned format
-rw-r--r--maintdb.php20
1 files changed, 15 insertions, 5 deletions
diff --git a/maintdb.php b/maintdb.php
index da8277e..611ac04 100644
--- a/maintdb.php
+++ b/maintdb.php
@@ -65,21 +65,31 @@ $s = file_get_contents($maintdb);
if (null !== $uid) {
$pkg = null;
if (preg_match_all(sprintf('/(.*) %s\n?/', $uid), $s, $res)) {
- $return = array($uid => array('packages' => $res[1]));
+ $return = array(
+ 'maintainers' => array(
+ $uid => array(
+ 'packages' => $res[1]
+ )
+ )
+ );
}
} elseif (null !== $pkg) {
$uid = null;
if (preg_match_all(sprintf('/%s (.*)\n?/', $pkg), $s, $res)) {
- $return = array($pkg => array('uid' => $res[1][0]));
- } else {
- $return = array('_comment' => 'No maintainer found for this package.');
+ $return = array(
+ 'packages' => array(
+ $pkg => array(
+ 'maintainers' => array($res[1][0])
+ )
+ )
+ );
}
}
if ($iurt && $pkg) {
header('Content-Type: text/plain; charset: utf-8');
if (isset($return[$pkg]))
- echo $return[$pkg]['uid'];
+ echo $return[$pkg]['uid'], "\n";
else
echo '';
}