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

Contents of /trunk/wml/developer.wml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1338 - (show annotations) (download)
Fri Apr 28 10:56:36 2006 UTC (7 years, 1 month ago) by myon
File size: 70126 byte(s)
use G��rkan's bug stats
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, 2006 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 header('Content-Type: text/html; charset="utf-8"');
23 header('Content-Script-Type: text/javascript');
24 header('Content-Style-Type: text/css');
25 header('Pragma: no-cache');
26
27 // global variables
28 $arg_cookie = array();
29 $prefix="/org/qa.debian.org/data/ddpo/results";
30 $counter_span = 0;
31 $seen_packages = array();
32 $filter_re = '/^[^<>&"]+$/'; // filter against special HTML characters
33
34 error_reporting(0);
35 $time = microtime();
36
37 $branch = array ("main",
38 "contrib",
39 "non-free",
40 "non-US/main",
41 "non-US/contrib",
42 "non-US/non-free" );
43
44 setlocale(LC_ALL, 'fr_FR');
45 setlocale(LC_TIME, 'C');
46 setlocale(LC_NUMERIC, 'C');
47
48 /* pick up cookies information or generate default one */
49 if (!empty($_COOKIE['columnsinfo']) and ($_GET['reset'] != 'yes'))
50 {
51 $tmp = $_COOKIE['columnsinfo'];
52 $arg_cookie = unserialize(base64_decode($tmp));
53 }else{
54 $arg_cookie = array ( bugs => 1,
55 version => 1,
56 excuses => 1,
57 watch => 1,
58 bin => 1,
59 buildd => 1,
60 problems => 1,
61 popc => 1,
62 section => 1,
63 uninstallable => 1,
64 ordering => 0,
65 uploads => 1);
66 }
67 /* add missing popc column, can be removed after some time (2005-11-16) */
68 if (!in_array('popc', array_keys($arg_cookie))) {
69 $arg_cookie['popc'] = 1;
70 }
71 if (!in_array('uploads', array_keys($arg_cookie))) {
72 $arg_cookie['uploads'] = 1;
73 }
74 if (!in_array('ordering', array_keys($arg_cookie))) { /* 2005-12-01 */
75 $arg_cookie['ordering'] = 0;
76 }
77 /* always set cookie with that values in order to keep it 3 months old since the last visit */
78 setcookie('columnsinfo', base64_encode(serialize($arg_cookie)), strtotime('+3 month'));
79
80
81 /* if the "reset" arg is passed, need to extract action parameter in order to store the
82 value into the new cookie */
83 if($_GET['reset'] != 'yes')
84 {
85 foreach(array_keys($_GET) as $key)
86 {
87 if (($key == 'comaint') or ($key == 'login') or ($key == 'package') or ($key == 'wnpp') or ($key == 'gpg_key') or ($key == 'popcon'))
88 {
89 continue;
90 } elseif (!strcmp($_GET[$key], "") or preg_match($filter_re, $_GET[$key])) {
91 $arg_cookie[$key] = $_GET[$key];
92 }
93 }
94 if ($_GET['set'] == 'yes') setcookie('columnsinfo', base64_encode(serialize($arg_cookie)), strtotime('+3 month'));
95 }
96
97 ?>
98
99
100 #use wml::templ::template title="Debian Developer's Packages Overview" author="Igor Genibel, Christoph Berg, and others"
101
102 {#style#:
103 <link rel="stylesheet" type="text/css" href="developer.css">
104 :##}
105
106 {#script#:
107 <script type="text/javascript" language="JavaScript">
108 function objectOver(x){
109 x.style.color="blue";
110 }
111 function objectOut(x){
112 x.style.color="black";
113 }
114 function collapse(x, txt){
115 var oTemp=document.getElementById("text_"+x) ;
116 var oClick=document.getElementById("click_"+x);
117
118 if(oTemp.style.display=="block"){
119 oTemp.style.display="none";
120 oClick.innerHTML=txt+"&nbsp<small>(click to expand)<\/small><br>";
121 }
122 else{
123 oTemp.style.display="block";
124 oClick.innerHTML=txt+"&nbsp<small>(click to collapse)<\/small><br>";
125 }
126 }
127 </script>
128 :##}
129
130 <?
131
132
133 /* Used to return a file line while I didn't find such a function
134 in php
135 Args:
136 $fp: opened file
137 return:
138 String: line
139 */
140 function freadline($fp)
141 {
142 $line = "";
143 do
144 {
145 $line .= fgets($fp, "10240");
146 }
147 while($line != "" && $line[strlen($line)-1] != "\n");
148 return $line;
149 }
150
151
152 /*
153 All generated page are html 4.0 and css1 compliant
154 Action:
155 print the links to w3c
156 */
157 function print_validator()
158 {
159 print '<p><a href="http://jigsaw.w3.org/css-validator/validator/?uri=qa.debian.org/developer.php"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
160 <a href="http://validator.w3.org/check?uri=referer"><img border="0" src="http://www.w3.org/Icons/valid-html40" alt="Valid HTML 4.0!" height="31" width="88"></a></p>';
161 }
162
163
164 /*
165 Print the footer information such as page generating time.
166 */
167 function print_footer()
168 {
169 global $time;
170 global $prefix;
171 $fp = fopen("$prefix/extract.date", "r");
172 $general = freadline($fp, "512");
173 fclose($fp);
174 $fp = fopen("$prefix/bugs.date", "r");
175 $bugs = freadline($fp, "512");
176 fclose($fp);
177
178 $footer .= "General information: $general (updated once per day)" . html_br();
179 $footer .= "Bug information: $bugs (updated every 15 minutes)" . html_br();
180 list($micro,$sec) = explode(' ', microtime());
181 list($smicro,$ssec) = explode(' ', $time);
182 $footer .= sprintf("Time needed to generate page: %.2fs", $sec-$ssec+$micro-$smicro);
183
184 print html_p(html_small($footer));
185 print html_hr(). print_validator();
186 }
187
188 /*
189 form function
190 Args:
191 $method: "GET" "POST"
192 $preamble: inner form data not considered as visible
193 parameters
194 $data: visible parameters
195 $name: submit button name
196 Returns:
197 an valid html form
198 */
199 function html_form($method, $preamble, $fields, $name)
200 {
201 $form = "<form method=\"$method\" action=\"developer.php\">";
202 $form .= $preamble;
203 $form .= $fields;
204 $form .= html_input_submit($name);
205 $form .= "</form>\n";
206 return $form;
207 }
208
209 /*
210 label function
211 Args:
212 $text: text to be labelized
213 Return:
214 labelized text
215 */
216 function html_label($text)
217 {
218 return "<label>$text</label>\n";
219 }
220
221 /*
222 submit button function
223 Args:
224 $name: submit button name
225 Returns:
226 a valid html submit button
227 */
228 function html_input_submit($name)
229 {
230 return "<input type=\"submit\" value=\"$name\">\n";
231 }
232
233 /*
234 text field unction
235 Args:
236 $name: the text field name
237 Returns:
238 a valid html text field
239 */
240 function html_input_text($name, $value)
241 {
242 if ($value) $value = " value=\"$value\"";
243 return "<input type=\"text\" size=\"30\" maxlength=\"40\" name=\"$name\"$value>\n";
244 }
245
246 /*
247 hidden field unction
248 Args:
249 $name: the hidden field name
250 $value: hidden field value
251 Returns:
252 a valid html hidden field
253 */
254 function html_input_hidden($name,$value)
255 {
256 return "<input type=\"hidden\" name=\"$name\" value=\"$value\">\n";
257 }
258
259 /*
260 radio button function
261 Args:
262 $name: the radio button field name
263 $value: radio button field value
264 $checked: boolean
265 $text: text to explain the radio button
266 Returns:
267 a valid html radio button
268 */
269 function html_input_radio($name,$value,$checked,$text)
270 {
271 $data = "<input type=\"radio\" name=\"$name\" value=\"$value\"";
272 if($checked) $data .= " checked";
273 $data .= ">$text";
274 return "$data\n";
275 }
276
277 /*
278 table header element
279 Args:
280 $title: header text
281 $extra: th args (align, ...)
282 $rowspan: how many rows in the table the header covers
283 $colspan: how many cols in the table the header covers
284 Returns:
285 A valid table header element
286 */
287 function html_th($title, $extra, $rowspan, $colspan)
288 {
289 if($colspan == "") $colspan = 1;
290 if($rowspan == "") $rowspan = 1;
291 if ($extra != "")
292 {
293 return "<th rowspan=\"$rowspan\" colspan=\"$colspan\">" . html_color("$title ", "green") . html_br() . html_color("($extra)", "black") . "</th>\n";
294 }else{
295 return "<th rowspan=\"$rowspan\" colspan=\"$colspan\">" . html_color($title, "green") . "</th>\n";
296 }
297 }
298
299 /*
300 table element
301 Args:
302 $data: text element
303 $width: width in %
304 $rowspan: how many rows in the table the element covers
305 $colspan: how many cols in the table the element covers
306 Returns:
307 A valid table element
308 */
309 function html_td($data, $width, $colspan, $rowspan)
310 {
311 if($colspan == "") $colspan = 1;
312 if($rowspan == "") $rowspan = 1;
313 if($width == "")
314 {
315 return "<td rowspan=\"$rowspan\" colspan=\"$colspan\">$data</td>\n";
316 }else{
317 return "<td width=\"$width\" rowspan=\"$rowspan\" colspan=\"$colspan\">$data</td>";
318 }
319 }
320
321 /*
322 table line
323 Args:
324 $data: all tds
325 $align: center, left, right
326 $bgcolor: background color
327 Returns:
328 A valid table line
329 */
330 function html_tr($data, $align, $bgcolor)
331 {
332 if($align == "") $align = "center";
333 if($bgcolor == "")
334 {
335 return "<tr align=\"$align\">$data</tr>\n";
336 }else{
337 return "<tr align=\"$align\" bgcolor=\"$bgcolor\">$data</tr>\n";
338 }
339 }
340
341 /*
342 table
343 Args:
344 $header: all table headers (a tr)
345 $data: array of data lines
346 $width: table width in %
347 Returns:
348 A valid html table
349 */
350 function html_table($header, $data, $width, $class)
351 {
352 if($width) $width = " width=\"${width}%\"";
353 if($class) $class = " class=\"$class\"";
354 $table = "<table$width$class border=\"1\" cellpadding=\"3\" cellspacing=\"1\" summary=\"\">";
355 $table .= $header ;
356 foreach ($data as $line) $table .= $line;
357 return "$table\n</table>\n";
358 }
359
360 /*
361 Html Anchor
362 Args:
363 $text: anchor text
364 $link: anchor link
365 $class: anchor class
366 $title: info bullet text
367 Returns:
368 A valid html anchor
369 */
370 function html_a($text,$link,$class, $title)
371 {
372 if($title != "") $title = " title=\"$title\"";
373 if($class != "") $class = " class=\"$class\"";
374 return "<a$class href=\"$link\"$title>$text</a>";
375 }
376
377 /*
378 Html headers
379 Args:
380 $text: header text
381 $level: header level
382 $align: header align
383 Returns:
384 A valid html header
385 */
386 function html_h($text, $level, $align)
387 {
388 if ($align == "")
389 {
390 return "<h$level>$text</h$level>\n";
391 }else{
392 return "<h$level align=\"$align\">$text</h$level>\n";
393 }
394 }
395
396 /* The following function are basic html functions (from html_tt to html_span */
397 function html_tt($text)
398 {
399 return "<tt>$text</tt>";
400 }
401
402 function html_b($text)
403 {
404 return "<b>$text</b>";
405 }
406
407 function html_u($text)
408 {
409 return "<u>$text</u>";
410 }
411
412 function html_em($text)
413 {
414 return "<em>$text</em>";
415 }
416
417 function html_p($text)
418 {
419 return "<p>$text</p>";
420 }
421
422
423 function html_blank()
424 {
425 return "&nbsp;";
426 }
427
428 function html_br()
429 {
430 return "<br>\n";
431 }
432
433 function html_hr()
434 {
435 return "<hr>\n";
436 }
437
438 function html_small($text)
439 {
440 return "<small>$text</small>";
441 }
442
443 function html_font($text, $data)
444 {
445 return "<font $data>$text</font>";
446 }
447
448 function html_color($text, $color)
449 {
450 return "<font color=\"$color\">$text</font>";
451 }
452
453 function html_div($text,$id,$class,$extra)
454 {
455 if($class != "")
456 {
457 return "<div id=\"$id\" class=\"$class\" $extra>$text</div>\n";
458 }else{
459 return "<div id=\"$id\" $extra>$text</div>\n";
460 }
461 }
462
463 function html_span($text,$id,$class,$extra)
464 {
465 if($id != "") $id = " id=\"$id\"";
466 if($class != "") $class = " class=\"$class\"";
467 return "<span$id$class $extra>$text</span>";
468 }
469
470 function html_ul($text, $class)
471 {
472 if ($class) $class = " class=\"$class\"";
473 return "<ul$class>$text</ul>";
474 }
475
476 function html_li($text)
477 {
478 return "<li>$text</li>";
479 }
480
481 function html_wrap2lines($text)
482 {
483 $list = explode(",", $text);
484 if(count($list) < 2)
485 {
486 return $text;
487 }
488 $half = (int)(count($list)/2);
489 return implode(html_blank(), array_slice($list, 0, $half)) . " " .
490 implode(html_blank(), array_slice($list, $half));
491 }
492
493
494 /*
495 This funtion is used to provide the collapsable areas and their title
496 You need to use an auto incremented number in order not to have collisions
497 when expand/collapse an area
498 You need to have a css style class named span_<something>
499 This function return a html valid block
500 */
501 function html_collexp($number, $text, $class, $collapsed, $data)
502 {
503 if($collapsed)
504 {
505 $info = html_blank() . "(click to expand)";
506 $display = "none";
507 }else{
508 $info = html_blank() . "(click to collapse)";
509 $display = "block";
510 }
511 $result = html_span($text . html_small("$info") . html_br(),"click_$number", "span_$class", "onmouseover='javascript:objectOver(this)' onmouseout='javascript:objectOut(this)' onclick='javascript:collapse($number,\"$text\")'");
512 $result .= html_div($data, "text_$number", $class, "style='margin-left:0;display:$display'") ;
513 return $result;
514 }
515
516 /*
517 Function needed to know if the columns has to be displayed or not
518 */
519 function isdisplayed($value)
520 {
521 global $arg_cookie;
522 return $arg_cookie[$value];
523 }
524
525 /*
526 This function is used for the display settings table
527 Note that there is a exception with bugs
528 */
529 function checkbox($value)
530 {
531 global $arg_cookie;
532 if($arg_cookie[$value] == 1)
533 {
534 $data = html_input_radio($value,1,true,"Show\n") . html_br();
535 $data .= html_input_radio($value,0,false,"Hide") . html_br();
536 }else{
537 $data = html_input_radio($value,1,false,"Show\n") . html_br();
538 $data .= html_input_radio($value,0,true,"Hide") . html_br();
539 }
540 /* if($value == 'version')
541 {
542 if($arg_cookie[$value] == 2)
543 {
544 $data = html_input_radio($value,1,false,"Show\n") . html_br();
545 $data .= html_input_radio($value,0,false,"Hide\n") . html_br();
546 $data .= html_input_radio($value,2,true,"Without Exp. &amp; Prop. Upt.\n") . html_br();
547 }elseif($arg_cookie[$value] == 1)
548 {
549 $data = html_input_radio($value,1,true,"Show\n") . html_br();
550 $data .= html_input_radio($value,0,false,"Hide\n") . html_br();
551 $data .= html_input_radio($value,2,false,"Without Exp. &amp; Prop. Upt.\n") . html_br();
552 }else{
553 $data = html_input_radio($value,1,false,"Show\n") . html_br();
554 $data .= html_input_radio($value,0,true,"Hide\n") . html_br();
555 $data .= html_input_radio($value,2,false,"Without Exp. &amp; Prop. Upt.\n") . html_br();
556 }
557 } */
558 if($value == 'bugs')
559 {
560 $data = html_input_radio($value,1,$arg_cookie[$value] == 1,"Show (1)\n") . html_br();
561 $data .= html_input_radio($value,0,$arg_cookie[$value] == 0,"Hide (0)\n") . html_br();
562 $data .= html_input_radio($value,2,$arg_cookie[$value] == 2,"Sum. (2)\n") . html_br();
563 $data .= html_input_radio($value,3,$arg_cookie[$value] == 3,"Sum.&amp;RC (3)\n") . html_br();
564 } elseif ($value == 'ordering') {
565 $data = html_input_radio($value,0,$arg_cookie[$value] == 0,"Name (0)\n") . html_br();
566 $data .= html_input_radio($value,1,$arg_cookie[$value] == 1,"Date (1)\n") . html_br();
567 $data .= html_input_radio($value,2,$arg_cookie[$value] == 2,"N./D. (2)\n") . html_br();
568 }
569 $data = html_color($data,"green");
570 return $data;
571 }
572
573
574 /*
575 return hidden fields with action parameters to be provided for the form validation
576 */
577 function setaction()
578 {
579 $action = "";
580 global $_GET;
581 foreach(array_keys($_GET) as $key)
582 {
583 if (($key == 'login') or ($key == 'package') or ($key == 'gpg_key') or ($key == 'comaint'))
584 {
585 $action .= html_input_hidden($key,$_GET[$key]);
586 }
587 }
588 return $action;
589 }
590
591
592 /* These functions provides links to the bts for a maintainer */
593 function bugs_nonfixed($login)
594 {
595 return html_a("Non-fixed bugs, most recent first", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=maint&amp;data=". urlencode($login) . "&amp;archive=no&amp;raw=yes&amp;bug-rev=yes&amp;pend-exc=fixed&amp;pend-exc=done");
596 }
597
598 function bugs_all_related($login)
599 {
600 return html_a("All bugs related to &lt;$login&gt;", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?maint=". urlencode($login));
601 }
602
603 function bugs_rc($login)
604 {
605 return html_a("RC Bugs related to &lt;$login&gt;", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=maint&amp;data=" . urlencode($login) . "&amp;archive=no&amp;pend-exc=done&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious");
606 }
607
608 function bugs_submitter($login)
609 {
610 return html_a("All bugs submitted by &lt;$login&gt;", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?submitter=" . urlencode($login));
611 }
612
613 /* Functions used to construct the correct links in several fields (from bugs_display to stat_bug_link) */
614 function bugs_display($bug_number, $base_url)
615 {
616 $bug_link="";
617 preg_match("/(\d+)\((\d+)\)/", $bug_number, $result);
618 if (strcmp($result[1], $result[2]) == 0)
619 {
620 $bug_link = html_a($result[1], $base_url, "a");
621 }else{
622 $bug_link = html_a($result[1], "${base_url}&amp;repeatmerged=no", "a");
623 $bug_link .= " " . html_color("(", "blue") . html_a($result[2], "${base_url}&amp;repeatmerged=yes", "a") . html_color(")", "blue");
624 }
625 return $bug_link;
626 }
627
628 function lintian_link($lintian)
629 {
630 return html_a("Lintian report", "http://lintian.debian.org/reports/m${lintian}.html");
631 }
632
633 function buildd_link($buildd, $login)
634 {
635 return html_a("Buildd report", "http://buildd.debian.org/bymaint.php?maint=$buildd") . html_blank() . html_a("Igloo's buildd report", "http://people.debian.org/~igloo/status.php?email=". urlencode($login));
636 }
637
638 function stat_bug_link($login)
639 {
640 return html_a("Bug statistics", "http://io.debian.net/~tar/bugstats/?$login");
641 //"http://www.debian.gr.jp/~kitame/maint.cgi?num=srcs&amp;limit=0&amp;showpkgs=on&amp;maint=" . . urlencode($login));
642 }
643
644
645 function printBackLink($arg) {
646 if ($arg) {
647 print html_p(html_a("Back to maintainer page", "developer.php$arg", ""));
648 } else {
649 print html_p(html_a("Back to main page", "developer.php", ""));
650 }
651 }
652
653 /* function used to display the main maintainer links in a collapsable area */
654 function print_header_entries_body($keys, $name, $comaint, $login)
655 {
656 global $counter_span;
657 global $prefix;
658 $add_comaint = "&amp;comaint=$comaint";
659 $lintian = preg_replace('/%../', "_", urlencode($name));
660 $lintian = preg_replace('/\+/', "_", $lintian);
661 $lintian = preg_replace('/-/', "_", $lintian);
662 $fp = fopen("$prefix/../../ftp/Maintainers", "r");
663 $ok = 0;
664 while(!feof($fp))
665 {
666 $line = freadline($fp, "10240");
667 if (preg_match("/$login/", $line))
668 {
669 $ok = 1;
670 $login = preg_replace('/\\\\/', '', $login);
671 if (preg_match("/$login \(/", $line))
672 {
673 $buildd=urlencode("$login ($name) ");
674 }else{
675 $buildd=urlencode("$name <$login> ");
676 }
677 }
678 if ($ok == 1 )
679 {
680 break;
681 }
682 }
683 fclose($fp);
684 $counter_span += 1;
685 $title = html_b("General information");
686 $maintainer_data = "";
687 /* GPG is broken
688 if ($keys == "NOID")
689 {
690 $maintainer_data = html_font("GPG key id not found!", 'size="+1" color="red"');
691 $maintainer_data .= html_blank() . html_font("(key id was not found neither in the Debian keyring nor on a public keyserver)", 'size="-2"');
692 $maintainer_data .= html_br();
693 }else{
694 $maintainer_data .= "GPG key id: ";
695 foreach (explode(",", $keys) as $key)
696 {
697 $maintainer_data .= html_small(html_a($key, "developer.php?gpg_key=" .$key . $add_comaint)) . " ";
698 }
699 $maintainer_data .= html_br();
700 }
701 */
702 $maintainer_data .= bugs_nonfixed($login) . html_br();
703 $maintainer_data .= bugs_all_related($login) . html_br();
704 $maintainer_data .= bugs_rc($login) . html_br();
705 $maintainer_data .= bugs_submitter($login) . html_br();
706 $maintainer_data .= lintian_link($lintian) . html_br();
707 $maintainer_data .= buildd_link($buildd, $login) . html_br();
708 $maintainer_data .= stat_bug_link($login) . html_br();
709 $maintainer_data .= html_a("WNPP bugs opened by &lt;$login&gt;", "developer.php?wnpp=$login");
710
711 print html_collexp($counter_span, $title, "general", false, html_small($maintainer_data));
712 }
713
714 /* Function used to display the generic information (help and display settings) */
715 function print_header_entries_top($login, $key, $name)
716 {
717 global $counter_span;
718 static $already_displayed;
719 print html_h("Packages overview for $name &lt;$login&gt;", 2, "center");
720
721 if($already_displayed) return;
722
723 $counter_span += 1;
724 $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. "));
725 $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();
726 $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();
727 $display_data = html_small($display_data);
728 $display_table_th = html_th("Bugs","&amp;bugs=");
729 $display_table_th .= html_th("Version","&amp;version=");
730 $display_table_th .= html_th("Excuses","&amp;excuses=");
731 $display_table_th .= html_th("Binary" . html_br() . "Package Page","&amp;bin=");
732 $display_table_th .= html_th("Buildd","&amp;buildd=");
733 $display_table_th .= html_th("Debcheck","&amp;problems=");
734 $display_table_th .= html_th("Uninstallable","&amp;uninstallable=");
735 $display_table_th .= html_th("Popcon","&amp;popc=");
736 $display_table_th .= html_th("Watch","&amp;watch=");
737 $display_table_th .= html_th("Section","&amp;section=");
738 $display_table_th .= html_th("Ordering","&amp;ordering=");
739 $display_table_th .= html_th("Uploads","&amp;uploads=");
740
741 $display_table_tds = html_td(checkbox('bugs'));
742 $display_table_tds .= html_td(checkbox('version'));
743 $display_table_tds .= html_td(checkbox('excuses'));
744 $display_table_tds .= html_td(checkbox('bin'));
745 $display_table_tds .= html_td(checkbox('buildd'));
746 $display_table_tds .= html_td(checkbox('problems'));
747 $display_table_tds .= html_td(checkbox('uninstallable'));
748 $display_table_tds .= html_td(checkbox('popc'));
749 $display_table_tds .= html_td(checkbox('watch'));
750 $display_table_tds .= html_td(checkbox('section'));
751 $display_table_tds .= html_td(checkbox('ordering'));
752 $display_table_tds .= html_td(checkbox('uploads'));
753
754 $display_table_tr = html_tr($display_table_tds, "left");
755
756 $display_data .= html_table(html_tr($display_table_th), array($display_table_tr), "", "small") . html_br();
757 $display_data .= "Additionally show packages: ". html_input_text("packages", isdisplayed('packages'));
758 $display_data .= " uploaders: ". html_input_text("uploader", isdisplayed('uploader')) . html_br();
759
760 $preamble = setaction() . html_input_hidden("set", "yes");
761 $display_data = html_form("GET", $preamble, $display_data, "Submit");
762
763 $preamble = setaction() . html_input_hidden("reset", "yes");
764 $display_data .= html_form("GET", $preamble, "", "Show all");
765
766 $title = html_b("Display configuration:");
767 print html_br() . html_collexp($counter_span, $title, "general", true, $display_data);
768
769 $counter_span += 1;
770 $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();
771 $help_data .= html_color("Blue", "blue") .
772 " packages are co-maintained by this developer" . html_br();
773 $help_data .= "The 'Bugs' columns display the real number of bugs. If there are merged bugs, the total is in parentheses" . html_br();
774 $help_data .= "Version columns are color-coded, mouseover titles show more information:" . html_br();
775 $help_data .= html_blank(). html_span("Cyan", "", "stable") .
776 ": package in stable" . html_br();
777 $help_data .= html_blank(). html_span("Red", "", "security") .
778 ": package in stable security (not shown if also in stable)" . html_br();
779 $help_data .= html_blank(). html_span("Dark blue", "", "pu") .
780 ": package in stable proposed updates (not shown if also in stable security)" . html_br();
781 $help_data .= html_blank(). html_span("Light purple", "", "volatile") . ": package on " .
782 html_a("volatile.debian.net", "http://volatile.debian.net") . html_br();
783 $help_data .= html_blank(). html_span("Dark purple", "", "bpo") . ": package on " .
784 html_a("backports.org", "http://backports.org/") . html_br();
785 $help_data .= html_blank(). html_span("Purple", "", "testing") .
786 ": testing version differs from unstable version" . html_br();
787 $help_data .= html_blank(). html_span("Purple", "", "securetesting") . ": package on " .
788 html_a("secure-testing.debian.net", "http://secure-testing-master.debian.net") . html_br();
789 $help_data .= html_blank(). html_span("Green", "", "unstable") .
790 ": unstable version" . html_br();
791 $help_data .= html_blank(). html_span("Red", "", "nmu") .
792 ": non-maintainer upload" . html_br();
793 $help_data .= html_blank(). html_span("Grey", "", "new") . ": version in " .
794 html_a("new", "http://ftp-master.debian.org/new.html") . html_br();
795 $help_data .= html_blank(). html_span("Orange", "", "incoming") . ": version in " .
796 html_a("incoming", "http://incoming.debian.org/") . html_br();
797 $help_data .= html_blank(). html_span("Light Red", "", "delayed") . ": version in " .
798 html_a("delayed", "http://people.debian.org/~djpig/delayed.html"). html_br();
799 $help_data .= "The 'Popcon' column displays the maximal install count for any binary in the source package" . html_br();
800 $help_data .= "Watch columns:" . html_br();
801 $help_data .= html_blank().html_blank(). html_color("green", "green") . ": upstream found version is in sync with version unstable/experimental" . html_br();
802 $help_data .= html_blank().html_blank(). html_color("magenta", "#ff00ff") . ": upstream found version is greater than version in unstable" . html_br();
803 $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();
804 $help_data .= html_blank().html_blank(). html_color("error", "red") . ": uscan had problems following the watch file" . html_br();
805 $help_data .= html_blank().html_blank(). "Watch is N/A: package does not have a watch file" . html_br();
806 $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();
807 $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();
808 $help_data .= html_blank().html_blank(). html_color("no value", "grey") . ": there is a problem with the dehs database files" . html_br();
809 $help_data .= "The 'pending uploads' section shows packages uploaded/Changed-By this developer in incoming, new, and delayed" . html_br();
810 $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();
811 $help_data = html_small($help_data);
812
813 $title = html_b("Help");
814 print html_collexp($counter_span, $title, "general", true, $help_data);
815 $already_displayed = true;
816 }
817
818
819 function print_notfound($login)
820 {
821 print html_h("No information available for $login", 2);
822 }
823
824
825 /* Construct page provided when no command is provided */
826 function print_form()
827 {
828 $form = html_h("Debian Developer's Packages Overview", 1);
829
830 $preamble = "Search by maintainer:" . html_br();
831 $preamble .= html_small("Separate multiple logins by spaces. " .
832 "Logins without @ get @debian.org appended. " .
833 "If you include an uppercase letter, search is done by maintainer name; " .
834 "only a single pattern (possibly including spaces) is accepted in that mode.") .
835 html_br();
836
837 $preamble .= html_input_text("login");
838 $preamble = html_label($preamble) . html_br();
839
840 $form_data = "Display co-maintained packages:" . html_blank();
841 $form_data .= html_input_radio("comaint", "yes", true, "yes");
842 $form_data .= html_input_radio("comaint", "no", false, "no");
843 $form_data .= html_input_radio("comaint", "only", false, "only");
844 $form_data = html_label($form_data) . html_br();
845
846 $form .= html_form("GET", $preamble, $form_data, "Find");
847
848 #$preamble = "Search based on the " . html_tt("GPG key ID:") . html_br();
849 #$preamble .= html_input_text("gpg_key");
850 #$preamble = html_label($preamble) . html_br();
851
852 #$form_data = "Display co-maintained packages:" . html_blank();
853 #$form_data .= html_input_radio("comaint", "yes", true, "yes");
854 #$form_data .= html_input_radio("comaint", "no", false, "no");
855 #$form_data .= html_input_radio("comaint", "only", false, "only");
856 #$form_data = html_label($form_data) .html_br();
857
858 #$form .= html_form("GET", $preamble, $form_data, "Find") . html_br();
859
860 $preamble = "Search by source package name:" . html_br();
861 $preamble .= html_input_text("package");
862 $preamble = html_label($preamble) . html_br();
863
864 $form_data = "Display co-maintained packages:" . html_blank();
865 $form_data .= html_input_radio("comaint", "yes", true, "yes");
866 $form_data .= html_input_radio("comaint", "no", false, "no");
867 $form_data .= html_input_radio("comaint", "only", false, "only");
868 $form_data = html_label($form_data) .html_br();
869
870 $form .= html_form("GET", $preamble, $form_data, "Find");
871
872 $query = "Show complete, sorted list of developers (600kB)";
873 $hidden = html_input_hidden("all", "1");
874 $form .= $query . html_form("GET", $hidden, "", "Show the list");
875
876 $form .= html_h("Subscribing to Packages", 2);
877 $form .= "Additional packages can be added to the list of packages shown.
878 There are two interfaces, URL and mail based.". html_br().html_br();
879 $form .= "Firstly, one can append &amp;packages=pkg1+pkg2+... to the URL,
880 or enter package names in the 'Display configuration' form. This will
881 create a new section \"url\" in the listing, independently of the
882 selected login.". html_br().html_br();
883 $form .= "Secondly, using the DDPO control bot at ".
884 html_a("ddpo@qa.debian.org", "mailto:ddpo@qa.debian.org").
885 ", packages are added to the listing for a login (mail address),
886 optionally sorted in user-defined sections. The following commands are
887 accepted:";
888 $form .= "<ul>
889 <li><tt>user &lt;address&gt;</tt> <br>
890 Process commands for &lt;address&gt;. Defaults to the address used in the From: header. <br>
891 Example: <tt>user cb@df7cb.de</tt>
892 </li>
893 <li><tt>subscribe &lt;srcpackage&gt; [&lt;section&gt;]</tt> <br>
894 Adds &lt;srcpackage&gt; to the listing. If &lt;section&gt; is omitted, defaults to
895 \"ddpo\". This command can also be used to move &lt;srcpackage&gt; to a different
896 section. <br>
897 Examples: <tt>subscribe endeavour</tt><br>
898 <tt>subscribe rdiff-backup sponsor-panthera</tt> <br>
899 The special section \"uploader\" allows subscription to uploads made by a developer.
900 This is useful when a DD is not using their @debian.org address for their packages.
901 (Appending &amp;uploader= to the URL gives the same result.)
902 <br>
903 Example: <tt>subscribe myon@debian.org uploader</tt>
904 </li>
905 <li><tt>unsubscribe &lt;srcpackage&gt;</tt> <br>
906 Removes the &lt;srcpackage&gt; from the listing. <br>
907 Example: <tt>unsubscribe libextractor</tt>
908 </li>
909 <li><tt>help</tt> <br>
910 Print help text.
911 </li>
912 <li><tt>quit</tt> <br>
913 <tt>thanks</tt> <br>
914 Stops processing commands.
915 </li>
916 </ul>";
917
918 $form .= "Report problems with DDPO to the ". html_a("qa.debian.org pseudopackage", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=qa.debian.org") .".";
919 print $form;
920 }
921
922 /* Construct the page where all maintainer are displayed */
923 function print_all()
924 {
925 global $prefix;
926 $maint = file("$prefix/ddpo_maintainers");
927 print html_h("Sorted developer list", 2);
928
929 $display_table_th = html_th("Name and Email");
930 $display_table_th .= html_th("main");
931 $display_table_th .= html_th("contrib");
932 $display_table_th .= html_th("non-free");
933 $display_table_th .= html_th("Total");
934 $trs = array();
935 foreach($maint as $line)
936 {
937 if($line != "")
938 {
939 $count = 0;
940 $line = preg_replace("/, /", ",", $line);
941 preg_match("/^;([^;]+?);([^;]+?);([^;]*?);([^;]*?);([^;]*?);([^;]*?);/", $line, $info_array);
942
943 $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])));
944 $main = 0;
945 $contrib = 0;
946 $nonfree = 0;
947 if($info_array[4] != "")
948 {
949 $main += count(explode(" ", $info_array[4]));
950 $count += count(explode(" ", $info_array[4]));
951 }
952 if($info_array[5] != "")
953 {
954 $contrib += count(explode(" ", $info_array[5]));
955 $count += count(explode(" ", $info_array[5]));
956 }
957 if($info_array[6] != "")
958 {
959 $nonfree += count(explode(" ", $info_array[6]));
960 $count += count(explode(" ", $info_array[6]));
961 }
962
963 $tds .= html_td($main) . html_td($contrib) . html_td($nonfree) . html_td(html_b($count));
964 $trs[] = html_tr($tds, "center");
965 }
966 }
967 print html_table(html_tr($display_table_th), $trs, "80");
968 }
969
970 /* Small useful function to construct the link to the excuses */
971 function get_rep($package_name)
972 {
973 if(preg_match("/^lib/", $package_name)) {
974 return substr($package_name, 0, 4);
975 }else{
976 return substr($package_name, 0, 1);
977 }
978 }
979 # Begin of Dehs functions
980 function dehsdb_conn ($dbname,$mode)
981 {
982 $id = dba_open($dbname, $mode, "db4");
983 return $id;
984 }
985
986 function dehsdb_xml($xml)
987 {
988 $p = xml_parser_create();
989 xml_parse_into_struct($p, $xml, $vals, $index);
990 xml_parser_free($p);
991 $values=array("id"=>$vals[1][value],"up_version"=>$vals[2][value],"wwiz"=>$vals[3][value]);
992 return $values;
993 }
994 function dehs_value($pkg_name,$dist)
995 {
996 $id = dehsdb_conn("/org/qa.debian.org/data/dehs/dehs_qa_" . $dist . ".db","r");
997 if(!$id) return "error";
998 if (!dba_exists($pkg_name,$id)) return array("id"=>"-","up_version"=>"-","wwiz"=>"-");
999 $xml=dba_fetch($pkg_name,$id);
1000 dba_close($id);
1001 return dehsdb_xml($xml);
1002 }
1003 function vers_conv($debvers) {
1004 preg_match("/(.+:)?([^-]+)(ds|dsfg|debian)/",$debvers,$matches);
1005 if (!$matches[3]) {
1006 unset($matches);
1007 preg_match("/(.+:)?([^-]+)/",$debvers,$matches);
1008 }
1009 if (substr($matches[2],-1)=='.') $matches[2]=substr($matches[2],0,-1);
1010 return $matches[2];
1011 }
1012 function ver_comp($a,$b) {
1013 exec("dpkg --compare-versions '$a' gt '" . vers_conv($b) . "'",$output,$res);
1014 if ($res==0) return 1;
1015 exec("dpkg --compare-versions '$a' lt '" . vers_conv($b) . "'",$output,$res);
1016 if ($res==0) return 2;
1017 else return 3;
1018 }
1019 function print_dehs($package,$version,$dist,$type)
1020 {
1021 $dehs_values=dehs_value($package,$dist);
1022 if($dehs_values=="error") return html_td(html_color("no value", "grey"));
1023 if ($type=="up_version")
1024 {
1025 $dehs_link= html_br() . html_a("Details", "http://dehs.alioth.debian.org/maintainer.php?name=" . rawurlencode($package));
1026 if($dehs_values[up_version]=="-")
1027 {
1028 $dehs_values[up_version] = "-";
1029 $dehs_link='';
1030 }
1031 elseif ($dehs_values[up_version]=='N/A')
1032 {
1033 $color="black";
1034 }
1035 elseif ($dehs_values[up_version]=='Error') $color="red";
1036 elseif(ver_comp($dehs_values[up_version],$version)==1) $color="magenta";
1037 elseif(ver_comp($dehs_values[up_version],$version)==2) $color="#2222AA";
1038 else {
1039 $color="green";
1040 $dehs_link='';
1041 }
1042 $upstream_print = html_td(html_color($dehs_values[up_version], $color) . $dehs_link, "", 1, 1);
1043 return $upstream_print;
1044 }else{
1045 $wwiz_link_desc="Details";
1046 if($dehs_values[wwiz]=='-' or !$dehs_values[wwiz])
1047 {
1048 $dehs_values[wwiz] = "-";
1049 $dehs_link='';
1050 }
1051 elseif ($dehs_values[wwiz]=='N/A') $color="black";
1052 elseif ($dehs_values[wwiz]=='error' OR $dehs_values[wwiz]=='notmatch') $color="red";
1053 elseif(ver_comp($dehs_values[wwiz],$version)==1)
1054 {
1055 $color="magenta";
1056 $wwiz_link_desc="Watch";
1057 }
1058 elseif(ver_comp($dehs_values[wwiz],$version)==2)
1059 {
1060 $color="#2222AA";
1061 $wwiz_link_desc="Watch";
1062 }else{
1063 $color="green";
1064 $wwiz_link_desc="Watch";
1065 }
1066 if(!isset($dehs_link))
1067 {
1068 $dehs_link= html_br() . html_a($wwiz_link_desc, "http://dehs.alioth.debian.org/wwiz_detail.php?id=" . $dehs_values[id] . "&amp;type=watch");
1069 }
1070 $wwiz_print= html_td(html_color($dehs_values[wwiz], $color, "", 1, 1));
1071 return $wwiz_print;
1072 }
1073 }
1074 # Check whether there is a debcheck entry for that package
1075 function debcheckavailable($suite, $package_name)
1076 {
1077 $package = ereg_replace ("\.", "_", $package_name);
1078 if(ereg ("[^a-zA-Z0-9+_-]", $package) ||
1079 ($suite != "oldstable" && $suite != "stable" && $suite != "testing" && $suite != "unstable"))
1080 {
1081 return 0;
1082 }
1083 $BASEDIR='/org/qa.debian.org/data/debcheck/result/';
1084 return file_exists($BASEDIR.'/'.$suite.'/packages/'.$package);
1085 }
1086
1087 /*
1088 Print possible wnpp entries and/or removal requests for this source package
1089 as consise links, or nothing if there are none
1090 */
1091 function get_wnpp_rm($package)
1092 {
1093 static $db;
1094 if (!$db) $db = dba_open("/org/qa.debian.org/data/bts/wnpp_rm.db", 'r-', 'db4');
1095 if (!$db) return;
1096 $entries = dba_fetch($package, $db);
1097 if (!$entries) return;
1098 $entries = explode('|', $entries);
1099 $ret = "";
1100 foreach ($entries as $entry) {
1101 preg_match('/(\\S+)\\s+(\\S+)/', $entry, $m);
1102 $ret .= "[<a href=\"http://bugs.debian.org/$m[2]\">$m[1]</a>]";
1103 }
1104 return $ret;
1105 }
1106
1107 /* annotate version number with mouseover title */
1108 function format_version($package, $version, $class)
1109 {
1110 global $uploads_db;
1111 if (!$version or !strcmp($version, "-"))
1112 return $version;
1113 $date = dba_fetch("ud:$package:$version", $uploads_db);
1114 $uploader = dba_fetch("ul:$package:$version", $uploads_db);
1115 if (!$uploader)
1116 $uploader = "no projectb data found";
1117 return html_span($version, "", $class, "title=\"$class: $date ($uploader)\"");
1118 }
1119
1120 /*
1121 This function prints a package table information row
1122 */
1123 function print_package_entry($branch, $package, $uploader, $back_tr_color)
1124 {
1125 global $prefix;
1126 global $pack_db;
1127 global $seen_packages;
1128
1129 # skip already displayed packages
1130 if(in_array($package, $seen_packages)) return "";
1131 $seen_packages[] = $package;
1132
1133 # get package data
1134 $packagedata = dba_fetch($package, $pack_db);
1135 preg_match("/(.+)\((.+)\)/", $packagedata, $result);
1136 $binaries = split (", ", $result[2]);
1137
1138 if(strstr($packagedata, "%"))
1139 {
1140 $arch_all = 1;
1141 $packagedata = str_replace("%", "", $packagedata);
1142 }
1143 preg_match("/(.+?)\[(.+)\]\{(.+)\}\{(.+)\}\{(.+)\}\|(.*)\|:(.*):/", $packagedata, $results);
1144 $version = $results[2];
1145 $versions = explode (",", $version);
1146 $version_stable = $versions[0];
1147 $version_testing = $versions[1];
1148 $version_unstable = $versions[2];
1149 $version_prop = $versions[3];
1150 $version_experimental = $versions[4];
1151 $security_stable = $versions[5];
1152 $security_testing = $versions[6];
1153 $uninstalable_stable = html_wrap2lines($results[3]);
1154 $uninstalable_testing = html_wrap2lines($results[4]);
1155 $uninstalable_unstable = html_wrap2lines($results[5]);
1156 $priority = $results[6];
1157 $section = $results[7];
1158
1159 $urlpackage = rawurlencode($package);
1160
1161 // make $bugsdb link persistent during this pagerequest, we don't lock, so
1162 // this doesn't matter at all
1163 static $bugsdb;
1164 if (!$bugsdb) $bugsdb = dba_open("$prefix/bugs.db", 'r-', 'db4');
1165
1166 if (!($bug_list = dba_fetch($package, $bugsdb))) $bug_list = '0(0) 0(0) 0(0) 0(0)';
1167 $bug_list = explode(' ', $bug_list);
1168
1169 if(strcmp($version_stable, "-") == 0 || !debcheckavailable('stable', $package))
1170 {
1171 $stable_dep = "-";
1172 }else{
1173 $stable_dep = html_a("St", "http://qa.debian.org/debcheck.php?dist=stable&amp;package=$urlpackage");
1174 }
1175
1176 if(strcmp($version_testing, "-")== 0 || !debcheckavailable('testing', $package))
1177 {
1178 $testing_dep = "-";
1179 }else{
1180 $testing_dep = html_a("Te", "http://qa.debian.org/debcheck.php?dist=testing&amp;package=$urlpackage");
1181 }
1182
1183 if(strcmp($version_unstable, "-")== 0 || !debcheckavailable('unstable', $package))
1184 {
1185 $sid_dep = "-";
1186 }else{
1187 $sid_dep = html_a("Un", "http://qa.debian.org/debcheck.php?dist=unstable&amp;package=$urlpackage");
1188 }
1189
1190 $buildd = "http://buildd.debian.org/build.php?pkg=$urlpackage";
1191
1192 $pool = "http://ftp.debian.org/debian/pool/";
1193 if(strstr($section, "non-free"))
1194 {
1195 $pool .= "non-free";
1196 }elseif(strstr($section, "contrib"))
1197 {
1198 $pool .= "contrib";
1199 }else{
1200 $pool .= "main";
1201 }
1202 $pool .= "/" . get_rep($urlpackage) . "/" . $urlpackage . "/";
1203
1204 # version numbers
1205 global $incoming_db;
1206
1207 $stable = format_version($package, $version_stable, "stable");
1208 if ($security_stable and strcmp($security_stable, "-") and strcmp($version_stable, $security_stable))
1209 $stableupd = html_br() . format_version($package, $security_stable, "security");
1210 if ($version_prop and strcmp($version_prop, "-") and strcmp($version_prop, $security_stable))
1211 $stableupd .= html_br() . format_version($package, $version_prop, "pu");
1212 if ($v = dba_fetch("volatile:$package", $incoming_db)) {
1213 $url = dba_fetch("volatiled:$package", $incoming_db);
1214 $stableupd .= html_br() . html_a($v, $url, "volatile");
1215 }
1216 if ($bpo = dba_fetch("bpo:$package", $incoming_db)) {
1217 $bpo_url = dba_fetch("bpod:$package", $incoming_db);
1218 $stableupd .= html_br() . html_a($bpo, $bpo_url, "bpo");
1219 }
1220
1221 $testing = format_version($package, $version_testing, "testing");
1222 if ($security_testing and strcmp($security_testing, "-"))
1223 $testingupd = html_br() . format_version($package, $security_testing, "security");
1224 if ($v = dba_fetch("secure-testing:$package", $incoming_db)) {
1225 $url = dba_fetch("secure-testingd:$package", $incoming_db);
1226 $testingupd .= html_br() . html_a($v, $url, "securetesting");
1227 }
1228
1229 $ver = explode("-", $version_unstable);
1230 if((preg_match("/(.+\..+?)$/", $ver[count($ver) - 1], $toto)) && (count($ver) != 1)) {
1231 $unstable = format_version($package, $version_unstable, "nmu");
1232 } else {
1233 $unstable = format_version($package, $version_unstable, "unstable");
1234 }
1235 if ($incoming = dba_fetch("iu:$package", $incoming_db)) {
1236 $incoming_changes = dba_fetch("iuc:$package", $incoming_db);
1237 $incoming_date = dba_fetch("iud:$package", $incoming_db);
1238 $extraqueues = html_br() . html_a($incoming, $incoming_changes, "incoming", $incoming_date);
1239 }
1240 if ($delayed = dba_fetch("du:$package", $incoming_db)) {
1241 $delayed_changes = dba_fetch("duc:$package", $incoming_db);
1242 $delayed_date = dba_fetch("dud:$package", $incoming_db);
1243 $extraqueues .= html_br() . html_a($delayed, $delayed_changes, "delayed", $delayed_date);
1244 }
1245 if ($unstable_new = dba_fetch("nu:$package", $incoming_db)) {
1246 $unstable_new_date = dba_fetch("nud:$package", $incoming_db);
1247 $extraqueues .= html_br() . html_span($unstable_new, "", "new", "title=\"$unstable_new_date\"");
1248 }
1249
1250 $experimental = format_version($package, $version_experimental, "experimental");
1251 if ($incoming = dba_fetch("ie:$package", $incoming_db)) {
1252 $incoming_changes = dba_fetch("iec:$package", $incoming_db);
1253 $incoming_date = dba_fetch("ied:$package", $incoming_db);
1254 $experimental .= html_br() . html_a($incoming, $incoming_changes, "incoming", $incoming_date);
1255 }
1256 if ($delayed = dba_fetch("de:$package", $incoming_db)) {
1257 $delayed_changes = dba_fetch("dec:$package", $incoming_db);
1258 $delayed_date = dba_fetch("ded:$package", $incoming_db);
1259 $experimental .= html_br() . html_a($delayed, $delayed_changes, "delayed", $delayed_date);
1260 }
1261 if ($exp_new = dba_fetch("ne:$package", $incoming_db)) {
1262 $exp_new_date = dba_fetch("ned:$package", $incoming_db);
1263 $experimental .= html_br() . html_span($exp_new, "", "new", "title=\"$exp_new_date\"");
1264 }
1265
1266 if (strcmp ($version_stable, $version_testing) == 0) {
1267 if (strcmp ($version_testing, $version_unstable) == 0)
1268 $version_print = html_td($stable . $stableupd . $extraqueues, "", 3, 1);
1269 else
1270 $version_print = html_td($stable . $stableupd, "", 2, 1) .
1271 html_td($unstable . $testingupd . $extraqueues);
1272 } elseif (strcmp ($version_testing, $version_unstable) == 0) {
1273 $version_print = html_td($stable . $stableupd) .
1274 html_td($unstable . $testingupd . $extraqueues, "", 2, 1);
1275 } else {
1276 if (strcmp ($version_stable, $version_unstable) == 0)
1277 $version_print = html_td($stable . $stableupd) .
1278 html_td($testing . $testingupd) .
1279 html_td($stable . $extraqueues);
1280 else
1281 $version_print = html_td($stable . $stableupd) .
1282 html_td($testing . $testingupd) .
1283 html_td($unstable . $extraqueues);
1284 }
1285 $version_print .= html_td($experimental);
1286
1287
1288 /*
1289 * Create output
1290 */
1291 $description = htmlspecialchars(dba_fetch("d:$package", $pack_db)); /* try source name first */
1292 if (!$description)
1293 $description = htmlspecialchars(dba_fetch("d:$binaries[0]", $pack_db));
1294 if ($com_nr = dba_fetch("com:$package", $pack_db))
1295 $com_nr = html_span("*", "", "", "title=\"$com_nr co-maintainer(s)\"");
1296 $line_data = html_b(html_span(htmlspecialchars($package), "", "", "title=\"$description\"")) .
1297 $com_nr .
1298 get_wnpp_rm($package) . html_br() .
1299 html_a("PTS", "http://packages.qa.debian.org/".get_rep($urlpackage)."/$urlpackage.html") . html_blank() .
1300 html_a("Pool", $pool);
1301 $line = html_td(html_color($line_data, $uploader == 1 ? "blue" : ""));
1302
1303
1304 /* if bugs >= 1 always print the summary */
1305 if(isdisplayed('bugs'))
1306 {
1307 $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";
1308 $bugs_all = "http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=$urlpackage";
1309 $bug_count = $bug_list[0] + $bug_list[1] + $bug_list[2] + $bug_list[3];
1310 $real_bug_count = 0;
1311 $bug_data = "";
1312 foreach($bug_list as $bug_item)
1313 {
1314 preg_match("/\d+\((\d+)\)/", $bug_item, $count_array);
1315 $real_bug_count += $count_array[1];
1316 }
1317 if($bug_count == 0)
1318 {
1319 $bug_data = html_a("-", $bugs_all, "dash");
1320 }else{
1321 $bug_data = bugs_display("$bug_count($real_bug_count)", $bugs_all);
1322 }
1323 $line .= html_td($bug_data);
1324
1325 /* user want to display all the bugs info */
1326 if(isdisplayed('bugs') == 1)
1327 {
1328 if(!strcmp($bug_list[0], "0(0)"))
1329 {
1330 $bug_data = html_a("-", $bugs_all . "&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious", "dash");
1331 }else{
1332 $bug_data = bugs_display($bug_list[0], "$bugs" . "&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious");
1333 }
1334 $line .= html_td($bug_data);
1335
1336 if(!strcmp($bug_list[1], "0(0)"))
1337 {
1338 $bug_data = html_a("-", $bugs_all . "&amp;sev-inc=important&amp;sev-inc=normal", "dash");
1339 }else{
1340 $bug_data = bugs_display($bug_list[1], "$bugs" . "&amp;sev-inc=important&amp;sev-inc=normal");
1341 }
1342 $line .= html_td($bug_data);
1343
1344 if(!strcmp($bug_list[2], "0(0)"))
1345 {
1346 $bug_data = html_a("-", $bugs_all . "&amp;sev-inc=minor&amp;sev-inc=wishlist", "dash");
1347 }else{
1348 $bug_data = bugs_display($bug_list[2], "$bugs" . "&amp;sev-inc=minor&amp;sev-inc=wishlist");
1349 }
1350 $line .= html_td($bug_data);
1351
1352 if(!strcmp($bug_list[3], "0(0)"))
1353 {
1354 $bug_data = html_a("-", $bugs_all . "&amp;archive=no&amp;pend-inc=pending-fixed&amp;pend-inc=fixed", "dash");
1355 }else{
1356 $bug_data = bugs_display($bug_list[3], $bugs_all ."&amp;archive=no&amp;pend-inc=pending-fixed&amp;pend-inc=fixed");
1357 }
1358 $line .= html_td($bug_data);
1359 /* user only wants summary + rc bugs count */
1360 }elseif(isdisplayed('bugs') == 3)
1361 {
1362 if(!strcmp($bug_list[0], "0(0)"))
1363 {
1364 $bug_data = html_a("-", $bugs_all . "&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious", "dash");
1365 }else{
1366 $bug_data = bugs_display($bug_list[0], "$bugs" . "&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious");
1367 }
1368 $line .= html_td($bug_data);
1369
1370 }
1371 }
1372
1373 if(isdisplayed('version')) $line .= $version_print;
1374
1375 if(isdisplayed('excuses')) {
1376 if (strcmp($version_unstable, "-") and strcmp($version_testing, $version_unstable)) {
1377 $excuse = html_a("Excuses", "developer.php?excuse=$urlpackage") . " ";
1378 $excuse .= html_a("More", "http://bjorn.haxx.se/debian/testing.pl?package=$urlpackage");
1379 } else {
1380 $excuse = "-";
1381 }
1382 $line .= html_td($excuse);
1383 }
1384
1385 if(isdisplayed('bin'))
1386 {
1387 $bin_display = "";
1388 for ($i = 1; $i <= count($binaries); $i++)
1389 {
1390 $bin_package = $binaries[$i - 1];
1391 if (!$bin_package) continue;
1392 $description = htmlspecialchars(dba_fetch("d:$bin_package", $pack_db));
1393 $bin_display .= html_a($i, "http://packages.debian.org/" . rawurlencode($bin_package), "", "$bin_package - $description") . " ";
1394 if (count($binaries) > 9 and $i == 7) {
1395 $bin_display .= "... ";
1396 $i = count($binaries) - 1;
1397 continue;
1398 }
1399 }
1400 $line .= html_td($bin_display);
1401 }
1402
1403 if(isdisplayed('buildd'))
1404 {
1405 $buildd_display = "";
1406 if(@$arch_all || preg_match("/non-free/", $branch) || (strcmp($version_unstable, "-") == 0))
1407 {
1408 $buildd_display = html_td("-");
1409 $arch_all = 0;
1410 }else{
1411 $buildd_display = html_td(html_a("Buildd", $buildd)
1412 . html_br() . html_a("More",
1413 "http://people.debian.org/~igloo/status.php?packages=$urlpackage"));
1414 }
1415 $line .= $buildd_display;
1416 }
1417
1418 if(isdisplayed('problems')) $line .= html_td($stable_dep) . html_td($testing_dep) . html_td($sid_dep);
1419 if(isdisplayed('uninstallable')) $line .= html_td($uninstalable_stable) . html_td($uninstalable_testing) . html_td($uninstalable_unstable);
1420
1421 if(isdisplayed('popc'))
1422 {
1423 $line .= html_td(dba_fetch("p:$package", $pack_db) . html_br().
1424 html_a("More", "developer.php?popcon=$urlpackage"));
1425 }
1426
1427 if(isdisplayed('watch'))
1428 {
1429 $line .= print_dehs($package,$version_unstable,"unstable","up_version");
1430 $line .= print_dehs($package,$version_unstable,"unstable","wwiz");
1431 $line .= print_dehs($package,$version_experimental,"experimental","up_version");
1432 $line .= print_dehs($package,$version_experimental,"experimental","wwiz");
1433 }
1434 if(isdisplayed('section')) $line .= html_td($section . html_br() . $priority);
1435 return html_tr($line, "center", $back_tr_color);
1436 }
1437
1438 /*
1439 This function prints a package table information for specific branch
1440 given in argument
1441 */
1442 function print_package_entries($branch, $packages, $comaint)
1443 {
1444 global $prefix;
1445 global $uploads_db;
1446 $packages = preg_replace ("/, /", ",", $packages);
1447 $pack_array = split(" ", $packages);
1448 $uploader_array = array();
1449
1450 # handle co-maintained packages
1451 while ($package = current($pack_array)) {
1452 if(strstr($package, "#")) {
1453 $package = str_replace("#", "", $package);
1454 $pack_array[key($pack_array)] = $package;
1455 $uploader_array[$package] = 1;
1456 }
1457 next($pack_array);
1458 }
1459
1460 if ((isdisplayed('ordering') == 1) or
1461 ((isdisplayed('ordering') == 2) and
1462 strcmp($branch, 'main') and strcmp($branch, 'contrib') and strcmp($branch, 'non-free')))
1463 {
1464 $pack_sort = array();
1465 foreach ($pack_array as $package) {
1466 $date = dba_fetch("ud:$package", $uploads_db);
1467 $pack_sort[$date.$package] = $package;
1468 }
1469 krsort($pack_sort, SORT_STRING);
1470 $pack_array = $pack_sort;
1471 }
1472
1473 $trs = array();
1474 foreach($pack_array as $package)
1475 {
1476 if (($uploader_array[$package] && !strcmp($comaint, "no")) ||
1477 (!$uploader_array[$package] && !strcmp($comaint, "only"))) continue;
1478 $tr = print_package_entry($branch, $package, $uploader_array[$package], $back_tr_color);
1479 if($tr)
1480 {
1481 $trs[] = $tr;
1482 $back_tr_color = $back_tr_color ? "" : "#dcdcdc";
1483 }
1484 }
1485
1486 if (!count($trs)) return;
1487
1488 print html_h(html_em($branch) . " (" . count($trs) . ")", 3);
1489
1490 /* contruct the table header */
1491 $ths = html_th("Source" . html_blank(). "Name", "", 2);
1492 if(isdisplayed('bugs') == 1)
1493 {
1494 $ths .= html_th("Bugs", "", 1, 5);
1495 }elseif(isdisplayed('bugs') == 2)
1496 {
1497 $ths .= html_th("Bugs", "", 1, 1);
1498 }elseif(isdisplayed('bugs') == 3)
1499 {
1500 $ths .= html_th("Bugs", "", 1, 2);
1501 }
1502 if(isdisplayed('version')) $ths .= html_th("Version", "", 1, 4);
1503 if(isdisplayed('excuses')) $ths .= html_th(html_span("Excuses", "", "", "title=\"Raw excuse and Björn Stenberg analysis\""), "", 2, 1);
1504 if(isdisplayed('bin')) $ths .= html_th("Binary" . html_br() . "Package Page", "", 2, 1);
1505 if(isdisplayed('buildd')) $ths .= html_th("Buildd", "", 2, 1);
1506 if(isdisplayed('problems')) $ths .= html_th("Debcheck", "", 1, 3);
1507 if(isdisplayed('uninstallable')) $ths .= html_th("Uninstallable", "", 1, 3);
1508 if(isdisplayed('popc')) $ths .= html_th("Popcon", "", 2, 1);
1509 if(isdisplayed('watch')) $ths .= html_th("Watch", "", 1, 4);
1510 if(isdisplayed('section')) $ths .= html_th("Section" . html_br() . "Priority", "", 2, 1);
1511
1512 $th_level1 = html_tr($ths);
1513 $ths = "";
1514
1515 /* the second header line */
1516 if(isdisplayed('bugs') == 1)
1517 {
1518 $ths .= html_th(html_span("All", "", "", "title=\"All opened bugs\""));
1519 $ths .= html_th(html_span("RC", "", "", "title=\"Release Critical bugs\""));
1520 $ths .= html_th(html_span("I&amp;N", "", "", "title=\"Important &amp; Normal bugs\""));
1521 $ths .= html_th(html_span("M&amp;W", "", "", "title=\"Minor &amp; Wishlist bugs\""));
1522 $ths .= html_th(html_span("F&amp;P", "", "", "title=\"Fixed &amp; Pending bugs\""));
1523 }
1524 elseif(isdisplayed('bugs') == 2)
1525 {
1526 $ths .= html_th(html_span("All", "", "", "title=\"All opened bugs\""));
1527 }
1528 elseif(isdisplayed('bugs') == 3)
1529 {
1530 $ths .= html_th(html_span("All", "", "", "title=\"All opened bugs\""));
1531 $ths .= html_th(html_span("RC", "", "", "title=\"Release Critical bugs\""));
1532 }
1533
1534 if(isdisplayed('version'))
1535 {
1536 $ths .= html_th("Stable");
1537 $ths .= html_th("Testing");
1538 $ths .= html_th("Unstable");
1539 $ths .= html_th("Exp");
1540 }
1541 if(isdisplayed('problems'))
1542 {
1543 $ths .= html_th("St");
1544 $ths .= html_th("Te");
1545 $ths .= html_th("Un");
1546 }
1547 if(isdisplayed('uninstallable'))
1548 {
1549 $ths .= html_th("St");
1550 $ths .= html_th("Te");
1551 $ths .= html_th("Un");
1552 }
1553 if(isdisplayed('watch'))
1554 {
1555 $ths .= html_th("Watch Unstable");
1556 $ths .= html_th("WWiz Unstable");
1557 $ths .= html_th("W Exp");
1558 $ths .= html_th("WW Exp");
1559 }
1560
1561 $ths = $th_level1 . html_tr($ths);
1562 print html_table($ths, $trs, "", "small");
1563 }
1564
1565 function print_subscribed_packages($login, $comaint)
1566 {
1567 global $prefix;
1568 static $subscribe_db;
1569
1570 # section1:pkg1 pkg2;section2:pkg3
1571 if (!$subscribe_db) $subscribe_db = dba_open("$prefix/ddpo_subscribe.db", 'r-', 'db4');
1572
1573 $data = dba_fetch($login, $subscribe_db);
1574 if(!$data) { return; }
1575
1576 $sections = explode(";", $data);
1577 foreach($sections as $section)
1578 {
1579 if (preg_match("/^uploader:(.*)/", $section, $secarray)) {
1580 $uploaders = explode(" ", $secarray[1]);
1581 foreach ($uploaders as $uploader)
1582 print_uploaded_packages($uploader, $comaint);
1583 continue;
1584 }
1585 preg_match("/^([^:]*):(.*)/", $section, $secarray);
1586 print_package_entries($secarray[1], $secarray[2], $comaint);
1587 }
1588 }
1589
1590 function print_uploaded_packages($login, $comaint)
1591 {
1592 global $incoming_db;
1593 if (!strstr($login, "@")) $login .= "@debian.org";
1594 $packages = dba_fetch("bpo:$login", $incoming_db);
1595 if($packages)
1596 print_package_entries("Stable backports by $login", $packages, $comaint);
1597
1598 $packages = dba_fetch($login, $incoming_db);
1599 if($packages)
1600 print_package_entries("Pending uploads by $login", $packages, $comaint);
1601
1602 global $uploads_db;
1603 $packages = dba_fetch("nmu:$login", $uploads_db);
1604 if($packages)
1605 print_package_entries("Non-maintainer uploads by $login", $packages, $comaint);
1606
1607 $packages = dba_fetch($login, $uploads_db);
1608 if($packages)
1609 print_package_entries("Sponsored uploads by $login", $packages, $comaint);
1610
1611 $packages = dba_fetch("qa:$login", $uploads_db);
1612 if($packages)
1613 print_package_entries("QA uploads by $login", $packages, $comaint);
1614 }
1615
1616 function print_developer($login, $key, $name, $comaint, $pack_array)
1617 {
1618 global $branch;
1619
1620 # reset seen packages list
1621 global $seen_packages;
1622 $seen_packages = array();
1623
1624 print_header_entries_top($login, $key, $name);
1625 print_header_entries_body($key, $name, $comaint, $login);
1626
1627 $count = 0;
1628 foreach ($branch as $value)
1629 {
1630 if($pack_array[$count] != "")
1631 {
1632 print_package_entries($value, $pack_array[$count], $comaint);
1633 $no_packages = true;
1634 }elseif(! $no_packages){
1635 print html_h("No packages in unstable", 3);
1636 $no_packages = true;
1637 }
1638 $count += 1;
1639 }
1640 print_subscribed_packages($login, $comaint);
1641 if(isdisplayed('packages'))
1642 print_package_entries("url", isdisplayed('packages'), $comaint);
1643 if(isdisplayed('uploads'))
1644 print_uploaded_packages($login, $comaint);
1645 if(isdisplayed('uploader')) {
1646 $uploaders = explode(" ", isdisplayed('uploader'));
1647 foreach ($uploaders as $uploader)
1648 print_uploaded_packages($uploader, $comaint);
1649 }
1650 }
1651
1652 # popcon
1653
1654 function print_popcon_entry($package, $back_tr_color)
1655 {
1656 global $pack_db;
1657
1658 $row = html_tr(
1659 html_td(html_b($package)) .
1660 html_td(dba_fetch("pi:$package", $pack_db)) .
1661 html_td(sprintf("%.2f%%", 100 * dba_fetch("pi:$package", $pack_db) / dba_fetch("pimax:", $pack_db))) .
1662 html_td(dba_fetch("pir:$package", $pack_db)) .
1663 html_td(dba_fetch("pv:$package", $pack_db)) .
1664 html_td(sprintf("%.2f%%", 100 * dba_fetch("pv:$package", $pack_db) / dba_fetch("pvmax:", $pack_db))) .
1665 html_td(dba_fetch("pvr:$package", $pack_db)) .
1666 html_td(dba_fetch("po:$package", $pack_db)) .
1667 html_td(sprintf("%.2f%%", 100 * dba_fetch("po:$package", $pack_db) / dba_fetch("pomax:", $pack_db))) .
1668 html_td(dba_fetch("por:$package", $pack_db)) .
1669 html_td(dba_fetch("pr:$package", $pack_db)) .
1670 html_td(sprintf("%.2f%%", 100 * dba_fetch("pr:$package", $pack_db) / dba_fetch("prmax:", $pack_db))) .
1671 html_td(dba_fetch("prr:$package", $pack_db)) .
1672 html_td(dba_fetch("pn:$package", $pack_db)) .
1673 html_td(sprintf("%.2f%%", 100 * dba_fetch("pn:$package", $pack_db) / dba_fetch("pnmax:", $pack_db))) .
1674 html_td(dba_fetch("pnr:$package", $pack_db)) .
1675 html_td(html_a("Graph", "http://people.debian.org/~igloo/popcon-graphs/index.php?packages=". rawurlencode($package))),
1676 "", $back_tr_color
1677 );
1678 return $row;
1679 }
1680
1681 function print_popcon($popcon)
1682 {
1683 global $pack_db;
1684 global $counter_span;
1685
1686 $packagedata = dba_fetch($popcon, $pack_db);
1687 if (!$packagedata) {
1688 print html_h("No Popularity contest entry for $popcon", 2);
1689 return;
1690 }
1691 preg_match("/(.+)\((.+)\)/", $packagedata, $result);
1692 $binaries = split (", ", $result[2]);
1693
1694 print html_h("Popularity contest statistics for $popcon", 2);
1695 $help = html_ul(
1696 html_li("<b>Name</b> is the package name") .
1697 html_li("<b>Inst.</b> is the number of people who installed this package") .
1698 html_li("<b>Vote</b> is the number of people who use this package regularly") .
1699 html_li("<b>Old</b> is the number of people who installed, but do not use this package regularly") .
1700 html_li("<b>Recent</b> is the number of people who upgraded this package recently") .
1701 html_li("<b>No Files</b> is the number of people whose entry did not contain enough information (atime and ctime were 0)") .
1702 html_li("Within parenthesis the number represents the number of registered popcon users that sent information about this topic"),
1703 "small");
1704 print html_collexp($counter_span, html_b("Help"), "general", true, $help);
1705
1706 $table = array();
1707 foreach ($binaries as $bin_package) {
1708 $table[] = print_popcon_entry($bin_package, $back_tr_color);
1709 $back_tr_color = $back_tr_color ? "" : "#dcdcdc";
1710 }
1711 print html_table(
1712 html_tr(
1713 html_th("Name", "", 2, 1) .
1714 html_th("Inst (". dba_fetch("pimax:", $pack_db) .")", "1st: ". dba_fetch("pimax:n", $pack_db), 1, 3) .
1715 html_th("Vote (". dba_fetch("pvmax:", $pack_db) .")", "1st: ". dba_fetch("pvmax:n", $pack_db), 1, 3) .
1716 html_th("Old (". dba_fetch("pomax:", $pack_db) .")", "1st: ". dba_fetch("pomax:n", $pack_db), 1, 3) .
1717 html_th("Recent (". dba_fetch("prmax:", $pack_db) .")", "1st: ". dba_fetch("prmax:n", $pack_db), 1, 3) .
1718 html_th("No Files (". dba_fetch("pnmax:", $pack_db) .")", "1st: ". dba_fetch("pnmax:n", $pack_db), 1, 3) .
1719 html_th("Graph", "", 2, 1)) .
1720 html_tr(
1721 html_th("Number") . html_th("%") . html_th("Rank") .
1722 html_th("Number") . html_th("%") . html_th("Rank") .
1723 html_th("Number") . html_th("%") . html_th("Rank") .
1724 html_th("Number") . html_th("%") . html_th("Rank") .
1725 html_th("Number") . html_th("%") . html_th("Rank")),
1726 $table, "", "small");
1727 }
1728
1729 # excuse
1730
1731 function print_excuse($excuse)
1732 {
1733 global $prefix;
1734 $excuses_db = dba_open("$prefix/excuses.db", 'r-', 'db4');
1735 $txt = dba_fetch($excuse, $excuses_db);
1736 if ($txt) {
1737 print $txt;
1738 } else {
1739 print html_h("No excuse for $excuse", 2);
1740 }
1741 print html_br() . html_a("More excuses", "http://bjorn.haxx.se/debian/testing.pl?package=$excuse");
1742 }
1743
1744 # get WNPP bugs
1745 function print_wnpp_entry($key)
1746 {
1747 static $wnpp_db;
1748 if (!$wnpp_db) $wnpp_db = dba_open("/org/qa.debian.org/data/bts/wnpp_by_maint.db", 'r-', 'db4');
1749 $wnpp = dba_fetch($key, $wnpp_db);
1750 # [so]:address -> (nnnnnn time title)|*
1751 if (!$wnpp) {
1752 $li = html_li("None");
1753 } else {
1754 $bugs = explode("|", $wnpp);
1755 foreach ($bugs as $bug) {
1756 preg_match("/^(\d+) (\d+) (.*)/", $bug, $result);
1757 $a = html_a("#$result[1]: $result[3]", "http://bugs.debian.org/$result[1]");
1758 $li .= html_li($a ." (". ceil((time() - $result[2])/86400) ." day(s) old)");
1759 }
1760 }
1761 print html_ul($li);
1762 }
1763
1764 # main program
1765
1766 # open package info db
1767 # source(binary, binary)[versions]{uninstalable_stable}{_testing}{_unstable}|priority|:section:
1768 $pack_db = dba_open("$prefix/ddpo_packages.db", 'r-', 'db4');
1769 $uploads_db = dba_open("$prefix/uploads.db", 'r-', 'db4');
1770 $incoming_db = dba_open("$prefix/incoming.db", 'r-', 'db4');
1771
1772 if($comaint == "")
1773 {
1774 $comaint = "yes";
1775 }
1776
1777 if (preg_match($filter_re, @$excuse)) {
1778 print_excuse($excuse);
1779 printBackLink("?package=$excuse");
1780
1781 } elseif (preg_match($filter_re, @$popcon)) {
1782 print_popcon($popcon);
1783 printBackLink("?package=$popcon");
1784
1785 } elseif (preg_match($filter_re, @$wnpp)) {
1786 if (!strstr($wnpp, "@")) $wnpp .= "@debian.org";
1787 print html_h("WNPP bugs submitted by $wnpp", 2);
1788 print_wnpp_entry("s:$wnpp");
1789 print html_h("WNPP bugs owned by $wnpp", 2);
1790 print_wnpp_entry("o:$wnpp");
1791 printBackLink("?login=$wnpp");
1792
1793 } elseif (preg_match($filter_re, @$gpg_key)) {
1794 $contents = file("$prefix/ddpo_maintainers");
1795
1796 $match = 0;
1797 $gpg_key = preg_replace ("/0x/i", "", $gpg_key);
1798 foreach ($contents as $line)
1799 {
1800 if(preg_match("/^;[^;]*;[^;]*$gpg_key/i", $line))
1801 {
1802 preg_match("/^;(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*)/i", $line, $pack_array);
1803 $match += 1;
1804 print_developer($pack_array[1], $pack_array[2], $pack_array[3], $comaint, array_slice($pack_array, 4));
1805 print html_br();
1806 if($match > 10){ break; }
1807 }
1808 }
1809 if($match == 0)
1810 {
1811 print_notfound($gpg_key);
1812 }
1813 printBackLink();
1814
1815 } elseif (preg_match($filter_re, @$login)) {
1816 if (preg_match("/[A-Z]/", $login)) { # search by name
1817 $pattern = strtolower($login);
1818 $maintainers = file("$prefix/maintainers.txt");
1819 $match = 0;
1820
1821 foreach ($maintainers as $line) {
1822 $line = strtolower($line);
1823 if (!(strstr($line, $pattern) and preg_match("/<(.*)>/", $line, $arr)))
1824 continue;
1825
1826 $lo = $arr[1];
1827 $packages = dba_fetch($lo, $pack_db);
1828 if (!$packages) {
1829 print_notfound($lo);
1830 if(isdisplayed('uploads'))
1831 print_uploaded_packages($lo, $comaint);
1832 continue;
1833 }
1834 $name = dba_fetch("name:$lo", $pack_db);
1835 $pack_array = explode(';', $packages);
1836 print_developer($lo, "", $name, $comaint, $pack_array);
1837 $match += 1;
1838
1839 if ($match > 10) break;
1840 }
1841
1842 if (!$match) print_notfound($login);
1843
1844 } else { # one or more email addresses
1845 $logins = explode(' ', $login);
1846
1847 foreach ($logins as $login) {
1848 if (!strstr($login, '@')) $login .= "@debian.org";
1849 $packages = dba_fetch($login, $pack_db);
1850 if (!$packages) {
1851 print_notfound($login);
1852 if(isdisplayed('uploads'))
1853 print_uploaded_packages($login, $comaint);
1854 continue;
1855 }
1856 $name = dba_fetch("name:$login", $pack_db);
1857 $pack_array = explode(';', $packages);
1858 print_developer($login, "", $name, $comaint, $pack_array);
1859 }
1860 }
1861
1862 printBackLink();
1863
1864 } elseif(preg_match($filter_re, @$package)) {
1865 $maint = dba_fetch("m:$package", $pack_db);
1866 if ($maint) {
1867 $name = dba_fetch("name:$maint", $pack_db);
1868 $pack_array = explode(';', dba_fetch($maint, $pack_db));
1869 print_developer($maint, "", $name, $comaint, $pack_array);
1870 } else {
1871 print_notfound($package);
1872 }
1873 printBackLink();
1874
1875 } elseif (@$all) {
1876 print_all();
1877
1878 } else {
1879 print_form();
1880 }
1881
1882 print_footer();
1883 ?>
1884
1885 # 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