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

Contents of /trunk/wml/developer.wml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1113 - (show annotations) (download)
Sat Nov 5 00:02:48 2005 UTC (7 years, 7 months ago) by myon
File size: 61545 byte(s)
urlencode $package
1 <?
2 # keep the header in php generated file
3 <protect>/*
4 +-------------------------------------------------------------------------+
5 | Copyright (C) 2002 Igor Genibel |
6 | |
7 | This program is free software; you can redistribute it and/or |
8 | modify it under the terms of the GNU General Public License |
9 | as published by the Free Software Foundation; either version 2 |
10 | of the License, or (at your option) any later version. |
11 | |
12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | GNU General Public License for more details. |
16 +-------------------------------------------------------------------------+
17 | This code is currently maintained and debugged by Igor Genibel, any |
18 | questions or comments regarding this code should be directed to: |
19 | - igor@genibel.org |
20 +-------------------------------------------------------------------------+
21 | - Igor Genibel - http://genibel.org/ |
22 | $Id$
23 +-------------------------------------------------------------------------+
24
25 */</protect>
26 header('Content-Type: text/html; charset="utf-8"');
27 header('Content-Script-Type: text/javascript');
28 header('Content-Style-Type: text/css');
29 header('Pragma: no-cache');
30
31 // global variables
32 $arg_cookie = array();
33 $prefix="/org/qa.debian.org/data/ddpo/results";
34 $counter_span = 0;
35 $already_displayed = false;
36 $no_packages = false;
37
38 error_reporting(0);
39 $time = microtime();
40
41 $branch = array ("main",
42 "contrib",
43 "non-free",
44 "non-US/main",
45 "non-US/contrib",
46 "non-US/non-free" );
47
48 setlocale(LC_ALL, 'fr_FR');
49 setlocale(LC_TIME, 'C');
50 setlocale(LC_NUMERIC, 'C');
51
52 /* pick up cookies information or generate default one */
53 if (!empty($_COOKIE['columnsinfo']) and ($_GET['reset'] != 'yes'))
54 {
55 $tmp = $_COOKIE['columnsinfo'];
56 $arg_cookie = unserialize(base64_decode($tmp));
57 }else{
58 $arg_cookie = array ( bugs => 1,
59 version => 1,
60 excuses => 1,
61 watch => 1,
62 bin => 1,
63 buildd => 1,
64 security => 1,
65 problems => 1,
66 section => 1,
67 priority => 1,
68 pool => 1,
69 uninstallable => 1);
70 }
71 /* always set cookie with that values in order to keep it 3 months old since the last visit */
72 setcookie('columnsinfo', base64_encode(serialize($arg_cookie)), strtotime('+3 month'));
73
74
75 /* if the "reset" arg is passed, need to extract action parameter in order to store the
76 value into the new cookie */
77 if($_GET['reset'] != 'yes')
78 {
79 foreach(array_keys($_GET) as $key)
80 {
81 if (($key == 'comaint') or ($key == 'login') or ($key == 'package') or ($key == 'wnpp') or ($key == 'gpg_key') or ($key == 'popcon'))
82 {
83 continue;
84 }else{
85 $arg_cookie[$key] = $_GET[$key];
86 }
87 }
88 if ($_GET['set'] == 'yes') setcookie('columnsinfo', base64_encode(serialize($arg_cookie)), strtotime('+3 month'));
89 }
90
91 ?>
92
93
94 #use wml::templ::template title="Debian Developer's Packages Overview" author="Igor Genibel"
95
96 {#style#:
97 <style type="text/css">
98 a.dash:link,a.dash:visited,a.dash:active {text-decoration: none;}
99 .general {color:black}
100 .span_general { text-align:left;
101 cursor:pointer;
102 border-bottom-style:dashed;
103 border-width:thin}
104 h3 { font-family: Arial, Helvetica, sans-serif;
105 margin-left:10px }
106 </style>
107 :##}
108
109 {#script#:
110 <script type="text/javascript" language="JavaScript">
111 function objectOver(x){
112 x.style.color="blue";
113 }
114 function objectOut(x){
115 x.style.color="black";
116 }
117 function collapse(x, txt){
118 var oTemp=document.getElementById("text_"+x) ;
119 var oClick=document.getElementById("click_"+x);
120
121 if(oTemp.style.display=="block"){
122 oTemp.style.display="none";
123 oClick.innerHTML=txt+"&nbsp<small>(click to expand)<\/small><br>";
124 }
125 else{
126 oTemp.style.display="block";
127 oClick.innerHTML=txt+"&nbsp<small>(click to collapse)<\/small><br>";
128 }
129 }
130 </script>
131 :##}
132
133 <?
134
135
136 /* Used to return a file line while I didn't find such a function
137 in php
138 Args:
139 $fp: opened file
140 return:
141 String: line
142 */
143 function freadline($fp)
144 {
145 $line = "";
146 do
147 {
148 $line .= fgets($fp, "10240");
149 }
150 while($line != "" && $line[strlen($line)-1] != "\n");
151 return $line;
152 }
153
154
155 /*
156 All generated page are html 4.0 and css1 compliant
157 Action:
158 print the links to w3c
159 */
160 function print_validator()
161 {
162 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>
163 <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>';
164 }
165
166
167 /*
168 Print the footer information such as page generating time.
169 */
170 function print_footer()
171 {
172 global $time;
173 global $prefix;
174 $fp = fopen("$prefix/extract.date", "r");
175 $general = freadline($fp, "512");
176 fclose($fp);
177 $fp = fopen("$prefix/bugs.date", "r");
178 $bugs = freadline($fp, "512");
179 fclose($fp);
180
181 $footer .= "General information: $general (updated once per day)" . html_br();
182 $footer .= "Bug information: $bugs (updated every 15 minutes)" . html_br();
183 list($micro,$sec) = explode(' ', microtime());
184 list($smicro,$ssec) = explode(' ', $time);
185 $footer .= sprintf("Time needed to generate page: %.2fs", $sec-$ssec+$micro-$smicro);
186
187 print html_p(html_small($footer));
188 print html_hr(). print_validator();
189 }
190
191 /*
192 form function
193 Args:
194 $method: "GET" "POST"
195 $preamble: inner form data not considered as visible
196 parameters
197 $data: visible parameters
198 $name: submit button name
199 Returns:
200 an valid html form
201 */
202 function html_form($method, $preamble, $fields, $name)
203 {
204 $form = "<form method=\"$method\" action=\"developer.php\">";
205 $form .= $preamble;
206 $form .= $fields;
207 $form .= html_input_submit($name);
208 $form .= "</form>\n";
209 return $form;
210 }
211
212 /*
213 label function
214 Args:
215 $text: text to be labelized
216 Return:
217 labelized text
218 */
219 function html_label($text)
220 {
221 return "<label>$text</label>\n";
222 }
223
224 /*
225 submit button function
226 Args:
227 $name: submit button name
228 Returns:
229 a valid html submit button
230 */
231 function html_input_submit($name)
232 {
233 return "<input type=\"submit\" value=\"$name\">\n";
234 }
235
236 /*
237 text field unction
238 Args:
239 $name: the text field name
240 Returns:
241 a valid html text field
242 */
243 function html_input_text($name)
244 {
245 return "<input type=\"text\" size=\"30\" maxlength=\"40\" name=\"$name\">\n";
246 }
247
248 /*
249 hidden field unction
250 Args:
251 $name: the hidden field name
252 $value: hidden field value
253 Returns:
254 a valid html hidden field
255 */
256 function html_input_hidden($name,$value)
257 {
258 return "<input type=\"hidden\" name=\"$name\" value=\"$value\">\n";
259 }
260
261 /*
262 radio button function
263 Args:
264 $name: the radio button field name
265 $value: radio button field value
266 $checked: boolean
267 $text: text to explain the radio button
268 Returns:
269 a valid html radio button
270 */
271 function html_input_radio($name,$value,$checked,$text)
272 {
273 $data = "<input type=\"radio\" name=\"$name\" value=\"$value\"";
274 if($checked) $data .= " checked";
275 $data .= ">$text";
276 return "$data\n";
277 }
278
279 /*
280 table header element
281 Args:
282 $title: header text
283 $extra: th args (align, ...)
284 $rowspan: how many rows in the table the header covers
285 $colspan: how many cols in the table the header covers
286 Returns:
287 A valid table header element
288 */
289 function html_th($title, $extra, $rowspan, $colspan)
290 {
291 if($colspan == "") $colspan = 1;
292 if($rowspan == "") $rowspan = 1;
293 if ($extra != "")
294 {
295 return "<th rowspan=\"$rowspan\" colspan=\"$colspan\">" . html_small_color("$title ", "green") . html_small_color("($extra)", "black") . "</th>\n";
296 }else{
297 return "<th rowspan=\"$rowspan\" colspan=\"$colspan\">" . html_small_color($title, "green") . "</th>\n";
298 }
299 }
300
301 /*
302 table element
303 Args:
304 $data: text element
305 $width: width in %
306 $rowspan: how many rows in the table the element covers
307 $colspan: how many cols in the table the element covers
308 Returns:
309 A valid table element
310 */
311 function html_td($data, $width, $colspan, $rowspan)
312 {
313 if($colspan == "") $colspan = 1;
314 if($rowspan == "") $rowspan = 1;
315 if($width == "")
316 {
317 return "<td rowspan=\"$rowspan\" colspan=\"$colspan\">$data</td>\n";
318 }else{
319 return "<td width=\"$width\" rowspan=\"$rowspan\" colspan=\"$colspan\">$data</td>";
320 }
321 }
322
323 /*
324 table line
325 Args:
326 $data: all tds
327 $align: center, left, right
328 $bgcolor: background color
329 Returns:
330 A valid table line
331 */
332 function html_tr($data, $align, $bgcolor)
333 {
334 if($align == "") $align = "center";
335 if($bgcolor == "")
336 {
337 return "<tr align=\"$align\">$data</tr>\n";
338 }else{
339 return "<tr align=\"$align\" bgcolor=\"$bgcolor\">$data</tr>\n";
340 }
341 }
342
343 /*
344 table
345 Args:
346 $header: all table headers (a tr)
347 $data: array of data lines
348 $width: table width in %
349 Returns:
350 A valid html table
351 */
352 function html_table($header, $data, $width)
353 {
354 if($width == "") $width = 100;
355 $table = "<table width=\"${width}%\" border=\"1\" cellpadding=\"3\" cellspacing=\"1\" summary=\"\">";
356 $table .= $header ;
357 foreach ($data as $line) $table .= $line;
358 return "$table\n</table>\n";
359 }
360
361 /*
362 Html Anchor
363 Args:
364 $text: anchor text
365 $link: anchor link
366 $class: anchor class
367 $title: info bullet text
368 Returns:
369 A valid html anchor
370 */
371 function html_a($text,$link,$class, $title)
372 {
373 if($title != "") $title = " title=\"$title\"";
374 if($class != "")
375 {
376 return "<a class=\"$class\" href=\"$link\"$title>$text</a>";
377 }else{
378 return "<a href=\"$link\"$title>$text</a>";
379 }
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_small_color($text,$color)
459 {
460 return html_small(html_color($text, $color));
461 }
462
463 function html_div($text,$id,$class,$extra)
464 {
465 if($class != "")
466 {
467 return "<div id=\"$id\" class=\"$class\" $extra>$text</div>\n";
468 }else{
469 return "<div id=\"$id\" $extra>$text</div>\n";
470 }
471 }
472
473 function html_span($text,$id,$class,$extra)
474 {
475 if($id != "") $id = "id=\"$id\"";
476 if($class != "")
477 {
478 return "<span $id class=\"$class\" $extra>$text</span>\n";
479 }else{
480 return "<span $id $extra>$text</span>\n";
481 }
482 }
483
484 function html_ul($text)
485 {
486 return "<ul>$text</ul>";
487 }
488
489 function html_li($text)
490 {
491 return "<li>$text</li>";
492 }
493
494 function html_wrap2lines($text)
495 {
496 $list = explode(",", $text);
497 if(count($list) < 2)
498 {
499 return $text;
500 }
501 $half = (int)(count($list)/2);
502 return implode(html_blank(), array_slice($list, 0, $half)) . " " .
503 implode(html_blank(), array_slice($list, $half));
504 }
505
506
507 /*
508 This funtion is used to provide the collapsable areas and their title
509 You need to use an auto incremented number in order not to have collisions
510 when expand/collapse an area
511 You need to have a css style class named span_<something>
512 This function return a html valid block
513 */
514 function html_collexp($number, $text, $class, $collapsed, $data)
515 {
516 if($collapsed)
517 {
518 $info = html_blank() . "(click to expand)";
519 $display = "none";
520 }else{
521 $info = html_blank() . "(click to collapse)";
522 $display = "block";
523 }
524 $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\")'");
525 $result .= html_div($data, "text_$number", $class, "style='margin-left:0;display:$display'") ;
526 return $result;
527 }
528
529 /*
530 Function needed to know if the columns has to be displayed or not
531 */
532 function isdisplayed($value)
533 {
534 global $arg_cookie;
535 return $arg_cookie[$value];
536 }
537
538 /*
539 This function is used for the display settings table
540 Note that there is a exception with bugs
541 */
542 function checkbox($value)
543 {
544 global $arg_cookie;
545 if($arg_cookie[$value] == 1)
546 {
547 $data = html_input_radio($value,1,true,"Show\n") . html_br();
548 $data .= html_input_radio($value,0,false,"Hide") . html_br();
549 }else{
550 $data = html_input_radio($value,1,false,"Show\n") . html_br();
551 $data .= html_input_radio($value,0,true,"Hide") . html_br();
552 }
553 /* if($value == 'version')
554 {
555 if($arg_cookie[$value] == 2)
556 {
557 $data = html_input_radio($value,1,false,"Show\n") . html_br();
558 $data .= html_input_radio($value,0,false,"Hide\n") . html_br();
559 $data .= html_input_radio($value,2,true,"Without Exp. &amp; Prop. Upt.\n") . html_br();
560 }elseif($arg_cookie[$value] == 1)
561 {
562 $data = html_input_radio($value,1,true,"Show\n") . html_br();
563 $data .= html_input_radio($value,0,false,"Hide\n") . html_br();
564 $data .= html_input_radio($value,2,false,"Without Exp. &amp; Prop. Upt.\n") . html_br();
565 }else{
566 $data = html_input_radio($value,1,false,"Show\n") . html_br();
567 $data .= html_input_radio($value,0,true,"Hide\n") . html_br();
568 $data .= html_input_radio($value,2,false,"Without Exp. &amp; Prop. Upt.\n") . html_br();
569 }
570 } */
571 if($value == 'bugs')
572 {
573 if($arg_cookie[$value] == 2)
574 {
575 $data = html_input_radio($value,1,false,"Show\n") . html_br();
576 $data .= html_input_radio($value,0,false,"Hide\n") . html_br();
577 $data .= html_input_radio($value,2,true,"Sum.\n") . html_br();
578 $data .= html_input_radio($value,3,false,"Sum. &amp; RC\n") . html_br();
579 }elseif($arg_cookie[$value] == 3)
580 {
581 $data = html_input_radio($value,1,false,"Show\n") . html_br();
582 $data .= html_input_radio($value,0,false,"Hide\n") . html_br();
583 $data .= html_input_radio($value,2,false,"Sum.\n") . html_br();
584 $data .= html_input_radio($value,3,true,"Sum. &amp; RC\n") . html_br();
585 }elseif($arg_cookie[$value] == 1)
586 {
587 $data = html_input_radio($value,1,true,"Show\n") . html_br();
588 $data .= html_input_radio($value,0,false,"Hide\n") . html_br();
589 $data .= html_input_radio($value,2,false,"Sum.\n") . html_br();
590 $data .= html_input_radio($value,3,false,"Sum. &amp; RC\n") . html_br();
591 }else{
592 $data = html_input_radio($value,1,false,"Show\n") . html_br();
593 $data .= html_input_radio($value,0,true,"Hide\n") . html_br();
594 $data .= html_input_radio($value,2,false,"Sum.\n") . html_br();
595 $data .= html_input_radio($value,3,false,"Sum. &amp; RC\n") . html_br();
596 }
597 }
598 $data = html_small_color($data,"green");
599 return $data;
600 }
601
602
603 /*
604 return hidden fields with action parameters to be provided for the form validation
605 */
606 function setaction()
607 {
608 $action = "";
609 global $_GET;
610 foreach(array_keys($_GET) as $key)
611 {
612 if (($key == 'login') or ($key == 'package') or ($key == 'gpg_key') or ($key == 'comaint'))
613 {
614 $action .= html_input_hidden($key,$_GET[$key]);
615 }
616 }
617 return $action;
618 }
619
620
621 function process_wnpp_owner($name, $email)
622 {
623 $null = exec("ldapsearch -h bugs.debian.org -p 10101 -LLL -x -b dc=current,dc=bugs,dc=debian,dc=org '(&(debbugsOwner=*$email*)(debbugsState=open)(debbugsPackage=wnpp))' debbugsID debbugsTitle", $data, $ret);
624 if(($ret != 0) or (count($data) == 0)) return;
625 $display = "";
626 $temp = "";
627 $title = "";
628 print html_h("$name &lt;$email&gt; is owner:", 3);
629 foreach ($data as $elem)
630 {
631 if (strstr($elem, "debbugsID"))
632 {
633 $temp = str_replace("debbugsID: ", "", $elem);
634 }elseif(strstr($elem, "debbugsTitle"))
635 {
636 $title = str_replace("debbugsTitle: ", "", $elem);
637 }elseif(preg_match('/^\s(.+)$/', $elem, $matches))
638 {
639 $title .= $matches[1];
640 }elseif($elem == "")
641 {
642 $display .= html_li(html_a("#" . $temp . ": " . $title, "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=" . $temp));
643 $temp = "";
644 $title = "";
645 }
646 }
647 print html_ul($display);
648 }
649
650 /* These functions provides links to the bts for a maintainer */
651 function bugs_nonfixed($login)
652 {
653 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");
654 }
655
656 function bugs_all_related($login)
657 {
658 return html_a("All bugs related to &lt;$login&gt;", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?maint=". urlencode($login));
659 }
660
661 function bugs_rc($login)
662 {
663 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");
664 }
665
666 function bugs_submitter($login)
667 {
668 return html_a("All bugs submitted by &lt;$login&gt;", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?submitter=" . urlencode($login));
669 }
670
671 /* Functions used to construct the correct links in several fields (from bugs_display to stat_bug_link) */
672 function bugs_display($bug_number, $base_url)
673 {
674 $bug_link="";
675 preg_match("/(\d+)\((\d+)\)/", $bug_number, $result);
676 if (strcmp($result[1], $result[2]) == 0)
677 {
678 $bug_link = html_a($result[1], $base_url, "a");
679 }else{
680 $bug_link = html_a($result[1], "${base_url}&amp;repeatmerged=no", "a");
681 $bug_link .= html_blank() . html_color("(", "blue") . html_a($result[2], "${base_url}&amp;repeatmerged=yes", "a") . html_color(")", "blue");
682 }
683 return $bug_link;
684 }
685
686 function lintian_link($lintian)
687 {
688 return html_a("Lintian report", "http://lintian.debian.org/reports/m${lintian}.html");
689 }
690
691 function buildd_link($buildd, $login)
692 {
693 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));
694 }
695
696 function stat_bug_link($login)
697 {
698 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));
699 }
700
701 /* Function is used to display or not the extra features such as pocon, wnpp, and excuses */
702 function do_extra($data, $data_prefix, $error)
703 {
704 global $prefix;
705 $data = str_replace(" ", "+", $data);
706 $filepath = "$prefix/$data_prefix/" . $data{0} . "/$data";
707 if(file_exists($filepath))
708 {
709 require "$filepath";
710 }else{
711 print html_h($error, 2);
712 }
713 if($data_prefix == "excuses")
714 {
715 print html_br() . html_a("More excuses", "http://bjorn.haxx.se/debian/testing.pl?package=$data");
716 }
717 }
718
719
720 function printBackLink() {
721 print html_p(html_a("Back to main page", "developer.php", ""));
722 }
723
724 /* function used to display the main maintainer links in a collapsable area */
725 function print_header_entries_body($keys, $name, $comaint, $login)
726 {
727 global $counter_span;
728 global $prefix;
729 $add_comaint = "&amp;comaint=$comaint";
730 $lintian = preg_replace('/%../', "_", urlencode($name));
731 $lintian = preg_replace('/\+/', "_", $lintian);
732 $lintian = preg_replace('/-/', "_", $lintian);
733 $fp = fopen("$prefix/../../ftp/Maintainers", "r");
734 $ok = 0;
735 while(!feof($fp))
736 {
737 $line = freadline($fp, "10240");
738 if (preg_match("/$login/", $line))
739 {
740 $ok = 1;
741 $login = preg_replace('/\\\\/', '', $login);
742 if (preg_match("/$login \(/", $line))
743 {
744 $buildd=urlencode("$login ($name) ");
745 }else{
746 $buildd=urlencode("$name <$login> ");
747 }
748 }
749 if ($ok == 1 )
750 {
751 break;
752 }
753 }
754 fclose($fp);
755 $counter_span += 1;
756 $title = html_b("General information for Id: $login");
757 $maintainer_data = "";
758 /* GPG is broken
759 if ($keys == "NOID")
760 {
761 $maintainer_data = html_font("GPG key id not found!", 'size="+1" color="red"');
762 $maintainer_data .= html_blank() . html_font("(key id was not found neither in the Debian keyring nor on a public keyserver)", 'size="-2"');
763 $maintainer_data .= html_br();
764 }else{
765 $maintainer_data .= "GPG key id: ";
766 foreach (explode(",", $keys) as $key)
767 {
768 $maintainer_data .= html_small(html_a($key, "developer.php?gpg_key=" .$key . $add_comaint)) . " ";
769 }
770 $maintainer_data .= html_br();
771 }
772 */
773 $maintainer_data .= html_small(bugs_nonfixed($login)) . html_br();
774 $maintainer_data .= html_small(bugs_all_related($login)) . html_br();
775 $maintainer_data .= html_small(bugs_rc($login)) . html_br();
776 $maintainer_data .= html_small(bugs_submitter($login)) . html_br();
777 $maintainer_data .= html_small(lintian_link($lintian)) . html_br();
778 $maintainer_data .= html_small(buildd_link($buildd, $login)) . html_br();
779 $maintainer_data .= html_small(stat_bug_link($login));
780 if(file_exists("$prefix/wnpp/" . $login{0} . "/$login"))
781 {
782 $maintainer_data .= html_br() . html_small(html_a("Wnpp bugs opened by &lt;$login&gt;", "developer.php?wnpp=$login"));
783 }
784
785 print html_collexp($counter_span, $title, "general", false, $maintainer_data);
786 }
787
788 /* Function used to display the generic information (help and display settings) */
789 function print_header_entries_top($login, $key, $name)
790 {
791 global $counter_span;
792 global $already_displayed;
793 print html_h("Packages overview for $name", 1, "center");
794
795 if(! $already_displayed)
796 {
797 $counter_span += 1;
798 $display_data = "You are able to display only the columns you want/need.". html_br();
799 $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.")) . html_br();
800 $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). In each column in the bo ttom table you can see in " .html_b("black") . " the arg to be passed. Put 1 if you want to show the corresponding column, 0 to hide and 2 to have a summary if column is " . html_em("bugs") . "." . html_br();
801 $display_data .= "Please select the configuration you want (check the boxes corresponding to columns name if you want to keep it displayed):";
802 $display_data = html_small($display_data);
803 $display_table_th = html_th("Bugs","&amp;bugs=");
804 $display_table_th .= html_th("Version","&amp;version=");
805 $display_table_th .= html_th("Excuses","&amp;excuses=");
806 $display_table_th .= html_th("Binary" . html_br() . "Package Page","&amp;bin=");
807 $display_table_th .= html_th("Buildd","&amp;buildd=");
808 $display_table_th .= html_th("Security","&amp;security=");
809 $display_table_th .= html_th("Problems","&amp;problems=");
810 $display_table_th .= html_th("Uninstallable","&amp;uninstallable=");
811 $display_table_th .= html_th("Watch","&amp;watch=");
812 $display_table_th .= html_th("Section","&amp;section=");
813 $display_table_th .= html_th("Priority","&amp;priority=");
814 $display_table_th .= html_th("Pool","&amp;pool=");
815
816 $display_table_tds = html_td(checkbox('bugs'));
817 $display_table_tds .= html_td(checkbox('version'));
818 $display_table_tds .= html_td(checkbox('excuses'));
819 $display_table_tds .= html_td(checkbox('bin'));
820 $display_table_tds .= html_td(checkbox('buildd'));
821 $display_table_tds .= html_td(checkbox('security'));
822 $display_table_tds .= html_td(checkbox('problems'));
823 $display_table_tds .= html_td(checkbox('uninstallable'));
824 $display_table_tds .= html_td(checkbox('watch'));
825 $display_table_tds .= html_td(checkbox('section'));
826 $display_table_tds .= html_td(checkbox('priority'));
827 $display_table_tds .= html_td(checkbox('pool'));
828
829 $display_table_tr = html_tr($display_table_tds, "left");
830
831 $display_data .= html_table(html_tr($display_table_th), array($display_table_tr));
832
833 $preamble = setaction() . html_input_hidden("set", "yes");
834 $display_data = html_form("GET", $preamble, $display_data, "Submit");
835
836 $preamble = setaction() . html_input_hidden("reset", "yes");
837 $display_data .= html_form("GET", $preamble, "", "Show all");
838
839 //$display_data = html_small($display_data);
840 $title = html_b("Display configuration:");
841 print html_br() . html_collexp($counter_span, $title, "general", true, $display_data);
842
843 $counter_span += 1;
844 $help_data = html_color("Blue", "blue") . " packages are co-maintained by developer (reference to Uploaders: field)" . html_br();
845 $help_data .= "The bug columns display the real number of bugs. If there are merged bugs, the total is in parentheses." . html_br();
846 $help_data .= html_color("Red", "red") . " version numbers are NMUs" . html_br();
847 $help_data .= html_color("Magenta", "#ff00ff") . " version numbers are packages where the unstable version differs from the testing version" . html_br();
848 $help_data .= "Watch columns:" . html_br();
849 $help_data .= html_blank().html_blank(). html_color("green", "green") . ": upstream found version is in sync with version unstable/experimental" . html_br();
850 $help_data .= html_blank().html_blank(). html_color("magenta", "#ff00ff") . ": upstream found version is greater than version in unstable" . html_br();
851 $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();
852 $help_data .= html_blank().html_blank(). html_color("error", "red") . ": uscan had problems following the watch file" . html_br();
853 $help_data .= html_blank().html_blank(). "Watch is N/A: package does not have a watch file" . html_br();
854 $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();
855 $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();
856 $help_data .= html_blank().html_blank(). html_color("no value", "grey") . ": there is a problem with the dehs database files" . html_br().html_br();
857 $help_data = html_small($help_data);
858
859 $title = html_b("Help");
860 print html_collexp($counter_span, $title, "general", true, $help_data);
861 $already_displayed = true;
862 }
863 }
864
865
866 function print_notfound($login)
867 {
868 print html_h("No information available for $login", 2);
869 }
870
871
872 /* Construct page provided when no command is provided */
873 function print_form()
874 {
875 $form = html_h("Debian Developer's Packages Overview", 1);
876 $form .= html_p("Use the following search forms to determine the Debian developer whose packages overview you wish to see:");
877
878 $preamble = "Search based on the Maintainer field in packages:" . html_br();
879 $preamble .= html_small("If a single username is provided, @debian.org is automatically appended.") . html_br();
880 $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();
881
882 $preamble .= html_input_text("login");
883 $preamble = html_label($preamble) . html_br();
884
885 $form_data = "Display co-maintained packages:" . html_blank();
886 $form_data .= html_input_radio("comaint", "yes", true, "yes");
887 $form_data .= html_input_radio("comaint", "no", false, "no");
888 $form_data .= html_input_radio("comaint", "only", false, "only");
889 $form_data = html_label($form_data) . html_br();
890
891 $form .= html_form("GET", $preamble, $form_data, "Find");
892
893 #$preamble = "Search based on the " . html_tt("GPG key ID:") . html_br();
894 #$preamble .= html_input_text("gpg_key");
895 #$preamble = html_label($preamble) . html_br();
896
897 #$form_data = "Display co-maintained packages:" . html_blank();
898 #$form_data .= html_input_radio("comaint", "yes", true, "yes");
899 #$form_data .= html_input_radio("comaint", "no", false, "no");
900 #$form_data .= html_input_radio("comaint", "only", false, "only");
901 #$form_data = html_label($form_data) .html_br();
902
903 #$form .= html_form("GET", $preamble, $form_data, "Find") . html_br();
904
905 $preamble = "Search based on a source package name:" . html_br();
906 $preamble .= html_input_text("package");
907 $preamble = html_label($preamble) . html_br();
908
909 $form_data = "Display co-maintained packages:" . html_blank();
910 $form_data .= html_input_radio("comaint", "yes", true, "yes");
911 $form_data .= html_input_radio("comaint", "no", false, "no");
912 $form_data .= html_input_radio("comaint", "only", false, "only");
913 $form_data = html_label($form_data) .html_br();
914
915 $form .= html_form("GET", $preamble, $form_data, "Find");
916
917 $query = "Show complete, sorted list of developers (600kB)";
918 $hidden = html_input_hidden("all", "1");
919 $form .= $query . html_form("GET", $hidden, "", "Show the list");
920
921 $form .= html_h("Subscribing to Packages", 2);
922 $form .= "Additional packages can be added to the list of packages shown. There are two interfaces, mail and URL based.". html_br().html_br();
923 $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:";
924 $form .= "<pre>user &lt;address&gt;
925 Process commands for &lt;address&gt;. Defaults to the address used in the From:
926 header.
927 subscribe &lt;srcpackage&gt; [&lt;section&gt;]
928 Adds &lt;srcpackage&gt; to the listing. If &lt;section&gt; is omitted, defaults to
929 \"ddpo\". This command can also be used to move &lt;srcpackage&gt; to a different
930 section.
931 unsubscribe &lt;srcpackage&gt;
932 Removes the &lt;srcpackage&gt; from the listing.
933 help
934 Print help text.
935 quit
936 thanks
937 Stops processing commands.
938 </pre>";
939 $form .= "Alternatively, one can append &amp;packages=pkg1+pkg2+... to the URL. This will create a new section \"url\" in the listing, independently of the selected login.". html_br().html_br();
940
941 $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") .".";
942 print $form;
943 }
944
945 /* Construct the page where all maintainer are displayed */
946 function print_all()
947 {
948 global $prefix;
949 $maint = file("$prefix/ddpo_maintainers");
950 $html = html_h("Sorted developer list", 2);
951
952 $display_table_th = html_th("Name and email");
953 $display_table_th .= html_th("main");
954 $display_table_th .= html_th("non-us");
955 $display_table_th .= html_th("Other" . html_br(), html_small("all contrib &amp;" . html_br() . "non-free packages"));
956 $display_table_th .= html_th("Total");
957 $trs = array();
958 foreach($maint as $line)
959 {
960 if($line != "")
961 {
962 $count = 0;
963 $line = preg_replace("/, /", ",", $line);
964 preg_match("/;([^;]+?);([^;]+?);([^;]*?);([^;]*?);([^;]*?);([^;]*?);([^;]*?);([^;]*?);([^;]*)$/", $line, $info_array);
965
966 $tds = html_td(html_b(html_a(str_replace(" ", html_blank(), "$info_array[3]") . html_blank() . "&lt;$info_array[1]&gt;", "developer.php?login=" . rawurlencode($info_array[1]))), 15);
967 $main = 0;
968 $nonUS = 0;
969 $other = 0;
970 if($info_array[4] != "")
971 {
972 $main += count(explode(" ", $info_array[4]));
973 $count += count(explode(" ", $info_array[4]));
974 }
975 if($info_array[5] != "")
976 {
977 $other += count(explode(" ", $info_array[5]));
978 $count += count(explode(" ", $info_array[5]));
979 }
980 if($info_array[6] != "")
981 {
982 $nonUS += count(explode(" ", $info_array[6]));
983 $count += count(explode(" ", $info_array[6]));
984 }
985 if($info_array[7] != "")
986 {
987 $other += count(explode(" ", $info_array[7]));
988 $count += count(explode(" ", $info_array[7]));
989 }
990 if($info_array[8] != "")
991 {
992 $other += count(explode(" ", $info_array[8]));
993 $count += count(explode(" ", $info_array[8]));
994 }
995 if($info_array[9] != "")
996 {
997 $other += count(explode(" ", $info_array[9]));
998 $count += count(explode(" ", $info_array[9]));
999 }
1000
1001 $tds .= html_td($main) . html_td($nonUS) . html_td($other) . html_td(html_b($count));
1002 $trs[] = html_tr($tds, "center");
1003 }
1004 }
1005 print html_table(html_tr($display_table_th), $trs, "80");
1006 }
1007
1008 /* Small useful function to construct the link to the excuses */
1009 function get_rep($package_name)
1010 {
1011 if(preg_match("/^lib/", $package_name)) {
1012 return substr($package_name, 0, 4);
1013 }else{
1014 return substr($package_name, 0, 1);
1015 }
1016 }
1017 # Begin of Dehs functions
1018 function dehsdb_conn ($dbname,$mode)
1019 {
1020 $id = dba_open($dbname, $mode, "db4");
1021 return $id;
1022 }
1023
1024 function dehsdb_xml($xml)
1025 {
1026 $p = xml_parser_create();
1027 xml_parse_into_struct($p, $xml, $vals, $index);
1028 xml_parser_free($p);
1029 $values=array("id"=>$vals[1][value],"up_version"=>$vals[2][value],"wwiz"=>$vals[3][value]);
1030 return $values;
1031 }
1032 function dehs_value($pkg_name,$dist)
1033 {
1034 $id = dehsdb_conn("/org/qa.debian.org/data/dehs/dehs_qa_" . $dist . ".db","r");
1035 if(!$id) return "error";
1036 if (!dba_exists($pkg_name,$id)) return array("id"=>"-","up_version"=>"-","wwiz"=>"-");
1037 $xml=dba_fetch($pkg_name,$id);
1038 dba_close($id);
1039 return dehsdb_xml($xml);
1040 }
1041 function vers_conv($debvers) {
1042 preg_match("/(.+:)?([^-]+)(ds|dsfg|debian)/",$debvers,$matches);
1043 if (!$matches[3]) {
1044 unset($matches);
1045 preg_match("/(.+:)?([^-]+)/",$debvers,$matches);
1046 }
1047 if (substr($matches[2],-1)=='.') $matches[2]=substr($matches[2],0,-1);
1048 return $matches[2];
1049 }
1050 function ver_comp($a,$b) {
1051 exec("dpkg --compare-versions '$a' gt '" . vers_conv($b) . "'",$output,$res);
1052 if ($res==0) return 1;
1053 exec("dpkg --compare-versions '$a' lt '" . vers_conv($b) . "'",$output,$res);
1054 if ($res==0) return 2;
1055 else return 3;
1056 }
1057 function print_dehs($package,$version,$dist,$type)
1058 {
1059 $dehs_values=dehs_value($package,$dist);
1060 if($dehs_values=="error") return html_td(html_small_color("no value", "grey"));
1061 if ($type=="up_version")
1062 {
1063 $dehs_link= html_small(html_br() . html_a("Details", "http://dehs.alioth.debian.org/maintainer.php?name=" . rawurlencode($package)));
1064 if($dehs_values[up_version]=="-")
1065 {
1066 $dehs_values[up_version] = html_small("-");
1067 $dehs_link='';
1068 }
1069 elseif ($dehs_values[up_version]=='N/A')
1070 {
1071 $color="black";
1072 }
1073 elseif ($dehs_values[up_version]=='Error') $color="red";
1074 elseif(ver_comp($dehs_values[up_version],$version)==1) $color="magenta";
1075 elseif(ver_comp($dehs_values[up_version],$version)==2) $color="#2222AA";
1076 else {
1077 $color="green";
1078 $dehs_link='';
1079 }
1080 $upstream_print = html_td(html_small_color($dehs_values[up_version], $color) . $dehs_link, "", 1, 1);
1081 return $upstream_print;
1082 }else{
1083 $wwiz_link_desc="Details";
1084 if($dehs_values[wwiz]=='-' or !$dehs_values[wwiz])
1085 {
1086 $dehs_values[wwiz] = html_small("-");
1087 $dehs_link='';
1088 }
1089 elseif ($dehs_values[wwiz]=='N/A') $color="black";
1090 elseif ($dehs_values[wwiz]=='error' OR $dehs_values[wwiz]=='notmatch') $color="red";
1091 elseif(ver_comp($dehs_values[wwiz],$version)==1)
1092 {
1093 $color="magenta";
1094 $wwiz_link_desc="Watch";
1095 }
1096 elseif(ver_comp($dehs_values[wwiz],$version)==2)
1097 {
1098 $color="#2222AA";
1099 $wwiz_link_desc="Watch";
1100 }else{
1101 $color="green";
1102 $wwiz_link_desc="Watch";
1103 }
1104 if(!isset($dehs_link))
1105 {
1106 $dehs_link= html_br() . html_small(html_a($wwiz_link_desc, "http://dehs.alioth.debian.org/wwiz_detail.php?id=" . $dehs_values[id] . "&amp;type=watch"));
1107 }
1108 $wwiz_print= html_td(html_small_color($dehs_values[wwiz], $color, "", 1, 1));
1109 return $wwiz_print;
1110 }
1111 }
1112 # Check whether there is a debcheck entry for that package
1113 function debcheckavailable($branch, $package_name)
1114 {
1115 $package = ereg_replace ("\.", "_", $package_name);
1116 if(ereg ("[^a-zA-Z0-9+_-]", $package) ||
1117 ($branch != "oldstable" && $branch != "stable" && $branch != "testing" && $branch != "unstable"))
1118 {
1119 return 0;
1120 }
1121 $BASEDIR='/org/qa.debian.org/data/debcheck/result/';
1122 return file_exists($BASEDIR.'/'.$branch.'/packages/'.$package);
1123 }
1124
1125 /*
1126 Print possible wnpp entries and/or removal requests for this source package
1127 as consise links, or nothing if there are none
1128 */
1129 function get_wnpp_rm($package)
1130 {
1131 static $db;
1132 if (!$db) $db = dba_open("/org/qa.debian.org/data/bts/wnpp_rm.db", 'r-', 'db4');
1133 if (!$db) return;
1134 $entries = dba_fetch($package, $db);
1135 if (!$entries) return;
1136 $entries = explode('|', $entries);
1137 $ret = "";
1138 foreach ($entries as $entry) {
1139 preg_match('/(\\S+)\\s+(\\S+)/', $entry, $m);
1140 $ret .= "<a href=\"http://bugs.debian.org/$m[2]\"><strong>[$m[1]]</strong></a>";
1141 }
1142 return $ret;
1143 }
1144
1145 /*
1146 This function prints a package table information row
1147 */
1148 function print_package_entry($branch, $package, $comaint, $back_tr_color)
1149 {
1150 global $prefix;
1151 static $pack_db;
1152
1153 # open package info db
1154 # source(binary, binary)[versions]{uninstalable_stable}{_testing}{_unstable}|priority|:section:
1155 if (!$pack_db) $pack_db = dba_open("$prefix/ddpo_packages.db", 'r-', 'db4');
1156
1157 # handle co-maintained packages
1158 $uploader = false;
1159 if(strstr($package, "#"))
1160 {
1161 $uploader = 1;
1162 $package = str_replace("#", "", $package);
1163 }
1164 if ((($uploader == 1) && ( $comaint == "no")) ||
1165 (($uploader == 0) && ( $comaint == "only"))) return "";
1166
1167 # get package data
1168 $packagedata = dba_fetch($package, $pack_db);
1169 preg_match("/(.+)\((.+)\)/", $packagedata, $result);
1170 $list = split (",", $result[2]);
1171
1172 if(strstr($packagedata, "%"))
1173 {
1174 $arch_all = 1;
1175 $packagedata = str_replace("%", "", $packagedata);
1176 }
1177 preg_match("/(.+?)\[(.+)\]\{(.+)\}\{(.+)\}\{(.+)\}\|(.*)\|:(.*):/", $packagedata, $results);
1178 $version = $results[2];
1179 $versions = explode (",", $version);
1180 $version_stable = $versions[0];
1181 $version_testing = $versions[1];
1182 $version_unstable = $versions[2];
1183 $version_prop = $versions[3];
1184 $version_experimental = $versions[4];
1185 $version_experimental_backup= $versions[4];
1186 $security_stable = $versions[5];
1187 $security_testing = $versions[6];
1188 $uninstalable_stable = html_wrap2lines($results[3]);
1189 $uninstalable_testing = html_wrap2lines($results[4]);
1190 $uninstalable_unstable = html_wrap2lines($results[5]);
1191 $priority = $results[6];
1192 $section = $results[7];
1193
1194 $urlpackage = rawurlencode($package);
1195
1196 // make $bugsdb link persistent during this pagerequest, we don't lock, so
1197 // this doesn't matter at all
1198 static $bugsdb;
1199 if (!$bugsdb) $bugsdb = dba_open("$prefix/bugs.db", 'r-', 'db4');
1200
1201 if (!($bug_list = dba_fetch($package, $bugsdb))) $bug_list = '0(0) 0(0) 0(0) 0(0)';
1202 $bug_list = explode(' ', $bug_list);
1203
1204 if(strcmp($version_stable, "-") == 0 || !debcheckavailable('stable', $package))
1205 {
1206 $stable_dep = html_small("-");
1207 }else{
1208 $stable_dep = html_small(html_a("Stable", "http://qa.debian.org/debcheck.php?dist=stable&amp;package=$urlpackage"));
1209 }
1210
1211 if(strcmp($version_testing, "-")== 0 || !debcheckavailable('testing', $package))
1212 {
1213 $testing_dep = html_small("-");
1214 }else{
1215 $testing_dep = html_small(html_a("Testing", "http://qa.debian.org/debcheck.php?dist=testing&amp;package=$urlpackage"));
1216 }
1217
1218 if(strcmp($version_unstable, "-")== 0 || !debcheckavailable('unstable', $package))
1219 {
1220 $sid_dep = html_small("-");
1221 }else{
1222 $sid_dep = html_small(html_a("Unstable", "http://qa.debian.org/debcheck.php?dist=unstable&amp;package=$urlpackage"));
1223 }
1224
1225 $buildd = "http://buildd.debian.org/build.php?pkg=$urlpackage";
1226 if(strstr($branch, "non-US"))
1227 {
1228 $pool = "http://non-us.debian.org/debian-non-US/pool/". $branch . "/" .get_rep($urlpackage) . "/" . $urlpackage . "/";
1229 }else{
1230 $pool = "http://ftp.debian.org/debian/pool/". $branch . "/" .get_rep($urlpackage) . "/" . $urlpackage . "/";
1231 }
1232
1233 if(file_exists("$prefix/excuses/" . $package{0} . "/$package"))
1234 {
1235 $excuse = html_a("Excuses", "developer.php?excuse=$urlpackage") . " ";
1236 $excuse .= html_a("More", "http://bjorn.haxx.se/debian/testing.pl?package=$urlpackage");
1237 }else{
1238 $excuse = "-";
1239 }
1240 if(strcmp($version_prop, "-"))
1241 {
1242 $version_prop = html_color(html_b($version_prop), "#2222AA");
1243 }
1244 $prop = html_td(html_small($version_prop));
1245
1246 if(strcmp($version_experimental, "-"))
1247 {
1248 $version_experimental = html_color(html_b($version_experimental), "#2222AA");
1249 }
1250 $experimental = html_td(html_small($version_experimental));
1251
1252
1253 if((strcmp ($version_stable, $version_testing) == 0) &&
1254 (strcmp ($version_stable, "/") != 0))
1255 {
1256 if((strcmp ($version_unstable, $version_testing) == 0))
1257 {
1258 $version_print = html_td(html_small($version_stable), "", 3, 1) . $prop . $experimental;
1259 }else{
1260 $version_print = html_td(html_small($version_stable), "", 2, 1) . html_td(html_small($version_unstable)) . $prop . $experimental;
1261 }
1262 $ver = explode("-", $version_unstable);
1263 if((preg_match("/(.+\..+?)$/", $ver[count($ver) - 1], $toto)) && (count($ver) != 1))
1264 {
1265 $version_print = str_replace("$version_unstable", html_color($version_unstable, "red"), $version_print);
1266 }
1267 }elseif(strcmp ($version_testing, $version_unstable) == 0)
1268 {
1269 if(strcmp($version_stable, "/") != 0)
1270 {
1271 $version_stable = html_color($version_stable, "#00AADD");
1272 }
1273 $version_print = html_td(html_small($version_stable)) . html_td(html_small($version_testing), "", 2, 1) . $prop . $experimental;
1274 $ver = explode("-", $version_unstable);
1275 if((preg_match("/(.+\..+?)$/", $ver[count($ver) - 1], $toto)) && (count($ver) != 1))
1276 {
1277 $version_print = str_replace("$version_unstable", html_color($version_unstable, "red"), $version_print);
1278 }
1279 }else{
1280 if(strcmp($version_stable, "/") != 0)
1281 {
1282 $version_stable = html_small_color($version_stable, "#00AADD");
1283 }else{
1284 $version_stable = html_small($version_stable);
1285 }
1286 $version_print = html_td($version_stable) . html_td(html_small_color($version_testing, "#ff00ff")) . html_td(html_small($version_unstable)) . $prop . $experimental;
1287 $ver = explode("-", $version_unstable);
1288 if((preg_match("/(.+\..+?)$/", $ver[count($ver) - 1], $toto)) && (count($ver) != 1))
1289 {
1290 $version_print = str_replace("$version_unstable", html_color($version_unstable, "red"), $version_print);
1291 }
1292 }
1293
1294 $line = "";
1295 $line_data = html_b($urlpackage) . get_wnpp_rm($package) . html_br() . html_a("[pts]", "http://packages.qa.debian.org/".get_rep($urlpackage)."/$urlpackage.html") . html_blank() . html_a("[popcon]", "developer.php?popcon=$urlpackage");
1296 if($uploader == 1)
1297 {
1298 $line = html_td(html_small_color($line_data, "blue"));
1299 }else{
1300 $line = html_td(html_small($line_data));
1301 }
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(html_small($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(html_small($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(html_small($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(html_small($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(html_small($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(html_small($bug_data));
1369
1370 }
1371 }
1372
1373 if(isdisplayed('version')) $line .= $version_print;
1374 if(isdisplayed('excuses')) $line .= html_td(html_small($excuse));
1375 if(isdisplayed('bin'))
1376 {
1377 $bin_display = "";
1378 for ($i = 1; $i <= count($list); $i++)
1379 {
1380 $bin_package = $list[$i - 1];
1381 $bin_display .= html_a($i, "http://packages.debian.org/" . rawurlencode($bin_package), "", $bin_package);
1382 if(($i % 3 ) == 0)
1383 {
1384 $bin_display .= " ";
1385 }else{
1386 $bin_display .= html_blank();
1387 }
1388 }
1389 $line .= html_td(html_small($bin_display));
1390 }
1391
1392 if(isdisplayed('buildd'))
1393 {
1394 $buildd_display = "";
1395 if(@$arch_all || preg_match("/non-free/", $branch) || (strcmp($version_unstable, "-") == 0))
1396 {
1397 $buildd_display = html_td(html_small("-"));
1398 $arch_all = 0;
1399 }else{
1400 $buildd_display = html_td(html_small(html_a("Buildd", $buildd)
1401 . html_br() . html_a("More",
1402 "http://people.debian.org/~igloo/status.php?packages=$urlpackage")));
1403 }
1404 $line .= $buildd_display;
1405 }
1406
1407 if(isdisplayed('security'))
1408 {
1409 if(strcmp($security_stable,"-")) $security_stable = html_color($security_stable, "red");
1410 if(strcmp($security_testing,"-")) $security_testing = html_color($security_testing, "red");
1411 $line .= html_td(html_small($security_stable)) . html_td(html_small($security_testing));
1412 }
1413 if(isdisplayed('problems')) $line .= html_td($stable_dep) . html_td($testing_dep) . html_td($sid_dep);
1414 if(isdisplayed('uninstallable')) $line .= html_td(html_small($uninstalable_stable)) . html_td(html_small($uninstalable_testing)) . html_td(html_small($uninstalable_unstable));
1415 if(isdisplayed('watch'))
1416 {
1417 $line .= print_dehs($package,$version_unstable,"unstable","up_version");
1418 $line .= print_dehs($package,$version_unstable,"unstable","wwiz");
1419 $line .= print_dehs($package,$version_experimental_backup,"experimental","up_version");
1420 $line .= print_dehs($package,$version_experimental_backup,"experimental","wwiz");
1421 }
1422 if(isdisplayed('section')) $line .= html_td(html_small($section));
1423 if(isdisplayed('priority')) $line .= html_td(html_small($priority));
1424 if(isdisplayed('pool')) $line .= html_td(html_a(html_small("Pool"), $pool));
1425 return html_tr($line, "center", $back_tr_color);
1426 }
1427
1428 /*
1429 This function prints a package table information for specific branch
1430 given in argument
1431 */
1432 function print_package_entries($branch, $packages, $comaint)
1433 {
1434 global $prefix;
1435 $packages = preg_replace ("/, /", ",", $packages);
1436 $pack_array = split(" ", $packages);
1437 $global_count = count($pack_array);
1438 $arch_all = 0;
1439
1440 if ($comaint == "no")
1441 /* don't display co-maintained packages */
1442 {
1443 $result = 0;
1444 for ($i = 0; $i < strlen($packages); $i++)
1445 {
1446 if ($packages[$i] == '#')
1447 {
1448 $result += 1;
1449 }
1450 }
1451 $global_count -= $result;
1452 }elseif($comaint == "only")
1453 /* Only display co-maintained packages */
1454 {
1455 $result = 0;
1456 for ($i = 0; $i < strlen($packages); $i++)
1457 {
1458 if ($packages[$i] == '#')
1459 {
1460 $result += 1;
1461 }
1462 }
1463 $global_count = $result;
1464 }
1465
1466 print html_h("Packages in " . html_em($branch) . " ($global_count)", 3);
1467
1468
1469 /* contruct the table header */
1470 $ths = html_th("Source" . html_blank(). "Name", "", 2);
1471 if(isdisplayed('bugs') == 1)
1472 {
1473 $ths .= html_th("Bugs (see above)", "", 1, 5);
1474 }elseif(isdisplayed('bugs') == 2)
1475 {
1476 $ths .= html_th("Bugs (see above)", "", 1, 1);
1477 }elseif(isdisplayed('bugs') == 3)
1478 {
1479 $ths .= html_th("Bugs (see above)", "", 1, 2);
1480 }
1481 if(isdisplayed('version')) $ths .= html_th("Version", "", 1, 5);
1482 if(isdisplayed('excuses')) $ths .= html_th(html_span("Excuses", "", "", "title=\"Raw excuse and Björn Stenberg analysis\""), "", 2, 1);
1483 if(isdisplayed('bin')) $ths .= html_th("Binary" . html_br() . " Package Page", "", 2, 1);
1484 if(isdisplayed('buildd')) $ths .= html_th("Buildd", "", 2, 1);
1485 if(isdisplayed('security')) $ths .= html_th("Security", "", 1, 2);
1486 if(isdisplayed('problems')) $ths .= html_th("Problems", "", 1, 3);
1487 if(isdisplayed('uninstallable')) $ths .= html_th(html_a("Uninstallable", "http://www.debian.org/devel/testing"), "", 1, 3);
1488 if(isdisplayed('watch')) $ths .= html_th("Watch", "", 1, 4);
1489 if(isdisplayed('section')) $ths .= html_th("Section", "", 2, 1);
1490 if(isdisplayed('priority')) $ths .= html_th("Priority", "", 2, 1);
1491 if(isdisplayed('pool')) $ths .= html_th("Pool", "", 2, 1);
1492
1493 $th_level1 = html_tr($ths);
1494 $ths = "";
1495
1496 /* the second header line */
1497 if(isdisplayed('bugs') == 1)
1498 {
1499 $ths .= html_th(html_span("All", "", "", "title=\"All opened bugs\""));
1500 $ths .= html_th(html_span("RC", "", "", "title=\"Release Critical bugs\""));
1501 $ths .= html_th(html_span("I&amp;N", "", "", "title=\"Important &amp; Normal bugs\""));
1502 $ths .= html_th(html_span("M&amp;W", "", "", "title=\"Minor &amp; Wishlist bugs\""));
1503 $ths .= html_th(html_span("F&amp;P", "", "", "title=\"Fixed &amp; Pending bugs\""));
1504 }
1505 elseif(isdisplayed('bugs') == 2)
1506 {
1507 $ths .= html_th(html_span("All", "", "", "title=\"All opened bugs\""));
1508 }
1509 elseif(isdisplayed('bugs') == 3)
1510 {
1511 $ths .= html_th(html_span("All", "", "", "title=\"All opened bugs\""));
1512 $ths .= html_th(html_span("RC", "", "", "title=\"Release Critical bugs\""));
1513 }
1514
1515 if(isdisplayed('version'))
1516 {
1517 $ths .= html_th("Stable");
1518 $ths .= html_th("Testing");
1519 $ths .= html_th("Unstable");
1520 $ths .= html_th(html_span("Prop. Up.", "", "", "title=\"Stable Proposed Updates\""));
1521 $ths .= html_th("Exp.");
1522 }
1523 if(isdisplayed('security'))
1524 {
1525 $ths .= html_th("Stable");
1526 $ths .= html_th("Testing");
1527 }
1528 if(isdisplayed('problems'))
1529 {
1530 $ths .= html_th("Stable");
1531 $ths .= html_th("Testing");
1532 $ths .= html_th("Unstable");
1533 }
1534 if(isdisplayed('uninstallable'))
1535 {
1536 $ths .= html_th("Stable");
1537 $ths .= html_th("Testing");
1538 $ths .= html_th("Unstable");
1539 }
1540 if(isdisplayed('watch'))
1541 {
1542 $ths .= html_th("Watch Unstable");
1543 $ths .= html_th("WWiz Unstable");
1544 $ths .= html_th("Watch Exp.");
1545 $ths .= html_th("WWiz Exp.");
1546 }
1547
1548 $ths = $th_level1 . html_tr($ths);
1549
1550 $trs = array();
1551 $package_line = "";
1552 $back_tr_color = "";
1553 foreach($pack_array as $package)
1554 {
1555 $tr = print_package_entry($branch, $package, $comaint, $back_tr_color);
1556 if($tr){ $trs[] = $tr; }
1557 if ($back_tr_color == "")
1558 {
1559 $back_tr_color = "#dcdcdc";
1560 }else{
1561 $back_tr_color = "";
1562 }
1563 }
1564 print html_table($ths, $trs);
1565 }
1566
1567 function print_subscribed_packages($login, $comaint)
1568 {
1569 global $prefix;
1570 static $subscribe_db;
1571
1572 # section1:pkg1 pkg2;section2:pkg3
1573 if (!$subscribe_db) $subscribe_db = dba_open("$prefix/ddpo_subscribe.db", 'r-', 'db4');
1574
1575 $data = dba_fetch($login, $subscribe_db);
1576 if(!$data) { return; }
1577
1578 $sections = explode(";", $data);
1579 foreach($sections as $section)
1580 {
1581 preg_match("/^([^:]*):(.*)/", $section, $secarray);
1582 print_package_entries($secarray[1], $secarray[2], $comaint);
1583 }
1584 }
1585
1586 # main program
1587
1588 if($comaint == "")
1589 {
1590 $comaint = "yes";
1591 }
1592
1593 if(@$excuse)
1594 {
1595 do_extra($excuse, "excuses", "No excuse for $excuse");
1596 }elseif(@$popcon)
1597 {
1598 do_extra($popcon, "popcon", "No Popularity contest entry for $popcon");
1599 }elseif(@$wnpp)
1600 {
1601 do_extra($wnpp, "wnpp", "No Wnpp entries for $wnpp");
1602 }else if(@$gpg_key)
1603 {
1604 $contents = file("$prefix/ddpo_maintainers");
1605
1606 $match = 0;
1607 $gpg_key = preg_replace ("/0x/i", "", $gpg_key);
1608 foreach ($contents as $line)
1609 {
1610 if(preg_match("/^;[^;]*;[^;]*$gpg_key/i", $line))
1611 {
1612 preg_match("/^;(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*)/i", $line, $pack_array);
1613 $match += 1;
1614 print_header_entries_top($pack_array[1], $pack_array[2], $pack_array[3]);
1615 print_header_entries_body($pack_array[2], $pack_array[3], $comaint, $pack_array[1]);
1616 $count = 4;
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 html_br();
1630 if($match > 10){ break; }
1631 }
1632 }
1633 if($match == 0)
1634 {
1635 print_notfound($gpg_key);
1636 }
1637
1638 printBackLink();
1639 }elseif(@$login)
1640 {
1641 $login = preg_replace ("/\+/", "\+", $login);
1642 if (preg_match("/^[a-z0-9]+$/", $login)) $login .= "@debian.org";
1643
1644 $contents = file("$prefix/ddpo_maintainers");
1645
1646 $match = 0;
1647 foreach($contents as $line)
1648 {
1649 if (preg_match("/^;[^;]*;[^;]*;[^;]*$login/i", $line) || # substring for name
1650 preg_match("/^;$login;/i", $line)) # exact match for mail
1651 {
1652 preg_match("/^;(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*)/i", $line, $pack_array);
1653 $match += 1;
1654 print_header_entries_top($pack_array[1], $pack_array[2], $pack_array[3]);
1655 print_header_entries_body($pack_array[2], $pack_array[3], $comaint, $pack_array[1]);
1656 $count = 4;
1657 foreach ($branch as $value)
1658 {
1659 if($pack_array[$count] != "")
1660 {
1661 print_package_entries($value, $pack_array[$count], $comaint);
1662 $no_packages = true;
1663 }elseif(! $no_packages){
1664 print html_h("No packages in unstable", 3);
1665 $no_packages = true;
1666 }
1667 $count += 1;
1668 }
1669 print_subscribed_packages($pack_array[1], $comaint);
1670 if($arg_cookie[packages])
1671 {
1672 print_package_entries("url", $arg_cookie[packages], $comaint);
1673 }
1674 print html_br();
1675 if($match > 10){ break; }
1676 }
1677 }
1678 if($match == 0)
1679 {
1680 print_notfound($login);
1681 }
1682 printBackLink();
1683 }elseif(@$package)
1684 {
1685 $contents = file("$prefix/ddpo_maintainers");
1686 $package_re = preg_replace("/\+/", ".", $package);
1687
1688 $match = 0;
1689 foreach($contents as $line)
1690 {
1691 if (preg_match("/[; ]${package_re}[; \#]/i", $line))
1692 {
1693 preg_match("/^;(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*)/i", $line, $pack_array);
1694 $match += 1;
1695 print_header_entries_top($pack_array[1], $pack_array[2], $pack_array[3]);
1696 print_header_entries_body($pack_array[2], $pack_array[3], $comaint, $pack_array[1]);
1697 $count = 4;
1698 foreach ($branch as $value)
1699 {
1700 if($pack_array[$count] != "")
1701 {
1702 print_package_entries($value, $pack_array[$count], $comaint);
1703 $no_packages = true;
1704 }elseif(! $no_packages){
1705 print html_h("No packages in unstable", 3);
1706 $no_packages = true;
1707 }
1708 $count += 1;
1709 }
1710 print_subscribed_packages($pack_array[1], $comaint);
1711 if($arg_cookie[packages])
1712 {
1713 print_package_entries("url", $arg_cookie[packages], $comaint);
1714 }
1715 print html_br();
1716 if($match > 10){ break; }
1717 }
1718 }
1719 if($match == 0)
1720 {
1721 print_notfound($package);
1722 }
1723 printBackLink();
1724 }elseif(@$all)
1725 {
1726 print_all();
1727 }else{
1728 print_form();
1729 }
1730
1731 print_footer();
1732 ?>
1733
1734 # vim:sw=4:ft=php:

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.5