diff options
author | Remi Collet <fedora@famillecollet.com> | 2010-09-19 16:52:11 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2010-09-19 16:52:11 +0200 |
commit | 13f5a889da9cd6fcb864ae0b84eb31e4e97a9d10 (patch) | |
tree | 0fcbe9725dac207e881e6c75a05421d0986ed1a8 /rpm.php | |
parent | 9689e536a9c72251fc20512f81a24b3a92a53c22 (diff) |
Add 'need work' filter, fixed #88
Diffstat (limited to 'rpm.php')
-rw-r--r-- | rpm.php | 37 |
1 files changed, 24 insertions, 13 deletions
@@ -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 ); |