summaryrefslogtreecommitdiffstats
path: root/rpm.php
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2010-09-19 16:52:11 +0200
committerRemi Collet <fedora@famillecollet.com>2010-09-19 16:52:11 +0200
commit13f5a889da9cd6fcb864ae0b84eb31e4e97a9d10 (patch)
tree0fcbe9725dac207e881e6c75a05421d0986ed1a8 /rpm.php
parent9689e536a9c72251fc20512f81a24b3a92a53c22 (diff)
Add 'need work' filter, fixed #88
Diffstat (limited to 'rpm.php')
-rw-r--r--rpm.php37
1 files changed, 24 insertions, 13 deletions
diff --git a/rpm.php b/rpm.php
index 37c54b5..b223130 100644
--- a/rpm.php
+++ b/rpm.php
@@ -72,6 +72,10 @@ function report($db, $type)
$package = null;
$rpmname = $upstream->name;
+ $verup = strtolower(
+ $upstream->stable ? $upstream->stable : $upstream->unstable
+ );
+
$sql2="SELECT DISTINCT owner FROM acls WHERE name = '$rpmname'";
$res2=$db->query($sql2);
$owners=array();
@@ -85,10 +89,25 @@ function report($db, $type)
$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());
+ }
switch ($what) {
+ case '%work':
+ $display = false;
+ if (count($rpms)
+ && isset($rpms['devel-'])
+ && $rpms['devel-']->ver != $verup
+ ) {
+ $display = true;
+ }
+ break;
case '%fedora':
- $display = ($rpm !== false);
+ $display = (count($rpms));
break;
case '%stable':
$display = !empty($upstream->stable);
@@ -112,12 +131,6 @@ function report($db, $type)
if ( $upstream->channel != $upstream->type ) {
$package['channel'] = $upstream->channel;
}
- $rpms=array();
- if ( $rpm ) {
- do {
- $rpms[$rpm->repo_main."-".$rpm->repo_sub]=$rpm;
- } while ($rpm = $res->fetchObject());
- }
$dispowner="";
$package['owners'] = $owners;
@@ -132,10 +145,6 @@ function report($db, $type)
' <small>(' . $upstream->state . ')</small>';
}
- $verup = strtolower(
- $upstream->stable ? $upstream->stable : $upstream->unstable
- );
-
$versions = null;
foreach ( $repos as $repomain ) {
$display="";
@@ -145,7 +154,8 @@ function report($db, $type)
$rpm=$rpms[$repo['main']."-".$repo['sub']];
$verpm=$rpm->ver;
- if (preg_match("/\.((beta|RC)\d*)\./i", $rpm->rel, $res)) {
+ $pat = "/\.((beta|RC)\d*)\./i";
+ if (preg_match($pat, $rpm->rel, $res)) {
$verpm .= strtolower($res[1]);
}
@@ -180,7 +190,8 @@ function report($db, $type)
break;
case "updates":
$display .= sprintf(
- "<strong>%s</strong>-%s <small>(updates)</small><br/>",
+ "<strong>%s</strong>-%s ".
+ "<small>(updates)</small><br/>",
$rpm->ver,
$rpm->rel
);