Alexander Nicolaysen Sørnes : Allow selecting stable Wine versions even if they are old

Alexander Nicolaysen Sørnes asornes at winehq.org
Fri Jun 12 09:22:17 CDT 2009


Module: appdb
Branch: master
Commit: 591cf938b52f4ac74b1fb0a259346e776ce02ba1
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=591cf938b52f4ac74b1fb0a259346e776ce02ba1

Author: Alexander Nicolaysen Sørnes <alexander at linux-xqqm.site>
Date:   Thu Jun 11 22:51:02 2009 +0200

Allow selecting stable Wine versions even if they are old

---

 include/config.php.sample |    4 ++++
 include/util.php          |   25 ++++++++++++++++++-------
 2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/include/config.php.sample b/include/config.php.sample
index 4a33336..6caf756 100644
--- a/include/config.php.sample
+++ b/include/config.php.sample
@@ -33,6 +33,10 @@ define("BUGZILLA_ROOT","http://bugs.winehq.org/"); // path to bugzilla
 // How old (days) a test report has to before it is judged to be aged
 define("TESTDATA_AGED_THRESHOLD", 175);
 
+// Show versions from these branches even if they are not among the most recent ones
+// Separate by commas if there are more than one
+define("STABLE_BRANCHES", "1.0."););
+
 /*
  * apps database info
  */
diff --git a/include/util.php b/include/util.php
index bf6f8df..acdac5a 100644
--- a/include/util.php
+++ b/include/util.php
@@ -169,16 +169,27 @@ function get_bugzilla_versions()
 {
     $aVersions = array();
     $sTable = BUGZILLA_DB.".versions";
-    $sWhere = "WHERE product_id=".BUGZILLA_PRODUCT_ID;
-    $sQuery = "SELECT value FROM $sTable $sWhere ORDER BY id desc limit 6";
 
-    $hResult = query_bugzilladb($sQuery);
-    if(!$hResult) return $aVersions; // empty
+    // The empty string will fetch the most recent versions
+    $aBranches = array('');
 
-    // build the list of versions
-    while(list($sValue) = query_fetch_row($hResult))
+    // Get a list of stable branches
+    if(STABLE_BRANCHES)
+        $aBranches = array_merge($aBranches, explode(',', STABLE_BRANCHES));
+
+    foreach($aBranches as $sBranch)
     {
-        $aVersions[] = $sValue;
+        $sWhere = "WHERE product_id =".BUGZILLA_PRODUCT_ID." AND value LIKE '$sBranch%'";
+        $sQuery = "SELECT value FROM $sTable $sWhere ORDER BY id desc limit 6";
+        $hResult = query_bugzilladb($sQuery);
+        if($hResult)
+        {
+            while(list($sValue) = query_fetch_row($hResult))
+            {
+                if(!in_array($sValue, $aVersions))
+                    $aVersions[] = $sValue;
+            }
+        }
     }
 
     return $aVersions;




More information about the wine-cvs mailing list