/[qa]/trunk/wml/developer.wml
ViewVC logotype

Contents of /trunk/wml/developer.wml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1808 - (show annotations) (download)
Wed Jan 2 20:46:22 2008 UTC (5 years, 4 months ago) by myon
File size: 54879 byte(s)
* add DEHS report link
* fix Svnbuildstat report link
* comment out Debcheck report link (dead since 2006-11)
1 <?
2 # keep the header in php generated file
3 <protect>/*
4 +-------------------------------------------------------------------------+
5 | Copyright (C) 2002 Igor Genibel http://genibel.org/ |
6 | Copyright (C) 2005--2007 Christoph Berg <myon@debian.org> |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 +-------------------------------------------------------------------------+
18 | $Id$
19 +-------------------------------------------------------------------------+
20
21 */</protect>
22
23 //apd_set_pprof_trace();
24
25 // global variables
26 $arg_cookie = array();
27 $prefix="/org/qa.debian.org/data/ddpo/results";
28 $counter_span = 0;
29 $seen_packages = array();
30 $comaint_re = '/^(yes|no|only)$/'; // filter to check for valid input for comaint parameter
31 $filter_re = '/^[^<>&"]+$/'; // filter against special HTML characters
32
33 error_reporting(0);
34 $time = microtime();
35
36 $components = array ("main", "contrib", "non-free");
37 $dists = array("oldstable", "stable", "testing", "unstable", "experimental");
38 $subdists = array();
39 $subdists['oldstable'] = array(
40 "oldstable-security" => 0,
41 "oldstable-volatile" => "oldstable-volatile",
42 "oldstable-bpo" => "oldstable-bpo");
43 $subdists['stable'] = array(
44 "stable-incoming" => "is",
45 "security" => 0,
46 "proposed-updates" => 0,
47 "proposed-updates-new" => "pu_new",
48 "volatile" => "volatile",
49 "bpo" => "bpo");
50 $subdists['testing'] = array(
51 "testing-incoming" => "it",
52 "testing-security" => 0,
53 "testing-proposed-updates" => 0,
54 "testing-volatile" => "testing-volatile");
55 $subdists['unstable'] = array(
56 "incoming" => "iu",
57 "delayed" => "du",
58 "new" => "nu");
59 $subdists['experimental'] = array(
60 "experimental-incoming" => "ie",
61 "experimental-delayed" => "de",
62 "experimental-new" => "ne");
63
64 setlocale(LC_ALL, 'fr_FR');
65 setlocale(LC_TIME, 'C');
66 setlocale(LC_NUMERIC, 'C');
67
68 /* pick up cookies information or generate default one */
69 if (!empty($_COOKIE['columnsinfo']) and ($_GET['reset'] != 'yes'))
70 {
71 $tmp = $_COOKIE['columnsinfo'];
72 $arg_cookie = unserialize(base64_decode($tmp));
73 }else{
74 $arg_cookie = array ( bugs => 1,
75 version => 1,
76 excuses => 1,
77 watch => 1,
78 bin => 1,
79 buildd => 1,
80 problems => 1,
81 popc => 1,
82 section => 1,
83 uninstallable => 1,
84 ordering => 0,
85 uploads => 1);
86 }
87 /* add missing columns, can be removed after some time */
88 if (!in_array('mirror', array_keys($arg_cookie))) { /* 2007-08-07 */
89 $arg_cookie['mirror'] = 'http://ftp.debian.org/debian';
90 }
91 /* always set cookie with that values in order to keep it 3 months old since the last visit */
92 setcookie('columnsinfo', base64_encode(serialize($arg_cookie)), strtotime('+3 month'));
93
94
95 /* if the "reset" arg is passed, need to extract action parameter in order to store the
96 value into the new cookie */
97 if($_GET['reset'] != 'yes')
98 {
99 foreach(array_keys($_GET) as $key)
100 {
101 if (($key == 'comaint') or ($key == 'login') or ($key == 'package') or ($key == 'wnpp') or ($key == 'gpg_key') or ($key == 'popcon'))
102 {
103 continue;
104 } elseif (!strcmp($_GET[$key], "") or preg_match($filter_re, $_GET[$key])) {
105 $arg_cookie[$key] = $_GET[$key];
106 }
107 }
108 if ($_GET['set'] == 'yes') setcookie('columnsinfo', base64_encode(serialize($arg_cookie)), strtotime('+3 month'));
109 }
110
111
112 function start_output ()
113 {
114 header('Content-Type: text/html; charset="utf-8"');
115 header('Content-Script-Type: text/javascript');
116 header('Content-Style-Type: text/css');
117 header('Pragma: no-cache');
118
119 ?>
120 #use wml::templ::template title="Debian Developer's Packages Overview" author="Igor Genibel, Christoph Berg, and others"
121
122 {#style#:
123 <link rel="stylesheet" type="text/css" href="developer.css">
124 :##}
125
126 #include "collexp.wmi"
127 <?
128 }
129
130 include("common-html.php");
131
132 /* Functions used to construct the correct links in several fields (from bugs_display to stat_bug_link) */
133 function bugs_display($bug_number, $base_url)
134 {
135 $bug_link="";
136 preg_match("/(\d+)\((\d+)\)/", $bug_number, $result);
137 if (strcmp($result[1], $result[2]) == 0)
138 {
139 $bug_link = html_a($result[1], $base_url, "a");
140 }else{
141 $bug_link = html_a($result[1], "${base_url}&amp;repeatmerged=no", "a");
142 $bug_link .= " " . html_color("(", "blue") . html_a($result[2], "${base_url}&amp;repeatmerged=yes", "a") . html_color(")", "blue");
143 }
144 return $bug_link;
145 }
146
147 function printBackLink($arg) {
148 if ($arg) {
149 print html_p(html_a("Back to maintainer page", "developer.php$arg", ""));
150 } else {
151 print html_p(html_a("Back to main page", "developer.php", ""));
152 }
153 }
154
155 /* function used to display the main maintainer links in a collapsable area */
156 function print_header_entries_body($keys, $name, $comaint, $login)
157 {
158 if (!$login) /* $login is empty for tasks */
159 return;
160
161 global $counter_span;
162 // $add_comaint = "&amp;comaint=$comaint";
163
164 $counter_span += 1;
165 $title = html_b("General information");
166 /* GPG is broken
167 if ($keys == "NOID")
168 {
169 $maintainer_data = html_font("GPG key id not found!", 'size="+1" color="red"');
170 $maintainer_data .= html_blank() . html_font("(key id was not found neither in the Debian keyring nor on a public keyserver)", 'size="-2"');
171 $maintainer_data .= html_br();
172 }else{
173 $maintainer_data .= "GPG key id: ";
174 foreach (explode(",", $keys) as $key)
175 {
176 $maintainer_data .= html_small(html_a($key, "developer.php?gpg_key=" .$key . $add_comaint)) . " ";
177 }
178 $maintainer_data .= html_br();
179 }
180 */
181
182 $ulogin = urlencode($login);
183 $maintainer_data = "Bugs: " .
184 html_a("open", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=maint&amp;data=$ulogin&amp;archive=no&amp;raw=yes&amp;bug-rev=yes&amp;pend-exc=fixed&amp;pend-exc=done") . " - " .
185 html_a("RC", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=maint&amp;data=$ulogin&amp;archive=no&amp;pend-exc=done&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious") . " - " .
186 html_a("all", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?maint=$ulogin") . " - " .
187 html_a("submitted", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?submitter=$ulogin") . " - " .
188 html_a("WNPP", "wnpp.php?login=$ulogin") . " - " .
189 html_a("statistics", "http://io.debian.net/~tar/bugstats/?$ulogin") . html_br();
190
191 $initial = strtoupper(substr($login, 0, 1));
192 $maintainer_data .= "Reports: " .
193 html_a("Buildd", "http://buildd.debian.org/pkg.cgi?maint=$ulogin") . " - " .
194 html_a("Igloo", "http://people.debian.org/~igloo/status.php?email=$ulogin") . " - " .
195 html_a("Lintian", "http://lintian.debian.org/reports/maintainer/$ulogin.html") . " - " .
196 // down since 2006-11 - html_a("Checklib", "http://rerun.lefant.net/checklib/maintainers.$initial.html#$ulogin") . " - " .
197 html_a("Debtags", "http://debtags.alioth.debian.org/todo.html?maint=$ulogin") . " - " .
198 html_a("DEHS", "http://dehs.alioth.debian.org/maintainer.php?maint=$ulogin") . " - " .
199 html_a("Svnbuildstat", "http://svnbuildstat.debian.net/packages/list/$ulogin");
200 static $nm_db;
201 if (!$nm_db) $nm_db = dba_open("/org/qa.debian.org/data/nm/nmstatus.db", 'r-', 'db4');
202 if (($status = dba_fetch("status:$login", $nm_db)) and strcmp($status, "NM"))
203 $maintainer_data .= " - " . html_a("New Maintainer", "https://nm.debian.org/nmstatus.php?email=$ulogin", "", "Next step: $status");
204 $maintainer_data .= html_br();
205
206 print html_collexp($counter_span, $title, "general", false, html_small($maintainer_data));
207 }
208
209 /* Function used to display the generic information (help and display settings) */
210 function print_header_entries_top($login, $key, $name)
211 {
212 global $counter_span;
213 static $already_displayed;
214 $title = "Packages overview for $name";
215 if ($login) $title .= " &lt;$login&gt;";
216 print html_h($title, 2, "center");
217
218 if($already_displayed) return;
219
220 $counter_span += 1;
221 $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. "));
222 $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();
223 $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();
224 $display_data = html_small($display_data);
225 $display_table_th = html_th("Bugs","&amp;bugs=");
226 $display_table_th .= html_th("Version","&amp;version=");
227 $display_table_th .= html_th("Excuses","&amp;excuses=");
228 $display_table_th .= html_th("Binary" . html_br() . "Package Page","&amp;bin=");
229 $display_table_th .= html_th("Buildd","&amp;buildd=");
230 $display_table_th .= html_th("Debcheck","&amp;problems=");
231 $display_table_th .= html_th("Uninstallable","&amp;uninstallable=");
232 $display_table_th .= html_th("Popcon","&amp;popc=");
233 $display_table_th .= html_th("Watch","&amp;watch=");
234 $display_table_th .= html_th("Section","&amp;section=");
235 $display_table_th .= html_th("Ordering","&amp;ordering=");
236 $display_table_th .= html_th("Uploads","&amp;uploads=");
237
238 $display_table_tds = html_td(checkbox('bugs'));
239 $display_table_tds .= html_td(checkbox('version'));
240 $display_table_tds .= html_td(checkbox('excuses'));
241 $display_table_tds .= html_td(checkbox('bin'));
242 $display_table_tds .= html_td(checkbox('buildd'));
243 $display_table_tds .= html_td(checkbox('problems'));
244 $display_table_tds .= html_td(checkbox('uninstallable'));
245 $display_table_tds .= html_td(checkbox('popc'));
246 $display_table_tds .= html_td(checkbox('watch'));
247 $display_table_tds .= html_td(checkbox('section'));
248 $display_table_tds .= html_td(checkbox('ordering'));
249 $display_table_tds .= html_td(checkbox('uploads'));
250
251 $display_table_tr = html_tr($display_table_tds, "left");
252
253 $display_data .= html_table(html_tr($display_table_th), array($display_table_tr), "", "small") . html_br();
254 $display_data .= "Additionally show packages: ". html_input_text("packages", isdisplayed('packages'));
255 $display_data .= " uploaders: ". html_input_text("uploader", isdisplayed('uploader')) . html_br();
256 $display_data .= "Mirror: ". html_input_text("mirror", isdisplayed('mirror')) . html_br();
257
258 $preamble = setaction() . html_input_hidden("set", "yes");
259 $display_data = html_form("developer.php", "GET", $preamble, $display_data, "Submit");
260
261 $preamble = setaction() . html_input_hidden("reset", "yes");
262 $display_data .= html_form("developer.php", "GET", $preamble, "", "Show all");
263
264 $title = html_b("Display configuration:");
265 print html_br() . html_collexp($counter_span, $title, "general", true, $display_data);
266
267 $counter_span += 1;
268 $help_data = "The description of the package is available as mouseover title from the package name. An asterisk (*) indicates the presence of co-maintainers (Uploaders: control field)" . html_br();
269 $help_data .= html_color("Blue", "blue") .
270 " packages are co-maintained by this developer" . html_br();
271 $help_data .= "The 'Bugs' columns display the real number of bugs. If there are merged bugs, the total is in parentheses" . html_br();
272 $help_data .= "Version columns are color-coded, mouseover titles show more information:" . html_br();
273 $help_data .= html_blank(). html_span("Cyan", "", "stable") .
274 ": package in stable" . html_br();
275 $help_data .= html_blank(). html_span("Red", "", "security") .
276 ": package in stable security (not shown if also in stable)" . html_br();
277 $help_data .= html_blank(). html_span("Dark blue", "", "pu") .
278 ": package in stable proposed updates (not shown if also in stable security)" . html_br();
279 $help_data .= html_blank(). html_span("Dark blue", "", "pu_new") . ": package " .
280 html_a("pending", "http://ftp-master.debian.org/proposed-updates.html") . " for stable proposed updates (not shown if also in stable security)" . html_br();
281 $help_data .= html_blank(). html_span("Light purple", "", "volatile") . ": package on " .
282 html_a("volatile.debian.org", "http://volatile.debian.org") . html_br();
283 $help_data .= html_blank(). html_span("Dark purple", "", "bpo") . ": package on " .
284 html_a("backports.org", "http://backports.org/") . html_br();
285 $help_data .= html_blank(). html_span("Purple", "", "testing") .
286 ": testing version differs from unstable version" . html_br();
287 $help_data .= html_blank(). html_span("Green", "", "unstable") .
288 ": unstable version" . html_br();
289 $help_data .= html_blank(). html_span("Red", "", "nmu") .
290 ": non-maintainer upload" . html_br();
291 $help_data .= html_blank(). html_span("Grey", "", "new") . ": version in " .
292 html_a("new", "http://ftp-master.debian.org/new.html") . html_br();
293 $help_data .= html_blank(). html_span("Orange", "", "incoming") . ": version in " .
294 html_a("incoming", "http://incoming.debian.org/") . html_br();
295 $help_data .= html_blank(). html_span("Light Red", "", "delayed") . ": version in " .
296 html_a("delayed", "http://people.debian.org/~djpig/delayed.html"). html_br();
297 $help_data .= "The 'Popcon' column displays the maximal install count for any binary in the source package" . html_br();
298 $help_data .= "Watch columns:" . html_br();
299 $help_data .= html_blank().html_blank(). html_color("green", "green") . ": upstream found version is in sync with version unstable/experimental" . html_br();
300 $help_data .= html_blank().html_blank(). html_color("magenta", "#ff00ff") . ": upstream found version is greater than version in unstable" . html_br();
301 $help_data .= html_blank().html_blank(). html_color("navy blue", "#2222AA") . ": upstream found version is lower than version in unstable (a bug in the watch file)" . html_br();
302 $help_data .= html_blank().html_blank(). html_color("error", "red") . ": uscan had problems following the watch file" . html_br();
303 $help_data .= html_blank().html_blank(). "Watch is N/A: package does not have a watch file" . html_br();
304 $help_data .= html_blank().html_blank(). "Wwiz is N/A: package does not have a copyright file suitable to automatically generate a watch file" . html_br();
305 $help_data .= html_blank().html_blank(). "Wwiz is " . html_color("notmatch", "red") . ": package had a copyright file but no useful URL download link was found to automatically generate a watch file" . html_br();
306 $help_data .= html_blank().html_blank(). html_color("no value", "grey") . ": there is a problem with the dehs database files" . html_br();
307 $help_data .= "The 'pending uploads' section shows packages uploaded/Changed-By this developer in incoming, new, and delayed" . html_br();
308 $help_data .= "The 'uploads' sections show all packages in the archive signed by this developer's key (NMUs, sponsored, QA uploads)" . html_br().html_br();
309 $help_data = html_small($help_data);
310
311 $title = html_b("Help");
312 print html_collexp($counter_span, $title, "general", true, $help_data);
313 $already_displayed = true;
314 }
315
316
317 function print_notfound($login)
318 {
319 print html_p("No information available for $login");
320 }
321
322
323 /* Construct page provided when no command is provided */
324 function print_form()
325 {
326 $form = html_h("Debian Developer's Packages Overview", 1);
327
328 $preamble = "List of packages for maintainer:" . html_br();
329 $preamble .= html_input_text("login") . html_br();
330 $preamble .= html_small("Separate multiple logins by spaces. " .
331 "Logins without @ get @debian.org appended. " .
332 "If you include an uppercase letter, search is done by maintainer name; " .
333 "only a single pattern (possibly including spaces) is accepted in that mode.") .
334 html_br();
335 $form_data = "Display co-maintained packages:" . html_blank();
336 $form_data .= html_input_radio("comaint", "yes", true, "yes");
337 $form_data .= html_input_radio("comaint", "no", false, "no");
338 $form_data .= html_input_radio("comaint", "only", false, "only") . html_br();
339 $form .= html_form("developer.php", "GET", $preamble, $form_data, "Show packages");
340
341 #$preamble = "Search based on the " . html_tt("GPG key ID:") . html_br();
342 #$preamble .= html_input_text("gpg_key");
343 #$preamble = html_label($preamble) . html_br();
344 #$form_data = "Display co-maintained packages:" . html_blank();
345 #$form_data .= html_input_radio("comaint", "yes", true, "yes");
346 #$form_data .= html_input_radio("comaint", "no", false, "no");
347 #$form_data .= html_input_radio("comaint", "only", false, "only");
348 #$form_data = html_label($form_data) .html_br();
349 #$form .= html_form("developer.php", "GET", $preamble, $form_data, "Find") . html_br();
350
351 $preamble = "List of packages for maintainer, query by source package name:" . html_br();
352 $preamble .= html_input_text("package") . html_br();
353 $form_data = "Display co-maintained packages:" . html_blank();
354 $form_data .= html_input_radio("comaint", "yes", true, "yes");
355 $form_data .= html_input_radio("comaint", "no", false, "no");
356 $form_data .= html_input_radio("comaint", "only", false, "only") . html_br();
357 $form .= html_form("developer.php", "GET", $preamble, $form_data, "Show packages");
358
359 $preamble = "Complete, sorted list of developers (600kB)" . html_br();
360 $form_data = html_input_hidden("all", "1");
361 $form .= html_form("developer.php", "GET", $preamble, $form_data, "Show developers");
362
363 $preamble = "List of packages, space separated:" . html_br();
364 $form_data = html_input_text("packages") . html_br();
365 $form .= html_form("developer.php", "GET", $preamble, $form_data, "Show packages");
366
367 $preamble = "List of packages for a task:" . html_br();
368 $form_data = html_input_text("task") . html_br();
369 $form .= html_form("developer.php", "GET", $preamble, $form_data, "Show task");
370
371 $form .= html_h("Subscribing to Packages", 2);
372 $form .= "Additional packages can be added to the list of packages shown.
373 There are two interfaces, URL and mail based.". html_br().html_br();
374 $form .= "Firstly, one can append &amp;packages=pkg1+pkg2+... to the URL,
375 or enter package names in the 'Display configuration' form. This will
376 create a new section \"url\" in the listing, independently of the
377 selected login.". html_br().html_br();
378 $form .= "Secondly, using the DDPO control bot at ".
379 html_a("ddpo@qa.debian.org", "mailto:ddpo@qa.debian.org").
380 ", packages are added to the listing for a login (mail address),
381 optionally sorted in user-defined sections. The following commands are
382 accepted:";
383 $form .= "<ul>
384 <li>user <i>address</i> <br>
385 Process commands for <i>address</i>. Defaults to the address used in the From: header. <br>
386 Example: user cb@df7cb.de
387 </li>
388 <li>subscribe <i>srcpackage</i> [<i>section</i>] <br>
389 Adds <i>srcpackage</i> to the listing. If <i>section</i> is omitted, defaults to
390 \"ddpo\". This command can also be used to move <i>srcpackage</i> to a different
391 section. <br>
392 Examples: subscribe endeavour<br>
393 subscribe rdiff-backup sponsor-panthera <br>
394 The special section \"uploader\" allows subscription to uploads made by a developer.
395 This is useful when a DD is not using their @debian.org address for their packages.
396 It is also possible to use a keyid here (8-char, prefixed by 0x; useful if
397 the account was created recently and the projectb does not know about it yet).
398 (Appending &amp;uploader= to the URL gives the same result.)
399 <br>
400 Example: subscribe myon@debian.org uploader
401 </li>
402 <li>unsubscribe <i>srcpackage</i> <br>
403 Removes the <i>srcpackage</i> from the listing. <br>
404 Example: unsubscribe libextractor
405 </li>
406 <li>which <br>
407 Print the list of subscribed packages (automatically shown after
408 subscribe/unsubscribe commands).
409 </li>
410 <li>help <br>
411 Print help text.
412 </li>
413 <li>quit <br>
414 thanks <br>
415 Stops processing commands.
416 </li>
417 </ul>";
418
419 print $form;
420 }
421
422 /* Construct the page where all maintainer are displayed */
423 function print_all()
424 {
425 global $prefix;
426 $maint = file("$prefix/ddpo_maintainers");
427 print html_h("Sorted developer list", 2);
428
429 $display_table_th = html_th("Name and Email");
430 $display_table_th .= html_th("main");
431 $display_table_th .= html_th("contrib");
432 $display_table_th .= html_th("non-free");
433 $display_table_th .= html_th("Total");
434 $trs = array();
435 foreach($maint as $line)
436 {
437 if($line != "")
438 {
439 $count = 0;
440 $line = preg_replace("/, /", ",", $line);
441 preg_match("/^;([^;]+?);([^;]+?);([^;]*?);([^;]*?);([^;]*?);([^;]*?);/", $line, $info_array);
442
443 $tds = html_td(html_a(str_replace(" ", html_blank(), "$info_array[3]") . html_blank() . "&lt;$info_array[1]&gt;", "developer.php?login=" . rawurlencode($info_array[1])));
444 $main = 0;
445 $contrib = 0;
446 $nonfree = 0;
447 if($info_array[4] != "")
448 {
449 $main += count(explode(" ", $info_array[4]));
450 $count += count(explode(" ", $info_array[4]));
451 }
452 if($info_array[5] != "")
453 {
454 $contrib += count(explode(" ", $info_array[5]));
455 $count += count(explode(" ", $info_array[5]));
456 }
457 if($info_array[6] != "")
458 {
459 $nonfree += count(explode(" ", $info_array[6]));
460 $count += count(explode(" ", $info_array[6]));
461 }
462
463 $tds .= html_td($main) . html_td($contrib) . html_td($nonfree) . html_td(html_b($count));
464 $trs[] = html_tr($tds, "center");
465 }
466 }
467 print html_table(html_tr($display_table_th), $trs, "80");
468 }
469
470 /* Small useful function to construct the link to the excuses */
471 function get_rep($package_name)
472 {
473 if(preg_match("/^lib/", $package_name)) {
474 return substr($package_name, 0, 4);
475 }else{
476 return substr($package_name, 0, 1);
477 }
478 }
479 # Begin of Dehs functions
480 function dehsdb_conn($dist)
481 {
482 $id = dba_open("/org/qa.debian.org/data/dehs/dehs_qa_" . $dist . ".db", "r", "db4");
483 return $id;
484 }
485
486 function dehsdb_xml($xml)
487 {
488 $p = xml_parser_create();
489 xml_parse_into_struct($p, $xml, $vals, $index);
490 xml_parser_free($p);
491 $values=array("id"=>$vals[$index['ID'][0]]['value'],
492 "up_version"=>$vals[$index['UP_VERSION'][0]]['value'],
493 "wwiz"=>$vals[$index['WWIZ'][0]]['value'],
494 "dversion"=>isset($index['WWIZ'])? $vals[$index['DVERSION'][0]]['value'] : '-',
495 "dversionmangled"=>isset($index['DVERSIONMANGLED'])?$vals[$index['DVERSIONMANGLED'][0]]['value'] : '-');
496 return $values;
497 }
498 function dehs_value($pkg_name,$dist)
499 {
500 static $dehsdb_unstable;
501 static $dehsdb_experimental;
502 if (!strcmp($dist, "unstable")) {
503 if (!$dehsdb_unstable) $dehsdb_unstable = dehsdb_conn($dist);
504 $id = $dehsdb_unstable;
505 } else {
506 if (!$dehsdb_experimental) $dehsdb_experimental = dehsdb_conn($dist);
507 $id = $dehsdb_experimental;
508 }
509 if(!$id) return "error";
510 if (!dba_exists($pkg_name,$id)) {
511 return array("id"=>"-","up_version"=>"-","wwiz"=>"-","dversion"=>"-","dversionmangled"=>"-");
512 }
513 $xml=dba_fetch($pkg_name,$id);
514 return dehsdb_xml($xml);
515 }
516 function vers_conv($debvers) {
517 // Strip off the epoch
518 $pos = strpos($debvers, ':');
519 if ( $pos !== FALSE) {
520 $debvers = substr($debvers, $pos+1);
521 }
522
523 // strip off the Debian revision (look from the back of the string)
524 $pos = strrpos($debvers, '-');
525 if ( $pos !== FALSE) {
526 $debvers = substr($debvers, 0, $pos);
527 }
528
529 // strip off repacking indicators
530 $debvers = preg_replace("/[-.+~]?(ds|dfsg|debian)(.*)/i", "", $debvers);
531 return $debvers;
532 }
533 function ver_comp($a,$b) {
534 exec('dpkg --compare-versions ' . escapeshellarg($a) . ' gt ' . escapeshellarg(vers_conv($b)),$output,$res);
535 if ($res==0) return 1;
536 exec('dpkg --compare-versions ' . escapeshellarg($a) . ' lt ' . escapeshellarg(vers_conv($b)),$output,$res);
537 if ($res==0) return 2;
538 else return 3;
539 }
540 function print_dehs($package,$version,$dist)
541 {
542 $dehs_values=dehs_value($package,$dist);
543 $try_wwiz = false;
544 $dehs_link = null;
545
546 // use the mangled debian version if dversion == $version
547 if ($dehs_values['dversion'] == $version && $dehs_values['dversion'] != '-') {
548 $version = ($dehs_values['dversionmangled'] != '-')? $dehs_values['dversionmangled'] : $version;
549 }
550
551 if($dehs_values == 'error') {
552 return html_td(html_color('no value', 'grey'));
553 }
554 if ($dehs_values['up_version'] == '-' || $dehs_values['up_version']=='N/A') {
555 $try_wwiz = true;
556 }
557 elseif ($dehs_values['up_version']=='Error') $color='red';
558 else {
559 $ver_comp = ver_comp($dehs_values['up_version'],$version);
560 if ($ver_comp == 1) $color='magenta';
561 else if ($ver_comp == 2) $color='#2222AA';
562 else {
563 $color='green';
564 $dehs_link='';
565 }
566 }
567 if (!$try_wwiz) {
568 if ($dehs_link === null) {
569 $dehs_link = html_br() . html_a('Details', 'http://dehs.alioth.debian.org/maintainer.php?name=' . rawurlencode($package));
570 }
571 return html_td(html_color($dehs_values['up_version'], $color) . $dehs_link, "", 1, 1);
572 }
573
574 $wwiz_link_desc='Details';
575 if ($dehs_values['wwiz']=='-' || !$dehs_values['wwiz']) {
576 $dehs_values['wwiz'] = '-';
577 $dehs_link='';
578 }
579 elseif ($dehs_values['wwiz']=='N/A') $color='black';
580 elseif (in_array($dehs_values['wwiz'], array('error', 'notmatch', 'no_cright'))) $color='red';
581 else {
582 $ver_comp = ver_comp($dehs_values['up_version'],$version);
583 $wwiz_link_desc = 'Watch';
584 if ($ver_comp == 1) $color='magenta';
585 else if ($ver_comp == 2) $color='#2222AA';
586 else {
587 $color='green';
588 }
589 }
590 if($dehs_link === null) {
591 $dehs_link = html_br() . html_a($wwiz_link_desc, 'http://dehs.alioth.debian.org/wwiz_detail.php?id=' . $dehs_values['id'] . '&amp;type=watch');
592 }
593 return html_td(html_color($dehs_values['wwiz'], $color, '', 1, 1) . $dehs_link);
594 }
595 # Check whether there is a debcheck entry for that package
596 function debcheckavailable($suite, $package_name)
597 {
598 $package = ereg_replace ("\.", "_", $package_name);
599 if(ereg ("[^a-zA-Z0-9+_-]", $package) ||
600 ($suite != "oldstable" && $suite != "stable" && $suite != "testing" && $suite != "unstable"))
601 {
602 return 0;
603 }
604 $BASEDIR='/org/qa.debian.org/data/debcheck/result/';
605 return file_exists($BASEDIR.'/'.$suite.'/packages/'.$package);
606 }
607
608 /*
609 Print possible wnpp entries and/or removal requests for this source package
610 as consise links, or nothing if there are none
611 */
612 function get_wnpp_rm($package)
613 {
614 static $db;
615 if (!$db) $db = dba_open("/org/qa.debian.org/data/bts/wnpp_rm.db", 'r-', 'db4');
616 if (!$db) return;
617 $entries = dba_fetch($package, $db);
618 if (!$entries) return;
619 $entries = explode('|', $entries);
620 $ret = "";
621 foreach ($entries as $entry) {
622 preg_match('/(\\S+)\\s+(\\S+)/', $entry, $m);
623 $ret .= "[<a href=\"http://bugs.debian.org/$m[2]\">$m[1]</a>]";
624 }
625 return $ret;
626 }
627
628 /* annotate version number with mouseover title */
629 function format_version($package, $version, $class)
630 {
631 global $uploads_db;
632 if (!$version or !strcmp($version, "-"))
633 return "-";
634 $date = dba_fetch("ud:$package:$version", $uploads_db);
635 $uploader = dba_fetch("ul:$package:$version", $uploads_db);
636 if (!$uploader)
637 $uploader = "no projectb data found";
638 $pclass = $class;
639 if(preg_match("/-[0-9]+\.[0-9]+$/", $version))
640 $class = "nmu";
641 return html_span($version, "", $class, "title=\"$pclass: $date ($uploader)\"");
642 }
643
644 /*
645 This function prints a package table information row
646 */
647 function print_package_entry($branch, $package, $uploader, $back_tr_color)
648 {
649 global $prefix;
650 global $dists;
651 global $subdists;
652 global $pack_db;
653 global $incoming_db;
654 global $seen_packages;
655
656 # skip already displayed packages
657 if(in_array($package, $seen_packages)) return "";
658 $seen_packages[] = $package;
659
660 # get package data
661 $binaries = explode(" ", dba_fetch("bin:$package", $pack_db));
662 $arch_all = !strcmp(dba_fetch("arch:$package", $pack_db), "all");
663
664 $version = array();
665 $version['oldstable'] = dba_fetch("olds:$package", $pack_db);
666 $version['oldstable-security'] = dba_fetch("olds-sec:$package", $pack_db);
667 $version['oldstable-volatile'] = dba_fetch("oldstable-volatile:$package", $incoming_db);
668 $version['oldstable-bpo'] = dba_fetch("oldstable-bpo:$package", $incoming_db);
669
670 $version['stable'] = dba_fetch("s:$package", $pack_db);
671 $version['stable-incoming'] = dba_fetch("is:$package", $incoming_db);
672 $version['security'] = dba_fetch("s-sec:$package", $pack_db);
673 $version['proposed-updates'] = dba_fetch("spu:$package", $pack_db);
674 $version['proposed-updates-new'] = dba_fetch("pu_new:$package", $incoming_db);
675 $version['volatile'] = dba_fetch("volatile:$package", $incoming_db);
676 $version['bpo'] = dba_fetch("bpo:$package", $incoming_db);
677
678 $version['testing'] = dba_fetch("t:$package", $pack_db);
679 $version['testing-incoming'] = dba_fetch("it:$package", $incoming_db);
680 $version['testing-security'] = dba_fetch("t-sec:$package", $pack_db);
681 $version['testing-proposed-updates'] = dba_fetch("tpu:$package", $pack_db);
682
683 $version['unstable'] = dba_fetch("u:$package", $pack_db);
684 $version['incoming'] = dba_fetch("iu:$package", $incoming_db);
685 $version['delayed'] = dba_fetch("du:$package", $incoming_db);
686 $version['new'] = dba_fetch("nu:$package", $incoming_db);
687
688 $version['experimental'] = dba_fetch("e:$package", $pack_db);
689 $version['experimental-incoming'] = dba_fetch("ie:$package", $incoming_db);
690 $version['experimental-delayed'] = dba_fetch("de:$package", $incoming_db);
691 $version['experimental-new'] = dba_fetch("ne:$package", $incoming_db);
692
693 $priority = dba_fetch("pri:$package", $pack_db);
694 $section = dba_fetch("sec:$package", $pack_db);
695
696 $urlpackage = rawurlencode($package);
697
698 // make $bugsdb link persistent during this pagerequest, we don't lock, so
699 // this doesn't matter at all
700 static $bugsdb;
701 if (!$bugsdb) $bugsdb = dba_open("$prefix/bugs.db", 'r-', 'db4');
702
703 if (!($bug_list = dba_fetch($package, $bugsdb))) $bug_list = '0(0) 0(0) 0(0) 0(0)';
704 $bug_list = explode(' ', $bug_list);
705
706 $pool = isdisplayed('mirror') . "/pool/";
707 if(strstr($section, "non-free"))
708 {
709 $pool .= "non-free";
710 }elseif(strstr($section, "contrib"))
711 {
712 $pool .= "contrib";
713 }else{
714 $pool .= "main";
715 }
716 $pool .= "/" . get_rep($urlpackage) . "/" . $urlpackage . "/";
717
718 /*
719 * Create output
720 */
721 static $descriptions_db;
722 if (!$descriptions_db) $descriptions_db = dba_open("$prefix/descriptions.db", 'r-', 'db4');
723 $description = htmlspecialchars(dba_fetch("d:$package", $descriptions_db));
724 if (!$description) /* use first binary if there is no binary with the source name */
725 $description = htmlspecialchars(dba_fetch("d:$binaries[0]", $descriptions_db));
726
727 if ($com_nr = dba_fetch("com:$package", $pack_db))
728 $com_nr = html_span("*", "", "", "title=\"$com_nr co-maintainer(s)\"");
729
730 $package_quoted = htmlspecialchars($package);
731 if (dba_fetch("dm:$package", $pack_db))
732 $dmpackage = html_span("[DM]", "", "", "title=\"Debian Maintainer upload allowed\"");
733 $line_data = html_b(html_span(html_a_name($package_quoted, $package_quoted), "", $uploader ? "uploader" : "", "title=\"$description\"")) .
734 $com_nr . $dmpackage .
735 get_wnpp_rm($package) . html_br() .
736 html_a("PTS", "http://packages.qa.debian.org/".get_rep($urlpackage)."/$urlpackage.html") . html_blank() .
737 html_a("Pool", $pool);
738 $line = html_td($line_data);
739
740
741 /* if bugs >= 1 always print the summary */
742 if(isdisplayed('bugs'))
743 {
744 $bugs = "http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=$urlpackage&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done";
745 $bugs_all = "http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=$urlpackage";
746 $bug_count = $bug_list[0] + $bug_list[1] + $bug_list[2] + $bug_list[3];
747 $real_bug_count = 0;
748 $bug_data = "";
749 foreach($bug_list as $bug_item)
750 {
751 preg_match("/\d+\((\d+)\)/", $bug_item, $count_array);
752 $real_bug_count += $count_array[1];
753 }
754 if($bug_count == 0)
755 {
756 $bug_data = html_a("-", $bugs_all, "dash");
757 }else{
758 $bug_data = bugs_display("$bug_count($real_bug_count)", $bugs_all);
759 }
760 $line .= html_td($bug_data);
761
762 /* user want to display all the bugs info */
763 if(isdisplayed('bugs') == 1)
764 {
765 if(!strcmp($bug_list[0], "0(0)"))
766 {
767 $bug_data = html_a("-", $bugs_all . "&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious", "dash");
768 }else{
769 $bug_data = bugs_display($bug_list[0], "$bugs" . "&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious");
770 }
771 $line .= html_td($bug_data);
772
773 if(!strcmp($bug_list[1], "0(0)"))
774 {
775 $bug_data = html_a("-", $bugs_all . "&amp;sev-inc=important&amp;sev-inc=normal", "dash");
776 }else{
777 $bug_data = bugs_display($bug_list[1], "$bugs" . "&amp;sev-inc=important&amp;sev-inc=normal");
778 }
779 $line .= html_td($bug_data);
780
781 if(!strcmp($bug_list[2], "0(0)"))
782 {
783 $bug_data = html_a("-", $bugs_all . "&amp;sev-inc=minor&amp;sev-inc=wishlist", "dash");
784 }else{
785 $bug_data = bugs_display($bug_list[2], "$bugs" . "&amp;sev-inc=minor&amp;sev-inc=wishlist");
786 }
787 $line .= html_td($bug_data);
788
789 if(!strcmp($bug_list[3], "0(0)"))
790 {
791 $bug_data = html_a("-", $bugs_all . "&amp;archive=no&amp;pend-inc=pending-fixed&amp;pend-inc=fixed", "dash");
792 }else{
793 $bug_data = bugs_display($bug_list[3], $bugs_all ."&amp;archive=no&amp;pend-inc=pending-fixed&amp;pend-inc=fixed");
794 }
795 $line .= html_td($bug_data);
796 /* user only wants summary + rc bugs count */
797 }elseif(isdisplayed('bugs') == 3)
798 {
799 if(!strcmp($bug_list[0], "0(0)"))
800 {
801 $bug_data = html_a("-", $bugs_all . "&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious", "dash");
802 }else{
803 $bug_data = bugs_display($bug_list[0], "$bugs" . "&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious");
804 }
805 $line .= html_td($bug_data);
806
807 }
808 }
809
810 if(isdisplayed('version')) {
811 $ver = "";
812 $sub = "";
813 $colspan = 0;
814 $cur_ver = "";
815 foreach ($dists as $dist) {
816 // print information from previous dists
817 if ($colspan and strcmp($version[$dist], $cur_ver)) {
818 $line .= html_td($ver . $sub, "", $colspan, 1);
819 $ver = "";
820 $sub = "";
821 $colspan = 0;
822 }
823
824 $cur_ver = $version[$dist];
825 if (strcmp($ver, "") == 0) // remember first format in multi-column display
826 $ver = format_version($package, $version[$dist], $dist);
827
828 $cur_sub = $version[$dist];
829 foreach ($subdists[$dist] as $subdist => $tag) {
830 if ($version[$subdist] and strcmp($version[$subdist], $cur_sub)) {
831 if ($tag) {
832 $url = dba_fetch("$tag-url:$package", $incoming_db);
833 $title = dba_fetch("$tag-title:$package", $incoming_db);
834 $sub .= html_br() . html_a($version[$subdist], $url, $subdist, $title);
835 } else {
836 $sub .= html_br() . format_version($package, $version[$subdist], $subdist);
837 }
838 $cur_sub = $version[$subdist];
839 }
840 }
841 $colspan++;
842 }
843 $line .= html_td($ver . $sub, "", $colspan, 1);
844 }
845
846 if(isdisplayed('excuses')) {
847 if (strcmp($version['unstable'], "-") and strcmp($version['testing'], $version['unstable'])) {
848 $excuse = html_a("Excuses", "excuses.php?package=$urlpackage") . " ";
849 $excuse .= html_a("More", "http://bjorn.haxx.se/debian/testing.pl?package=$urlpackage");
850 } else {
851 $excuse = "-";
852 }
853 $line .= html_td($excuse);
854 }
855
856 if(isdisplayed('bin'))
857 {
858 $bin_display = "";
859 for ($i = 1; $i <= count($binaries); $i++)
860 {
861 $bin_package = $binaries[$i - 1];
862 if (!$bin_package) continue;
863 $description = htmlspecialchars(dba_fetch("d:$bin_package", $descriptions_db));
864 $bin_display .= html_a($i, "http://packages.debian.org/" . rawurlencode($bin_package), "", "$bin_package - $description") . " ";
865 if (count($binaries) > 9 and $i == 7) {
866 $bin_display .= "... ";
867 $i = count($binaries) - 1;
868 continue;
869 }
870 }
871 $line .= html_td($bin_display ? $bin_display : "-");
872 }
873
874 if(isdisplayed('buildd'))
875 {
876 if ($arch_all) {
877 $buildd_display = html_td("-");
878 } else {
879 $buildd_display = html_td(
880 html_a("Buildd", "http://buildd.debian.org/build.php?pkg=$urlpackage") . html_br() .
881 html_a("More", "http://people.debian.org/~igloo/status.php?packages=$urlpackage")
882 );
883 }
884 $line .= $buildd_display;
885 }
886
887 if(isdisplayed('problems')) {
888 if(strcmp($version['stable'], "-") == 0 || !debcheckavailable('stable', $package))
889 {
890 $stable_dep = "-";
891 }else{
892 $stable_dep = html_a("St", "http://qa.debian.org/debcheck.php?dist=stable&amp;package=$urlpackage");
893 }
894
895 if(strcmp($version['testing'], "-")== 0 || !debcheckavailable('testing', $package))
896 {
897 $testing_dep = "-";
898 }else{
899 $testing_dep = html_a("Te", "http://qa.debian.org/debcheck.php?dist=testing&amp;package=$urlpackage");
900 }
901
902 if(strcmp($version['unstable'], "-")== 0 || !debcheckavailable('unstable', $package))
903 {
904 $sid_dep = "-";
905 }else{
906 $sid_dep = html_a("Un", "http://qa.debian.org/debcheck.php?dist=unstable&amp;package=$urlpackage");
907 }
908 $line .= html_td($stable_dep) . html_td($testing_dep) . html_td($sid_dep);
909 }
910
911 if(isdisplayed('uninstallable')) {
912 static $uninst_db;
913 if (!$uninst_db) $uninst_db = dba_open("$prefix/uninstallable.db", 'r-', 'db4');
914
915 $u = dba_fetch("u:stable:$package", $uninst_db);
916 $line .= html_td($u ? html_a(html_wrap2lines($u), "uninstallable.php?package=$urlpackage") : "-");
917 $u = dba_fetch("u:testing:$package", $uninst_db);
918 $line .= html_td($u ? html_a(html_wrap2lines($u), "uninstallable.php?package=$urlpackage") : "-");
919 $u = dba_fetch("u:unstable:$package", $uninst_db);
920 $line .= html_td($u ? html_a(html_wrap2lines($u), "uninstallable.php?package=$urlpackage") : "-");
921 }
922
923 if(isdisplayed('popc'))
924 {
925 static $popcon_db;
926 if (!$popcon_db) $popcon_db = dba_open("$prefix/../../popcon/popcon.db", 'r-', 'db4');
927 $popcon = dba_fetch("p:$package", $popcon_db);
928 $line .= html_td($popcon ?
929 $popcon . html_br(). html_a("More", "popcon.php?package=$urlpackage") :
930 "-");
931 }
932
933 if(isdisplayed('watch'))
934 {
935 $line .= print_dehs($package,$version['unstable'],"unstable");
936 $line .= print_dehs($package,$version['experimental'],"experimental");
937 }
938 if(isdisplayed('section')) $line .= html_td($section ? $section . html_br() . $priority : "-");
939 return html_tr($line, "center", $back_tr_color);
940 }
941
942 /*
943 This function prints a package table information for specific branch
944 given in argument
945 */
946 function print_package_entries($branch, $packages, $comaint)
947 {
948 global $prefix;
949 global $uploads_db;
950 $packages = preg_replace ("/, /", ",", $packages);
951 $pack_array = explode(" ", $packages);
952 $uploader_array = array();
953
954 # handle co-maintained packages
955 while ($package = current($pack_array)) {
956 if(strstr($package, "#")) {
957 $package = str_replace("#", "", $package);
958 $pack_array[key($pack_array)] = $package;
959 $uploader_array[$package] = 1;
960 }
961 next($pack_array);
962 }
963
964 if ((isdisplayed('ordering') == 1) or
965 ((isdisplayed('ordering') == 2) and
966 strcmp($branch, 'main') and strcmp($branch, 'contrib') and strcmp($branch, 'non-free')))
967 {
968 $pack_sort = array();
969 foreach ($pack_array as $package) {
970 $date = dba_fetch("ud:$package", $uploads_db);
971 $pack_sort[$date.$package] = $package;
972 }
973 krsort($pack_sort, SORT_STRING);
974 $pack_array = $pack_sort;
975 }
976
977 $trs = array();
978 foreach($pack_array as $package)
979 {
980 if (($uploader_array[$package] && !strcmp($comaint, "no")) ||
981 (!$uploader_array[$package] && !strcmp($comaint, "only"))) continue;
982 $tr = print_package_entry($branch, $package, $uploader_array[$package], $back_tr_color);
983 if($tr)
984 {
985 $trs[] = $tr;
986 $back_tr_color = $back_tr_color ? "" : "#dcdcdc";
987 }
988 }
989
990 if (!count($trs)) return;
991
992 print html_h(html_a_name(html_em($branch) . " (" . count($trs) . ")", $branch), 3);
993
994 /* contruct the table header */
995 $ths = html_th("Source" . html_blank(). "Name", "", 2);
996 if(isdisplayed('bugs') == 1)
997 {
998 $ths .= html_th("Bugs", "", 1, 5);
999 }elseif(isdisplayed('bugs') == 2)
1000 {
1001 $ths .= html_th("Bugs", "", 1, 1);
1002 }elseif(isdisplayed('bugs') == 3)
1003 {
1004 $ths .= html_th("Bugs", "", 1, 2);
1005 }
1006 if(isdisplayed('version')) $ths .= html_th("Version", "", 1, 5);
1007 if(isdisplayed('excuses')) $ths .= html_th(html_span("Excuses", "", "", "title=\"Raw excuse and Björn Stenberg analysis\""), "", 2, 1);
1008 if(isdisplayed('bin')) $ths .= html_th("Binary" . html_br() . "Package", "", 2, 1);
1009 if(isdisplayed('buildd')) $ths .= html_th("Buildd", "", 2, 1);
1010 if(isdisplayed('problems')) $ths .= html_th("Debcheck", "", 1, 3);
1011 if(isdisplayed('uninstallable')) $ths .= html_th("Uninstallable", "", 1, 3);
1012 if(isdisplayed('popc')) $ths .= html_th("Popcon", "", 2, 1);
1013 if(isdisplayed('watch')) $ths .= html_th("Watch", "", 1, 2);
1014 if(isdisplayed('section')) $ths .= html_th("Section" . html_br() . "Priority", "", 2, 1);
1015
1016 $th_level1 = html_tr($ths);
1017 $ths = "";
1018
1019 /* the second header line */
1020 if(isdisplayed('bugs') == 1)
1021 {
1022 $ths .= html_th(html_span("All", "", "", "title=\"All opened bugs\""));
1023 $ths .= html_th(html_span("RC", "", "", "title=\"Release Critical bugs\""));
1024 $ths .= html_th(html_span("I&amp;N", "", "", "title=\"Important &amp; Normal bugs\""));
1025 $ths .= html_th(html_span("M&amp;W", "", "", "title=\"Minor &amp; Wishlist bugs\""));
1026 $ths .= html_th(html_span("F&amp;P", "", "", "title=\"Fixed &amp; Pending bugs\""));
1027 }
1028 elseif(isdisplayed('bugs') == 2)
1029 {
1030 $ths .= html_th(html_span("All", "", "", "title=\"All opened bugs\""));
1031 }
1032 elseif(isdisplayed('bugs') == 3)
1033 {
1034 $ths .= html_th(html_span("All", "", "", "title=\"All opened bugs\""));
1035 $ths .= html_th(html_span("RC", "", "", "title=\"Release Critical bugs\""));
1036 }
1037
1038 if(isdisplayed('version'))
1039 {
1040 $ths .= html_th("Oldstable");
1041 $ths .= html_th("Stable");
1042 $ths .= html_th("Testing");
1043 $ths .= html_th("Unstable");
1044 $ths .= html_th("Exp");
1045 }
1046 if(isdisplayed('problems'))
1047 {
1048 $ths .= html_th("St");
1049 $ths .= html_th("Te");
1050 $ths .= html_th("Un");
1051 }
1052 if(isdisplayed('uninstallable'))
1053 {
1054 $ths .= html_th("St");
1055 $ths .= html_th("Te");
1056 $ths .= html_th("Un");
1057 }
1058 if(isdisplayed('watch'))
1059 {
1060 $ths .= html_th("Unstable");
1061 $ths .= html_th("Exp");
1062 }
1063
1064 $ths = $th_level1 . html_tr($ths);
1065 print html_table($ths, $trs, "", "small");
1066 }
1067
1068 function print_subscribed_packages($login, $comaint)
1069 {
1070 global $prefix;
1071 static $subscribe_db;
1072
1073 # section1:pkg1 pkg2;section2:pkg3
1074 if (!$subscribe_db) $subscribe_db = dba_open("$prefix/ddpo_subscribe.db", 'r-', 'db4');
1075
1076 $data = dba_fetch($login, $subscribe_db);
1077 if(!$data) { return; }
1078
1079 $sections = explode(";", $data);
1080 foreach($sections as $section)
1081 {
1082 if (preg_match("/^uploader:(.*)/", $section, $secarray)) {
1083 $uploaders = explode(" ", $secarray[1]);
1084 foreach ($uploaders as $uploader)
1085 print_uploaded_packages($uploader, $comaint);
1086 continue;
1087 }
1088 preg_match("/^([^:]*):(.*)/", $section, $secarray);
1089 print_package_entries($secarray[1], $secarray[2], $comaint);
1090 }
1091 }
1092
1093 function print_uploaded_packages($login, $comaint)
1094 {
1095 global $incoming_db;
1096 if (preg_match("/^0x/", $login)) {
1097 $login = strtolower($login);
1098 } elseif (!strstr($login, "@")) {
1099 $login .= "@debian.org";
1100 }
1101
1102 $packages = dba_fetch($login, $incoming_db);
1103 if($packages)
1104 print_package_entries("Pending uploads", $packages, $comaint);
1105
1106 static $wnpp_db;
1107 if (!$wnpp_db) $wnpp_db = dba_open("/org/qa.debian.org/data/bts/wnpp_by_maint.db", 'r-', 'db4');
1108 $packages = dba_fetch("op:$login", $wnpp_db);
1109 if($packages)
1110 print_package_entries("Owned WNPP bugs", $packages, $comaint);
1111
1112 $packages = dba_fetch("bpo:$login", $incoming_db);
1113 if($packages)
1114 print_package_entries("Stable backports", $packages, $comaint);
1115
1116 global $uploads_db;
1117 $packages = dba_fetch("nmu:$login", $uploads_db);
1118 if($packages)
1119 print_package_entries("Non-maintainer uploads", $packages, $comaint);
1120
1121 $packages = dba_fetch($login, $uploads_db);
1122 if($packages)
1123 print_package_entries("Sponsored uploads", $packages, $comaint);
1124
1125 $packages = dba_fetch("qa:$login", $uploads_db);
1126 if($packages)
1127 print_package_entries("QA uploads", $packages, $comaint);
1128 }
1129
1130 function print_developer($login, $key, $name, $comaint, $pack_array)
1131 {
1132 global $components;
1133 global $pack_db;
1134
1135 # reset seen packages list
1136 global $seen_packages;
1137 $seen_packages = array();
1138
1139 print_header_entries_top($login, $key, $name);
1140 print_header_entries_body($key, $name, $comaint, $login);
1141
1142 $count = 0;
1143 foreach ($components as $component) {
1144 $packages = dba_fetch("$login:$component", $pack_db);
1145 if ($packages != "") {
1146 print_package_entries($component, $packages, $comaint);
1147 $no_packages = true;
1148 } elseif (! $no_packages) {
1149 print html_h("No packages in unstable", 3);
1150 $no_packages = true;
1151 }
1152 $count += 1;
1153 }
1154 print_subscribed_packages($login, $comaint);
1155 if(isdisplayed('packages'))
1156 print_package_entries("url", isdisplayed('packages'), $comaint);
1157 if(isdisplayed('uploads'))
1158 print_uploaded_packages($login, $comaint);
1159 if(isdisplayed('uploader')) {
1160 $uploaders = explode(" ", isdisplayed('uploader'));
1161 foreach ($uploaders as $uploader)
1162 print_uploaded_packages($uploader, $comaint);
1163 }
1164 }
1165
1166 # main program
1167
1168 # open package info db
1169 # source(binary, binary)[versions]{uninstalable_stable}{_testing}{_unstable}|priority|:section:
1170 $pack_db = dba_open("$prefix/archive.db", 'r-', 'db4');
1171 $uploads_db = dba_open("$prefix/uploads.db", 'r-', 'db4');
1172 $incoming_db = dba_open("$prefix/incoming.db", 'r-', 'db4');
1173
1174 $comaint = $_REQUEST['comaint'];
1175
1176 if (! preg_match($comaint_re, $comaint)) {
1177 $comaint = "yes";
1178 }
1179
1180 if ($excuse = $_REQUEST['excuse'] and preg_match($filter_re, $excuse)) {
1181 $excuse_quoted = htmlspecialchars($excuse);
1182 header('Status: 302 Redirect');
1183 header("Location: http://qa.debian.org/excuses.php?package=$excuse_quoted");
1184 exit(0);
1185
1186 } elseif ($popcon = $_REQUEST['popcon'] and preg_match($filter_re, $popcon)) {
1187 $popcon_quoted = htmlspecialchars($popcon);
1188 header('Status: 302 Redirect');
1189 header("Location: http://qa.debian.org/popcon.php?package=$popcon_quoted");
1190 exit(0);
1191
1192 } elseif ($wnpp = $_REQUEST['wnpp'] and preg_match($filter_re, $wnpp)) {
1193 $wnpp_quoted = htmlspecialchars($wnpp);
1194 header('Status: 302 Redirect');
1195 header("Location: http://qa.debian.org/wnpp.php?login=$wnpp_quoted");
1196 exit(0);
1197
1198 /*
1199 } elseif ($gpg_key = $_REQUEST['gpg_key'] and preg_match($filter_re, $gpg_key)) {
1200 start_output();
1201 $contents = file("$prefix/ddpo_maintainers");
1202
1203 $match = 0;
1204 $gpg_key = preg_replace ("/0x/i", "", $gpg_key);
1205 foreach ($contents as $line)
1206 {
1207 if(preg_match("/^;[^;]*;[^;]*$gpg_key/i", $line))
1208 {
1209 preg_match("/^;(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*)/i", $line, $pack_array);
1210 $match += 1;
1211 print_developer($pack_array[1], $pack_array[2], $pack_array[3], $comaint, array_slice($pack_array, 4));
1212 print html_br();
1213 if($match > 10){ break; }
1214 }
1215 }
1216 if($match == 0)
1217 {
1218 print_notfound($gpg_key);
1219 }
1220 printBackLink();
1221 */
1222
1223 } elseif ($login = $_REQUEST['login'] and preg_match($filter_re, $login)) {
1224 $maint_list = array();
1225
1226 if (strstr($login, '@') or preg_match("/^[a-z0-9]+$/", $login)) { # exact match
1227 $logins = explode(' ', $login);
1228 foreach ($logins as $login) {
1229 if (!strstr($login, '@')) $login .= "@debian.org";
1230 $maint_list[] = $login;
1231 }
1232 } else { # search by name
1233 $pattern = strtolower($login);
1234 $maint_file = file("$prefix/maintainers.txt");
1235 $redirect = 1;
1236 foreach ($maint_file as $line) {
1237 if (strstr(strtolower($line), $pattern) and preg_match("/<(.*@.*)>/", $line, $arr)) {
1238 $maint_list[] = $arr[1];
1239 if (count($maint_list) >= 10) break;
1240 }
1241 }
1242 }
1243
1244 if (count($maint_list) == 0) {
1245 header('Status: 404 Not Found', FALSE, 404);
1246 start_output();
1247 print_notfound($login);
1248 } elseif ($redirect and count($maint_list) == 1) {
1249 $login = str_replace('+', '%2B', $maint_list[0]);
1250 header('Status: 302 Redirect');
1251 header("Location: http://qa.debian.org/developer.php?login=$login&comaint=$comaint");
1252 exit(0);
1253 } else {
1254 start_output();
1255 foreach ($maint_list as $login) {
1256 $name = dba_fetch("name:$login", $pack_db);
1257 $packages = dba_fetch("packages:$login", $pack_db);
1258 $pack_array = explode(';', $packages);
1259 # FIXME: this should 404 if there are no packages _and_ no uploads
1260 print_developer($login, "", $name, $comaint, $pack_array);
1261 }
1262 }
1263
1264 printBackLink();
1265
1266 } elseif($package = $_REQUEST['package'] and preg_match($filter_re, $package)) {
1267 $maint = dba_fetch("maint:$package", $pack_db);
1268 if (!$maint) {
1269 $source = dba_fetch("src:$package", $pack_db);
1270 if ($source) {
1271 $package = $source;
1272 $maint = dba_fetch("maint:$package", $pack_db);
1273 }
1274 }
1275 if ($maint) {
1276 $maint = str_replace('+', '%2B', $maint);
1277 $package_quoted = htmlspecialchars($package);
1278 header('Status: 302 Redirect');
1279 header("Location: http://qa.debian.org/developer.php?login=$maint#$package_quoted");
1280 exit(0);
1281 }
1282 header('Status: 404 Not Found', FALSE, 404);
1283 start_output();
1284 print_notfound($package);
1285 printBackLink();
1286
1287 } elseif($packages = $_REQUEST['packages'] and preg_match($filter_re, $packages)) {
1288 start_output();
1289 print_package_entries("Packages", $packages, $comaint);
1290 printBackLink();
1291
1292 } elseif($task = $_REQUEST['task'] and preg_match($filter_re, $task)) {
1293 $task_db = dba_open("$prefix/tasks.db", 'r-', 'db4');
1294 $packages = dba_fetch("t:$task", $task_db);
1295 if ($packages) {
1296 $pack_array = array();
1297 $pack_array[] = $packages;
1298 start_output();
1299 print_developer("", "", "Task: $task", $comaint, $pack_array);
1300 } else {
1301 header('Status: 404 Not Found', FALSE, 404);
1302 start_output();
1303 print_notfound("Task: $task");
1304 }
1305 printBackLink();
1306
1307 } elseif ($_REQUEST['all']) {
1308 start_output();
1309 print_all();
1310
1311 } else {
1312 start_output();
1313 print_form();
1314 }
1315
1316 print_footer();
1317 ?>
1318
1319 # vim:sw=4:ft=php:et:

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.5