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

Contents of /trunk/wml/developer.wml

Parent Directory Parent Directory | Revision Log Revision Log


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