[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#500505: marked as done (DDPO: please add a "Sections" sorting order)



Your message dated Sun, 28 Sep 2008 22:21:50 +0000
with message-id <E1Kk4eE-0002Os-9n@alioth.debian.org>
and subject line qa.debian.org bug fixed in revision 1994
has caused the Debian Bug report #500505,
regarding DDPO: please add a "Sections" sorting order
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
500505: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=500505
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: qa.debian.org
Severity: wishlist
Tags: patch

Hello,
since one can subscribe to packages he does not maintain via the DDPO bot,
it'd be useful to patch the DDPO page, since it actually lists the subscribed
packages in separate sections, but *keeps* packages in main/contrib/non-free in
their sections, not in the subscribed ones.

I'm attaching two patches fixing this behaviour:

1) developer_top.wml.patch -- this puts the subscribed sections at the top of
the page, thus moving main/contrib/non-free at the end of the page;

2) developer_bottom.wml.patch -- this one leaves the order as-is, and thus
needs some more control on what packages are being displayed in
main/contrib/non-free (thus, it's a bigger patch).


Kindly,
David

-- 
 . ''`.  Debian maintainer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://snipr.com/qa_page
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
--- developer.wml	2008-09-28 20:57:25.000000000 +0200
+++ developer_bottom.wml	2008-09-28 23:35:50.000000000 +0200
@@ -221,7 +221,7 @@
         $counter_span += 1;
         $display_data = html_b(html_em("You need to allow cookies if you want the configuration to be stored. If not, remember/bookmark the right URL that will be provided after submitting changes. "));
         $display_data .= "You can override the settings by providing an extra arg to the URL (e.g. &amp;buildd=1 if you want to display the buildd column). These args will not change the custom settings you defined before (the cookie is not modified)." . html_br();
-        $display_data .= "The 'Name' ordering sorts by package name, 'Date' sorts by upload date (descending), and 'N./D.' sorts by name for main/contrib/non-free packages and by date for other sections." . html_br();
+        $display_data .= "The 'Name' ordering sorts by package name, 'Date' sorts by upload date (descending), 'N./D.' sorts by name for main/contrib/non-free packages and by date for other sections, 'Section' sorts by sections first and by name secondly." . html_br();
         $display_data = html_small($display_data);
         $display_table_th = html_th("Bugs","&amp;bugs=");
         $display_table_th .= html_th("Version","&amp;version=");
@@ -1162,6 +1162,10 @@
     foreach ($components as $component) {
         $packages = dba_fetch("$login:$component", $pack_db);
         if ($packages != "") {
+            if (isdisplayed('ordering') == 3) {
+                $tmp_packages = explode(" ", $packages);
+                $packages = implode(" ", array_filter($tmp_packages, is_subscribed));
+            }
             print_package_entries($component, $packages, $comaint);
             $no_packages = true;
         } elseif (! $no_packages) {
@@ -1182,6 +1186,35 @@
     }
 }
 
+function is_subscribed($package) {
+    global $prefix;
+    global $login;
+    static $subscribe_db;
+    $ret = true;
+
+    # section1:pkg1 pkg2;section2:pkg3
+    if (!$subscribe_db) $subscribe_db = dba_open("$prefix/ddpo_subscribe.db", 'r-', 'db4');
+    
+    $data = dba_fetch($login, $subscribe_db);
+    if(!$data) { return; }
+
+    $sections = explode(";", $data);
+    foreach($sections as $section)
+    {
+        if (preg_match("/^(.*):(.*)/", $section, $secarray)) {
+            $packages = explode(" ", $secarray[2]);
+            if (in_array($package, $packages)) {
+                // for array_filter() in print_developer() to work, we return false when
+                // we encounter the package.
+                $ret = false;
+                break;
+            }
+        }
+    }
+    
+    return $ret;
+}
+
 # main program
 
 # open package info db
--- developer.wml	2008-09-28 20:57:25.000000000 +0200
+++ developer_top.wml	2008-09-28 23:38:18.000000000 +0200
@@ -221,7 +221,7 @@
         $counter_span += 1;
         $display_data = html_b(html_em("You need to allow cookies if you want the configuration to be stored. If not, remember/bookmark the right URL that will be provided after submitting changes. "));
         $display_data .= "You can override the settings by providing an extra arg to the URL (e.g. &amp;buildd=1 if you want to display the buildd column). These args will not change the custom settings you defined before (the cookie is not modified)." . html_br();
-        $display_data .= "The 'Name' ordering sorts by package name, 'Date' sorts by upload date (descending), and 'N./D.' sorts by name for main/contrib/non-free packages and by date for other sections." . html_br();
+        $display_data .= "The 'Name' ordering sorts by package name, 'Date' sorts by upload date (descending), 'N./D.' sorts by name for main/contrib/non-free packages and by date for other sections, 'Section' sorts by sections first and by name secondly." . html_br();
         $display_data = html_small($display_data);
         $display_table_th = html_th("Bugs","&amp;bugs=");
         $display_table_th .= html_th("Version","&amp;version=");
@@ -1159,6 +1159,10 @@
     print_header_entries_body($key, $name, $comaint, $login);
 
     $count = 0;
+
+    if (isdisplayed('ordering') == 3)    
+        print_subscribed_packages($login, $comaint);
+
     foreach ($components as $component) {
         $packages = dba_fetch("$login:$component", $pack_db);
         if ($packages != "") {
@@ -1170,7 +1174,8 @@
         }
         $count += 1;
     }
-    print_subscribed_packages($login, $comaint);
+    if (isdisplayed('ordering') != 3)    
+        print_subscribed_packages($login, $comaint);
     if(isdisplayed('packages'))
         print_package_entries("url", isdisplayed('packages'), $comaint);
     if(isdisplayed('uploads'))

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Version: 1994

This bug was closed by Christoph Berg (myon) in SVN revision 1994.
Note that it might take some time until the qa.debian.org code has
been updated and cronjobs have picked up changed data.

Commit message:

Add a comment about David's patch, and note that it Closes: #500505




--- End Message ---

Reply to: