[Bugzilla] and [AppDB] add ability to mark Wine versions as 'obsolete', 'supported' or 'current'

Tony Lambregts tony.lambregts at gmail.com
Sat Oct 29 17:24:37 CDT 2005


This patch is meant to stimulate a discussion about how to deal with the 
fact we cannot reasonable support obsolete versions of wine ;^)

For example we  would like to be able to age Test Results and probably 
do not want submittions of test results or bugs that are from older 
versions of wine. On the other hand we should accept new  bug reports 
from CVS and at least our current release. Since we cannot simply delete 
old versions in bugzilla I came up the following patch.

To use this patch you need to run the following sql:

use bugs;
alter table versions add column status 
enum('obsolete','supported','current') NOT NULL default 'current';

change log: Add status ('obsolete','supported' or 'current') to versions 
table

files changed: editversions.cgi
-------------- next part --------------
Index: editversions.cgi
===================================================================
RCS file: /home/wine/bugzilla/editversions.cgi,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 editversions.cgi
--- editversions.cgi	1 Dec 2004 23:15:14 -0000	1.1.1.1
+++ editversions.cgi	29 Oct 2005 22:02:25 -0000
@@ -105,13 +105,28 @@
 # Displays the form to edit a version
 #
 
-sub EmitFormElements ($$)
+sub EmitFormElements ($$$)
 {
-    my ($product, $version) = @_;
+    my ($product, $version, $status) = @_;
+    my @aStatus = ("obsolete","supported","current");
 
     print "  <TH ALIGN=\"right\">Version:</TH>\n";
     print "  <TD><INPUT SIZE=64 MAXLENGTH=64 NAME=\"version\" VALUE=\"" .
         value_quote($version) . "\">\n";
+    print "      </TD></TR>\n";
+    print "  <TH ALIGN=\"right\">Status:</TH>\n";
+    print "<TD><select name=\"status\">\n";
+
+    for (my $i = 0; $i < @aStatus; ++$i) {
+        if ($aStatus[$i] eq $status) {
+             print "<option value=" .value_quote($aStatus[$i]). " selected>" .value_quote($aStatus[$i]). "\n";
+        }
+        else {
+             print "<option value=" .value_quote($aStatus[$i]). ">" .value_quote($aStatus[$i]). "\n";
+        }
+    }
+    print "</select></TD>\n";
+
     print "      <INPUT TYPE=HIDDEN NAME=\"product\" VALUE=\"" .
         value_quote($product) . "\"></TD>\n";
 }
@@ -173,6 +188,7 @@
 #
 my $product = trim($::FORM{product} || '');
 my $version = trim($::FORM{version} || '');
+my $status = trim($::FORM{status} || '');
 my $action  = trim($::FORM{action}  || '');
 my $localtrailer;
 if ($version) {
@@ -225,21 +241,24 @@
     CheckProduct($product);
     my $product_id = get_product_id($product);
 
-    SendSQL("SELECT value
+    SendSQL("SELECT value, status
              FROM versions
              WHERE product_id=$product_id
              ORDER BY value");
 
     print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0><TR BGCOLOR=\"#6666FF\">\n";
     print "  <TH ALIGN=\"left\">Edit version ...</TH>\n";
-    #print "  <TH ALIGN=\"left\">Bugs</TH>\n";
+    print "  <TH ALIGN=\"left\">Status</TH>\n";
     print "  <TH ALIGN=\"left\">Action</TH>\n";
     print "</TR>";
     while ( MoreSQLData() ) {
-        my $version = FetchOneColumn();
+        my @data = FetchSQLData();
+        my $version = $data[0];
+        my $status = $data[1]; 
+
         print "<TR>\n";
-        print "  <TD VALIGN=\"top\"><A HREF=\"editversions.cgi?product=", url_quote($product), "&version=", url_quote($version), "&action=edit\"><B>$version</B></A></TD>\n";
-        #print "  <TD VALIGN=\"top\">$bugs</TD>\n";
+        print "  <TD VALIGN=\"top\"><A HREF=\"editversions.cgi?product=", url_quote($product), "&version=", url_quote($version),"&status=", url_quote($status), "&action=edit\"><B>$version</B></A></TD>\n";
+        print "  <TD VALIGN=\"top\">" ,$status, "</TD>\n";
         print "  <TD VALIGN=\"top\"><A HREF=\"editversions.cgi?product=", url_quote($product), "&version=", url_quote($version), "&action=del\"><B>Delete</B></A></TD>\n";
         print "</TR>";
     }
@@ -271,7 +290,7 @@
     print "<FORM METHOD=POST ACTION=editversions.cgi>\n";
     print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n";
 
-    EmitFormElements($product, $version);
+    EmitFormElements($product, $version, $status);
 
     print "</TABLE>\n<HR>\n";
     print "<INPUT TYPE=SUBMIT VALUE=\"Add\">\n";
@@ -312,9 +331,9 @@
 
     # Add the new version
     SendSQL("INSERT INTO versions ( " .
-          "value, product_id" .
+          "value, status, product_id" .
           " ) VALUES ( " .
-          SqlQuote($version) . ", $product_id)");
+          SqlQuote($version) .",". SqlQuote($status) .", $product_id)");
 
     # Make versioncache flush
     unlink "data/versioncache";
@@ -467,7 +486,7 @@
     print "<FORM METHOD=POST ACTION=editversions.cgi>\n";
     print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n";
 
-    EmitFormElements($product, $version);
+    EmitFormElements($product, $version, $status );
 
     print "</TR></TABLE>\n";
 
@@ -523,13 +542,14 @@
                  delta_ts = delta_ts
                  WHERE version=" . SqlQuote($versionold) . "
                    AND product_id = $product_id");
+    }
         SendSQL("UPDATE versions
-                 SET value=" . SqlQuote($version) . "
+                 SET value=" . SqlQuote($version) .",". "status=" . SqlQuote($status) . "
                  WHERE product_id = $product_id
                    AND value=" . SqlQuote($versionold));
         unlink "data/versioncache";
         print "Updated version.<BR>\n";
-    }
+
     SendSQL("UNLOCK TABLES");
 
     PutTrailer($localtrailer);


More information about the wine-patches mailing list