summaryrefslogtreecommitdiffstats
path: root/rpm.php
diff options
context:
space:
mode:
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
);