Bug -- if it's a new mirror, it will be dropped since trends are added
after the loop.

Signed-off-by: droy <denis.roy@eclipse.org>
diff --git a/mir_trend.php b/mir_trend.php
index 11ce067..3e59b8b 100644
--- a/mir_trend.php
+++ b/mir_trend.php
@@ -103,11 +103,11 @@
 
       # Examine all the trends for this mirror
       # mark as dropped if they have 0% success overall
-      $sql = "SELECT SUM(IF(http_status_code BETWEEN 200 AND 299, 1, 0)) / COUNT(trend_id) * 100 AS success_rate FROM mirror_trends where mirror_id = " . $myrow['mirror_id'];
+      $sql = "SELECT SUM(IF(http_status_code BETWEEN 200 AND 299, 1, 0)) / COUNT(trend_id) * 100 AS success_rate, COUNT(trend_id) AS trend_count FROM mirror_trends where mirror_id = " . $myrow['mirror_id'];
       $rs_trd = mysql_query($sql, $dbh);
       if($myrow_trd = mysql_fetch_assoc($rs_trd)) {
         echo "Overall success rate for this mirror: " . $myrow_trd['success_rate'] . "\n";
-        if($myrow_trd['success_rate'] == 0) {
+        if($myrow_trd['success_rate'] == 0 && $myrow_trd['trend_count'] > 0) {
           echo "Dropping mirror " . $myrow['mirror_id'] . "\n";
           mysql_query("UPDATE mirrors SET create_status = 'dropped' WHERE mirror_id = " . $myrow['mirror_id'], $dbh);
         }