summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rpm.php58
-rw-r--r--smarty/templates/rpmphp/rpm.tpl2
2 files changed, 26 insertions, 34 deletions
diff --git a/rpm.php b/rpm.php
index 3b3a2a9..5b298e8 100644
--- a/rpm.php
+++ b/rpm.php
@@ -61,14 +61,15 @@ function report($db, $type)
{
global $what, $smarty;
$packages = null;
- $rpmrepo = new TableRpmRepo($db);
- $uptable = new TableUpstream($db);
+ $rpmrepo = new TableRpmRepo($db);
+ $rpmtable = new TableRpm($db);
+ $uptable = new TableUpstream($db);
$repos = $rpmrepo->getAllRepoHash();
$smarty->assign('repos', $repos);
$i=0;
- foreach($uptable->request(array('type'=>$type, 'ORDER'=>'name')) as $up) {
+ foreach ($uptable->request(array('type'=>$type, 'ORDER'=>'name')) as $up) {
$package = null;
$rpmname = $up['name'];
@@ -83,15 +84,14 @@ function report($db, $type)
}
}
- $sql = "SELECT * FROM rpm WHERE name = '$rpmname'";
+ $package['name'] = $rpmname;
+ $rpms = array();
+ foreach ($rpmtable->request(array('name'=>$rpmname)) as $rpm) {
+ $rpms[$rpm['repo_main'].'-'.$rpm['repo_sub']] = $rpm;
- $res=$db->query($sql);
- $rpm = ($res ? $res->fetchObject() : false);
- $rpms=array();
- if ( $rpm ) {
- do {
- $rpms[$rpm->repo_main."-".$rpm->repo_sub]=$rpm;
- } while ($rpm = $res->fetchObject());
+ $package['name'] = '<a href="zoom.php?rpm=' . $rpmname .
+ '" title="' . htmlentities($rpm['summary'], ENT_QUOTES) .
+ '">' . $rpmname . '</a>';
}
switch ($what) {
@@ -99,7 +99,7 @@ function report($db, $type)
$display = false;
if (count($rpms)
&& isset($rpms['devel-'])
- && $rpms['devel-']->ver != $verup
+ && $rpms['devel-']['ver'] != $verup
) {
$display = true;
}
@@ -119,13 +119,6 @@ function report($db, $type)
}
if ($display) {
- if ($rpm) {
- $package['name'] = '<a href="zoom.php?rpm=' . $rpmname .
- '" title="' . htmlentities($rpm->summary) . '">' .
- $rpmname . '</a>';
- } else {
- $package['name'] = $rpmname;
- }
if ($up['channel'] != $up['type']) {
$package['channel'] = $up['channel'];
}
@@ -136,8 +129,7 @@ function report($db, $type)
$package['upstream_stable'] = $up['stable'];
}
if ($up['unstable']
- && (!$up['stable']
- || $up['stable']!=$up['unstable'])
+ && (!$up['stable'] || $up['stable']!=$up['unstable'])
) {
$package['upstream_unstable'] = $up['unstable'] .
' <small>(' . $up['state'] . ')</small>';
@@ -151,9 +143,9 @@ function report($db, $type)
if ( isset($rpms[$repo['main']."-".$repo['sub']]) ) {
$rpm=$rpms[$repo['main']."-".$repo['sub']];
- $verpm=$rpm->ver;
+ $verpm = $rpm['ver'];
$pat = "/\.((beta|RC)\d*)\./i";
- if (preg_match($pat, $rpm->rel, $res)) {
+ if (preg_match($pat, $rpm['rel'], $res)) {
$verpm .= strtolower($res[1]);
}
@@ -162,14 +154,14 @@ function report($db, $type)
if ( isset($rpms[$repo['main']."-updates"]) ) {
$display .= sprintf(
"%s-%s<br/>",
- $rpm->ver,
- $rpm->rel
+ $rpm['ver'],
+ $rpm['rel']
);
} else {
$display .= sprintf(
"<strong>%s</strong>-%s<br/>",
- $rpm->ver,
- $rpm->rel
+ $rpm['ver'],
+ $rpm['rel']
);
}
if ( $verup==$verpm ) {
@@ -179,8 +171,8 @@ function report($db, $type)
case "":
$display .= sprintf(
"<strong>%s</strong>-%s<br/>",
- $rpm->ver,
- $rpm->rel
+ $rpm['ver'],
+ $rpm['rel']
);
if ( $verup==$verpm ) {
$class="check";
@@ -190,8 +182,8 @@ function report($db, $type)
$display .= sprintf(
"<strong>%s</strong>-%s ".
"<small>(updates)</small><br/>",
- $rpm->ver,
- $rpm->rel
+ $rpm['ver'],
+ $rpm['rel']
);
if ( $verup==$verpm ) {
$class="check";
@@ -200,8 +192,8 @@ function report($db, $type)
case "testing":
$display .= sprintf(
"%s-%s <small>(testing)</small><br/>",
- $rpm->ver,
- $rpm->rel
+ $rpm['ver'],
+ $rpm['rel']
);
if ( $verup==$verpm ) {
$class="info";
diff --git a/smarty/templates/rpmphp/rpm.tpl b/smarty/templates/rpmphp/rpm.tpl
index b0d942f..9f9d94f 100644
--- a/smarty/templates/rpmphp/rpm.tpl
+++ b/smarty/templates/rpmphp/rpm.tpl
@@ -66,7 +66,7 @@
{foreach from=$packages item=p name=plist}
<tr class="{if $smarty.foreach.plist.iteration % 2 eq 0}even{else}odd{/if}">
<td>
- <a href="zoom.php?rpm={$p.name}" title="{$p.name}">{$p.name}</a>
+ {$p.name}
{if $p.channel}
<br/><small>channel: {$p.channel}</small>
{/if}