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

Contents of /trunk/wml/developer.wml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 818 - (show annotations) (download)
Sat Jul 31 21:50:15 2004 UTC (8 years, 10 months ago) by igenibel
File size: 57311 byte(s)
Complete rewrite:
- less ugly more comprehensive
- extract html code from functional code
- generate full HTML 4.0 Compliant
- separate each collapsable section (Closes: #261991)
- add a display option that show totla bugs and rc bugs (Closes: #262044)
- add some wml tags in order to be HTML compliant (to header.wml)
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
37 error_reporting(0);
38 $time = microtime();
39
40 $branch = array ("main",
41 "contrib",
42 "non-free",
43 "non-US/main",
44 "non-US/contrib",
45 "non-US/non-free" );
46
47 setlocale(LC_ALL, 'fr_FR');
48 setlocale(LC_TIME, 'C');
49 setlocale(LC_NUMERIC, 'C');
50
51 /* pick up cookies information or generate default one */
52 if (!empty($_COOKIE['columnsinfo']) and ($_GET['reset'] != 'yes'))
53 {
54 $tmp = $_COOKIE['columnsinfo'];
55 $arg_cookie = unserialize(base64_decode($tmp));
56 }else{
57 $arg_cookie = array ( bugs => 1,
58 version => 1,
59 excuses => 1,
60 watch => 1,
61 bin => 1,
62 buildd => 1,
63 security => 1,
64 problems => 1,
65 section => 1,
66 priority => 1,
67 pool => 1,
68 uninstallable => 1);
69 }
70 /* always set cookie with that values in order to keep it 3 months old since the last visit */
71 setcookie('columnsinfo', base64_encode(serialize($arg_cookie)), strtotime('+3 month'));
72
73
74 /* if the "reset" arg is passed, need to extract action parameter in order to store the
75 value into the new cookie */
76 if($_GET['reset'] != 'yes')
77 {
78 foreach(array_keys($_GET) as $key)
79 {
80 if (($key == 'comaint') or ($key == 'login') or ($key == 'package') or ($key == 'wnpp') or ($key == 'gpg_key') or ($key == 'popcon'))
81 {
82 continue;
83 }else{
84 $arg_cookie[$key] = $_GET[$key];
85 }
86 }
87 if ($_GET['set'] == 'yes') setcookie('columnsinfo', base64_encode(serialize($arg_cookie)), strtotime('+3 month'));
88 }
89
90 ?>
91
92
93 #use wml::templ::template title="Debian Developer's Packages Overview" author="Igor Genibel"
94
95 {#style#:
96 <style type="text/css">
97 a.dash:link,a.dash:visited,a.dash:active {text-decoration: none;}
98 .general {color:black}
99 .span_general { text-align:left;
100 cursor:pointer;
101 border-bottom-style:dashed;
102 border-width:thin}
103 h3 { font-family: Arial, Helvetica, sans-serif;
104 margin-left:10px }
105 </style>
106 :##}
107
108 {#script#:
109 <script type="text/javascript" language="JavaScript">
110 function objectOver(x){
111 x.style.color="blue";
112 }
113 function objectOut(x){
114 x.style.color="black";
115 }
116 function collapse(x, txt){
117 var oTemp=document.getElementById("text_"+x) ;
118 var oClick=document.getElementById("click_"+x);
119
120 if(oTemp.style.display=="block"){
121 oTemp.style.display="none";
122 oClick.innerHTML=txt+"&nbsp<small>(click to expand)<\/small><br>";
123 }
124 else{
125 oTemp.style.display="block";
126 oClick.innerHTML=txt+"&nbsp<small>(click to collapse)<\/small><br>";
127 }
128 }
129 </script>
130 :##}
131
132 <?
133
134
135 /* Used to return a file line while I didn't find such a function
136 in php
137 Args:
138 $fp: opened file
139 return:
140 String: line
141 */
142 function freadline($fp)
143 {
144 $line = "";
145 do
146 {
147 $line .= fgets($fp, "10240");
148 }
149 while($line != "" && $line[strlen($line)-1] != "\n");
150 return $line;
151 }
152
153
154 /*
155 All generated page are html 4.0 and css1 compliant
156 Action:
157 print the links to w3c
158 */
159 function print_validator()
160 {
161 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>
162 <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>';
163 }
164
165
166 /*
167 Print the footer information such as page generating time.
168 */
169 function print_footer()
170 {
171 global $time;
172 global $prefix;
173 $fp = fopen("$prefix/extract.date", "r");
174 $general = freadline($fp, "512");
175 fclose($fp);
176 $fp = fopen("$prefix/bugs.date", "r");
177 $bugs = freadline($fp, "512");
178 fclose($fp);
179
180 $footer = "Last updated:" . html_br();
181 $footer .= "General information: $general" . html_br();
182 $footer .= "Bug information: $bugs" . html_br();
183 $footer .= "General information is updated once a day." . html_br();
184 $footer .= "Bug information is updated every 15 minutes." .html_br();
185 list($micro,$sec) = explode(' ', microtime());
186 list($smicro,$ssec) = explode(' ', $time);
187 $footer .= "Time needed to generate page: ".($sec-$ssec+$micro-$smicro)."s";
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)
246 {
247 return "<input type=\"text\" size=\"30\" maxlength=\"40\" name=\"$name\">\n";
248 }
249
250 /*
251 hidden field unction
252 Args:
253 $name: the hidden field name
254 $value: hidden field value
255 Returns:
256 a valid html hidden field
257 */
258 function html_input_hidden($name,$value)
259 {
260 return "<input type=\"hidden\" name=\"$name\" value=\"$value\">\n";
261 }
262
263 /*
264 radio button function
265 Args:
266 $name: the radio button field name
267 $value: radio button field value
268 $checked: boolean
269 $text: text to explain the radio button
270 Returns:
271 a valid html radio button
272 */
273 function html_input_radio($name,$value,$checked,$text)
274 {
275 $data = "<input type=\"radio\" name=\"$name\" value=\"$value\"";
276 if($checked) $data .= " checked";
277 $data .= ">$text";
278 return "$data\n";
279 }
280
281 /*
282 table header element
283 Args:
284 $title: header text
285 $extra: th args (align, ...)
286 $rowspan: how many rows in the table the header covers
287 $colspan: how many cols in the table the header covers
288 Returns:
289 A valid table header element
290 */
291 function html_th($title, $extra, $rowspan, $colspan)
292 {
293 if($colspan == "") $colspan = 1;
294 if($rowspan == "") $rowspan = 1;
295 if ($extra != "")
296 {
297 return "<th rowspan=\"$rowspan\" colspan=\"$colspan\">" . html_small_color("$title ", "green") . html_small_color("($extra)", "black") . "</th>\n";
298 }else{
299 return "<th rowspan=\"$rowspan\" colspan=\"$colspan\">" . html_small_color($title, "green") . "</th>\n";
300 }
301 }
302
303 /*
304 table element
305 Args:
306 $data: text element
307 $width: width in %
308 $rowspan: how many rows in the table the element covers
309 $colspan: how many cols in the table the element covers
310 Returns:
311 A valid table element
312 */
313 function html_td($data, $width, $colspan, $rowspan)
314 {
315 if($colspan == "") $colspan = 1;
316 if($rowspan == "") $rowspan = 1;
317 if($width == "")
318 {
319 return "<td rowspan=\"$rowspan\" colspan=\"$colspan\">$data</td>\n";
320 }else{
321 return "<td width=\"$width\" rowspan=\"$rowspan\" colspan=\"$colspan\">$data</td>";
322 }
323 }
324
325 /*
326 table line
327 Args:
328 $data: all tds
329 $align: center, left, right
330 $bgcolor: background color
331 Returns:
332 A valid table line
333 */
334 function html_tr($data, $align, $bgcolor)
335 {
336 if($align == "") $align = "center";
337 if($bgcolor == "")
338 {
339 return "<tr align=\"$align\">$data</tr>\n";
340 }else{
341 return "<tr align=\"$align\" bgcolor=\"$bgcolor\">$data</tr>\n";
342 }
343 }
344
345 /*
346 table
347 Args:
348 $header: all table headers (a tr)
349 $data: array of data lines
350 $width: table width in %
351 Returns:
352 A valid html table
353 */
354 function html_table($header, $data, $width)
355 {
356 if($width == "") $width = 100;
357 $table = "<table width=\"${width}%\" border=\"1\" cellpadding=\"3\" cellspacing=\"1\" summary=\"\">";
358 $table .= $header ;
359 foreach ($data as $line) $table .= $line;
360 return "$table\n</table>\n";
361 }
362
363 /*
364 Html Anchor
365 Args:
366 $text: anchor text
367 $link: anchor link
368 $class: anchor class
369 $title: info bullet text
370 Returns:
371 A valid html anchor
372 */
373 function html_a($text,$link,$class, $title)
374 {
375 if($title != "") $title = " title=\"$title\"";
376 if($class != "")
377 {
378 return "<a class=\"$class\" href=\"$link\"$title>$text</a>";
379 }else{
380 return "<a href=\"$link\"$title>$text</a>";
381 }
382 }
383
384 /*
385 Html headers
386 Args:
387 $text: header text
388 $level: header level
389 $align: header align
390 Returns:
391 A valid html header
392 */
393 function html_h($text, $level, $align)
394 {
395 if ($align == "")
396 {
397 return "<h$level>$text</h$level>\n";
398 }else{
399 return "<h$level align=\"$align\">$text</h$level>\n";
400 }
401 }
402
403 /* The following function are basic html functions (from html_tt to html_span */
404 function html_tt($text)
405 {
406 return "<tt>$text</tt>";
407 }
408
409 function html_b($text)
410 {
411 return "<b>$text</b>";
412 }
413
414 function html_u($text)
415 {
416 return "<u>$text</u>";
417 }
418
419 function html_em($text)
420 {
421 return "<em>$text</em>";
422 }
423
424 function html_p($text)
425 {
426 return "<p>$text</p>";
427 }
428
429
430 function html_blank()
431 {
432 return "&nbsp;";
433 }
434
435 function html_br()
436 {
437 return "<br>\n";
438 }
439
440 function html_hr()
441 {
442 return "<hr>\n";
443 }
444
445 function html_small($text)
446 {
447 return "<small>$text</small>";
448 }
449
450 function html_font($text, $data)
451 {
452 return "<font $data>$text</font>";
453 }
454
455 function html_color($text, $color)
456 {
457 return "<font color=\"$color\">$text</font>";
458 }
459
460 function html_small_color($text,$color)
461 {
462 return html_small(html_color($text, $color));
463 }
464
465 function html_div($text,$id,$class,$extra)
466 {
467 if($class != "")
468 {
469 return "<div id=\"$id\" class=\"$class\" $extra>$text</div>\n";
470 }else{
471 return "<div id=\"$id\" $extra>$text</div>\n";
472 }
473 }
474
475 function html_span($text,$id,$class,$extra)
476 {
477 if($id != "") $id = "id=\"$id\"";
478 if($class != "")
479 {
480 return "<span $id class=\"$class\" $extra>$text</span>\n";
481 }else{
482 return "<span $id $extra>$text</span>\n";
483 }
484 }
485
486 /*
487 This funtion is used to provide the collapsable areas and their title
488 You need to use an auto incremented number in order not to have collisions
489 when expand/collapse an area
490 You need to have a css style class named span_<something>
491 This function return a html valid block
492 */
493 function html_collexp($number, $text, $class, $collapsed, $data)
494 {
495 if($collapsed)
496 {
497 $info = html_blank() . "(click to expand)";
498 $display = "none";
499 }else{
500 $info = html_blank() . "(click to collapse)";
501 $display = "block";
502 }
503 $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\")'");
504 $result .= html_div($data, "text_$number", $class, "style='margin-left:0;display:$display'") ;
505 return $result;
506 }
507
508 /*
509 Function needed to know if the columns has to be displayed or not
510 */
511 function isdisplayed($value)
512 {
513 global $arg_cookie;
514 return $arg_cookie[$value];
515 }
516
517 /*
518 This function is used for the display settings table
519 Note that there is a exception with bugs
520 */
521 function checkbox($value)
522 {
523 global $arg_cookie;
524 if($arg_cookie[$value] == 1)
525 {
526 $data = html_input_radio($value,1,true,"Show\n") . html_br();
527 $data .= html_input_radio($value,0,false,"Hide") . html_br();
528 }else{
529 $data = html_input_radio($value,1,false,"Show\n") . html_br();
530 $data .= html_input_radio($value,0,true,"Hide") . html_br();
531 }
532 if($value == 'bugs')
533 {
534 if($arg_cookie[$value] == 2)
535 {
536 $data = html_input_radio($value,1,false,"Show\n") . html_br();
537 $data .= html_input_radio($value,0,false,"Hide\n") . html_br();
538 $data .= html_input_radio($value,2,true,"Sum.\n") . html_br();
539 $data .= html_input_radio($value,3,false,"Sum. &amp; RC\n") . html_br();
540 }elseif($arg_cookie[$value] == 3)
541 {
542 $data = html_input_radio($value,1,false,"Show\n") . html_br();
543 $data .= html_input_radio($value,0,false,"Hide\n") . html_br();
544 $data .= html_input_radio($value,2,false,"Sum.\n") . html_br();
545 $data .= html_input_radio($value,3,true,"Sum. &amp; RC\n") . html_br();
546 }elseif($arg_cookie[$value] == 1)
547 {
548 $data = html_input_radio($value,1,true,"Show\n") . html_br();
549 $data .= html_input_radio($value,0,false,"Hide\n") . html_br();
550 $data .= html_input_radio($value,2,false,"Sum.\n") . html_br();
551 $data .= html_input_radio($value,3,false,"Sum. &amp; RC\n") . html_br();
552 }else{
553 $data = html_input_radio($value,1,false,"Show\n") . html_br();
554 $data .= html_input_radio($value,0,true,"Hide\n") . html_br();
555 $data .= html_input_radio($value,2,false,"Sum.\n") . html_br();
556 $data .= html_input_radio($value,3,false,"Sum. &amp; RC\n") . html_br();
557 }
558 }
559 $data = html_small_color($data,"green");
560 return $data;
561 }
562
563
564 /*
565 return hidden fields with action parameters to be provided for the form validation
566 */
567 function setaction()
568 {
569 $action = "";
570 global $_GET;
571 foreach(array_keys($_GET) as $key)
572 {
573 if (($key == 'login') or ($key == 'package') or ($key == 'gpg_key') or ($key == 'comaint'))
574 {
575 $action .= html_input_hidden($key,$_GET[$key]);
576 }
577 }
578 return $action;
579 }
580
581 /* These functions provides links to the bts for a maintainer */
582 function bugs_nonfixed($login)
583 {
584 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");
585 }
586
587 function bugs_all_related($login)
588 {
589 return html_a("All bugs related to &lt;$login;&gt;", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?maint=". urlencode($login) . ">");
590 }
591
592 function bugs_rc($login)
593 {
594 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");
595 }
596
597 function bugs_submitter($login)
598 {
599 return html_a("All bugs submitted by &lt;$login&gt;", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?submitter=" . urlencode($login));
600 }
601
602 /* Functions used to construct the correct links in several fields (from bugs_display to stat_bug_link) */
603 function bugs_display($bug_number, $base_url)
604 {
605 $bug_link="";
606 preg_match("/(\d+)\((\d+)\)/", $bug_number, $result);
607 if (strcmp($result[1], $result[2]) == 0)
608 {
609 $bug_link = html_a($result[1], $base_url, "a");
610 }else{
611 $bug_link = html_a($result[1], "${base_url}&amp;repeatmerged=no", "a");
612 $bug_link .= html_blank() . html_a($result[2], "${base_url}&amp;repeatmerged=yes", "a");
613 }
614 return $bug_link;
615 }
616
617 function lintian_link($lintian)
618 {
619 return html_a("Lintian report", "http://lintian.debian.org/reports/m${lintian}.html");
620 }
621
622 function buildd_link($buildd)
623 {
624 return html_a("Buildd report", "http://buildd.debian.org/bymaint.php?maint=$buildd");
625 }
626
627 function stat_bug_link($login)
628 {
629 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));
630 }
631
632 /* Function is used to display or not the extra features such as pocon, wnpp, and excuses */
633 function do_extra($data, $data_prefix, $error)
634 {
635 global $prefix;
636 $data = str_replace(" ", "+", $data);
637 $filepath = "$prefix/$data_prefix/" . $data{0} . "/$data";
638 if(file_exists($filepath))
639 {
640 $fp = fopen($filepath,"r");
641 print fread ($fp, filesize($filepath));
642 fclose($fp);
643 }else{
644 print html_h($error, 2);
645 }
646 }
647
648
649 function printBackLink() {
650 print html_p(html_a("Back to main page", "developer.php", ""));
651 }
652
653 /* function used to display the main maintainer links in a collapsable area */
654 function print_header_entries_body($keys, $name, $comaint, $login)
655 {
656 global $counter_span;
657 global $prefix;
658 $add_comaint = "&amp;comaint=$comaint";
659 $lintian = preg_replace('/%../', "_", urlencode($name));
660 $lintian = preg_replace('/\+/', "_", $lintian);
661 $fp = fopen("$prefix/../../ftp/Maintainers", "r");
662 $ok = 0;
663 while(!feof($fp))
664 {
665 $line = freadline($fp, "10240");
666 if (preg_match("/$login/", $line))
667 {
668 $ok = 1;
669 $login = preg_replace('/\\\\/', '', $login);
670 if (preg_match("/$login \(/", $line))
671 {
672 $buildd=urlencode("$login ($name) ");
673 }else{
674 $buildd=urlencode("$name <$login> ");
675 }
676 }
677 if ($ok == 1 )
678 {
679 break;
680 }
681 }
682 fclose($fp);
683 $counter_span += 1;
684 $title = html_b("General information for Id: $login");
685 $maintainer_data = "";
686 if ($keys == "NOID")
687 {
688 $maintainer_data = html_font("GPG key id not found!", 'size="+1" color="red"');
689 $maintainer_data .= html_blank() . html_font("(key id was not found neither in the Debian keyring nor on a public keyserver)", 'size="-2"');
690 $maintainer_data .= html_br();
691 }else{
692 $maintainer_data .= "GPG key id: ";
693 foreach (explode(",", $keys) as $key)
694 {
695 $maintainer_data .= html_small(html_a($key, "developer.php?gpg_key=" .$key . $add_comaint)) . " ";
696 }
697 $maintainer_data .= html_br();
698 }
699 $maintainer_data .= html_small(bugs_nonfixed($login)) . html_br();
700 $maintainer_data .= html_small(bugs_all_related($login)) . html_br();
701 $maintainer_data .= html_small(bugs_rc($login)) . html_br();
702 $maintainer_data .= html_small(bugs_submitter($login)) . html_br();
703 $maintainer_data .= html_small(lintian_link($lintian)) . html_br();
704 $maintainer_data .= html_small(buildd_link($buildd)) . html_br();
705 $maintainer_data .= html_small(stat_bug_link($login));
706 if(file_exists("$prefix/wnpp/" . $login{0} . "/$login"))
707 {
708 $maintainer_data .= html_br() . html_small(html_a("Wnpp bugs opened by &lt;$login&gt;", "developer.php?wnpp=$login"));
709 }
710
711 print html_collexp($counter_span, $title, "general", false, $maintainer_data);
712 }
713
714 /* Function used to display the generic information (help and display settings) */
715 function print_header_entries_top($login, $key, $name)
716 {
717 global $counter_span;
718 global $already_displayed;
719 if(! $already_displayed) {
720 print html_h("Packages overview for $name", 1, "center");
721 }
722 if(! $already_displayed)
723 {
724 $counter_span += 1;
725 $display_data = "You are able to display only the columns you want/need.". html_br();
726 $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();
727 $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();
728 $display_data .= "Please select the configuration you want (check the boxes corresponding to columns name if you want to keep it displayed):";
729 $display_data = html_small($display_data);
730 $display_table_th = html_th("Bugs","&amp;bugs=");
731 $display_table_th .= html_th("Version","&amp;version=");
732 $display_table_th .= html_th("Excuses","&amp;excuses=");
733 $display_table_th .= html_th("Binary" . html_br() . "Package Page","&amp;bin=");
734 $display_table_th .= html_th("Buildd","&amp;buildd=");
735 $display_table_th .= html_th("Security","&amp;security=");
736 $display_table_th .= html_th("Problems","&amp;problems=");
737 $display_table_th .= html_th("Uninstallable","&amp;uninstallable=");
738 $display_table_th .= html_th("Watch","&amp;watch=");
739 $display_table_th .= html_th("Section","&amp;section=");
740 $display_table_th .= html_th("Priority","&amp;priority=");
741 $display_table_th .= html_th("Pool","&amp;pool=");
742
743 $display_table_tds = html_td(checkbox('bugs'));
744 $display_table_tds .= html_td(checkbox('version'));
745 $display_table_tds .= html_td(checkbox('excuses'));
746 $display_table_tds .= html_td(checkbox('bin'));
747 $display_table_tds .= html_td(checkbox('buildd'));
748 $display_table_tds .= html_td(checkbox('security'));
749 $display_table_tds .= html_td(checkbox('problems'));
750 $display_table_tds .= html_td(checkbox('uninstallable'));
751 $display_table_tds .= html_td(checkbox('watch'));
752 $display_table_tds .= html_td(checkbox('section'));
753 $display_table_tds .= html_td(checkbox('priority'));
754 $display_table_tds .= html_td(checkbox('pool'));
755
756 $display_table_tr = html_tr($display_table_tds, "left");
757
758 $display_data .= html_table(html_tr($display_table_th), array($display_table_tr));
759
760 $preamble = setaction() . html_input_hidden("set", "yes");
761 $display_data = html_form("GET", $preamble, $display_data, "Submit");
762
763 $preamble = setaction() . html_input_hidden("reset", "yes");
764 $display_data .= html_form("GET", $preamble, "", "Show all");
765
766 //$display_data = html_small($display_data);
767 $title = html_b("Display configuration:");
768 print html_br() . html_collexp($counter_span, $title, "general", true, $display_data);
769
770 $counter_span += 1;
771 $help_data = "Packages in " . html_color("blue", "blue") . " are packages that are co-maintained by developer (reference to Uploaders: field)" . html_br();
772 $help_data .= "Packages version in " . html_color("red", "red") . " are NMUed" . html_br();
773 $help_data .= "Packages where testing version in " . html_color("magenta", "#ff00ff") . " are those where the unstable version differs from the version in testing" . html_br();
774 $help_data .= "Packages where Upstream/Wwiz version in " . html_color("green", "green") . " are those where the upstream finded version is in sync with version unstable/experimental" . html_br();
775 $help_data .= "Packages where Upstream/Wwiz version in " . html_color("magenta", "#ff00ff") . " are those where the upstream finded version is greater than version in unstable" . html_br();
776 $help_data .= "Packages where Upstream/Wwiz version in " . html_color("navy blue", "#2222AA") . " are those where the upstream finded version is lower than version in unstable (a bug in the Watch file)" . html_br();
777 $help_data .= "Packages where Upstream/Wwiz is " .html_color("error", "red") . "are those where the uscan had problems following the Watch file" . html_br();
778 $help_data .= "Packages where Upstream is N/A are those that doesn't had a Watch file" . html_br();
779 $help_data .= "Packages where Wwiz is N/A are those that doesn't had a Copyright file for trying to automatically generate a Watch file" . html_br();
780 $help_data .= "Packages where Wwiz is " . html_color("notmatch", "red") . " are those that had a Copyright file but no useful url download link was found for trying to automatically generate a Watch file" . html_br();
781 $help_data .= "If watch values are " . html_color("no value", "grey") . " means that there is a pb with dehs db files." . html_br() . html_br();
782 $help_data .= html_u("The real number of bugs is displayed in each bugs column. If there are any merged bugs, the total is displayed within parenthesis.");
783 $help_data = html_small($help_data);
784
785 $title = html_b("Help");
786 print html_collexp($counter_span, $title, "general", true, $help_data);
787 $already_displayed = true;
788 }
789 }
790
791
792 function print_notfound($login)
793 {
794 print html_h("No information available for $login", 2);
795 }
796
797
798 /* Construct page provided when no command is provided */
799 function print_form()
800 {
801 $html_data = html_h("Debian Developer's Packages Overview", 1);
802 $html_data .= html_p("Use the following search forms to determine the Debian developer whose packages overview you wish to see:");
803
804 $preamble = "Search based on the " . html_tt("Maintainer") . " field in packages:" . html_br();
805 $preamble .= html_input_text("login");
806 $preamble = html_label($preamble) . html_br();
807
808 $form_data = "Display co-maintained packages:" . html_blank();
809 $form_data .= html_input_radio("comaint", "yes", true, "yes");
810 $form_data .= html_input_radio("comaint", "no", false, "no");
811 $form_data .= html_input_radio("comaint", "only", false, "only");
812 $form_data = html_label($form_data) . html_br();
813
814 $form = html_form("GET", $preamble, $form_data, "Find");
815
816 $form .= html_small("If a single username is provided, @debian.org is automatically appended.") .html_br();
817 $form .= 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();
818
819 $preamble = "Search based on the " . html_tt("GPG key ID:") . html_br();
820 $preamble .= html_input_text("gpg_key");
821 $preamble = html_label($preamble) . html_br();
822
823 $form_data = "Display co-maintained packages:" . html_blank();
824 $form_data .= html_input_radio("comaint", "yes", true, "yes");
825 $form_data .= html_input_radio("comaint", "no", false, "no");
826 $form_data .= html_input_radio("comaint", "only", false, "only");
827 $form_data = html_label($form_data) .html_br();
828
829 $form .= html_form("GET", $preamble, $form_data, "Find") . html_br();
830
831 $preamble = "Search based on a " . html_tt("source package name:") . html_br();
832 $preamble .= html_input_text("package");
833 $preamble = html_label($preamble) . html_br();
834
835 $form_data = "Display co-maintained packages:" . html_blank();
836 $form_data .= html_input_radio("comaint", "yes", true, "yes");
837 $form_data .= html_input_radio("comaint", "no", false, "no");
838 $form_data .= html_input_radio("comaint", "only", false, "only");
839 $form_data = html_label($form_data) .html_br();
840
841 $form .= html_form("GET", $preamble, $form_data, "Find");
842
843 $query = "Do you want to see the complete, sorted list of developers? " . html_b("200kb!");
844 $hidden = html_input_hidden("all", "1");
845 $form .= $query . html_form("POST", $hidden, "", "Show the list") . html_br();
846 print $form;
847 }
848
849 /* Construct the page where all maintainer are displayed */
850 function print_all()
851 {
852 global $prefix;
853 $fp = fopen("$prefix/extract", "r");
854 $html = html_h("Sorted developer list", 2);
855
856 $display_table_th = html_th("Name and email");
857 $display_table_th .= html_th("main");
858 $display_table_th .= html_th("non-us");
859 $display_table_th .= html_th("Other" . html_br(), html_small("all contrib &amp;" . html_br() . "non-free packages"));
860 $display_table_th .= html_th("Total");
861 $trs = array();
862 while(!feof($fp))
863 {
864 $line = freadline($fp, "10240");
865 if($line != "")
866 {
867 $count = 0;
868 $line = preg_replace("/, /", ",", $line);
869 preg_match("/;(.+?);(.+?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*)$/", $line, $info_array);
870
871 $tds = html_td(html_b(html_a(str_replace(" ", html_blank(), "$info_array[3]") . html_blank() . "&lt;$info_array[1]&gt;", "developer?login=" . rawurlencode($info_array[1]))), 15);
872 $main = 0;
873 $nonUS = 0;
874 $other = 0;
875 if($info_array[4] != "")
876 {
877 $main += count(explode(" ", $info_array[4]));
878 $count += count(explode(" ", $info_array[4]));
879 }
880 if($info_array[5] != "")
881 {
882 $other += count(explode(" ", $info_array[5]));
883 $count += count(explode(" ", $info_array[5]));
884 }
885 if($info_array[6] != "")
886 {
887 $nonUS += count(explode(" ", $info_array[6]));
888 $count += count(explode(" ", $info_array[6]));
889 }
890 if($info_array[7] != "")
891 {
892 $other += count(explode(" ", $info_array[7]));
893 $count += count(explode(" ", $info_array[7]));
894 }
895 if($info_array[8] != "")
896 {
897 $other += count(explode(" ", $info_array[8]));
898 $count += count(explode(" ", $info_array[8]));
899 }
900 if($info_array[9] != "")
901 {
902 $other += count(explode(" ", $info_array[9]));
903 $count += count(explode(" ", $info_array[9]));
904 }
905
906 $tds .= html_td($main) . html_td($nonUS) . html_td($other) . html_td(html_b($count));
907 $trs[] = html_tr($tds, "center");
908 }
909 }
910 print html_table(html_tr($display_table_th), $trs, "80");
911 }
912
913 /* Small useful function to construct the link to the excuses */
914 function get_rep($package_name)
915 {
916 if(preg_match("/^lib/", $package_name)) {
917 return substr($package_name, 0, 4);
918 }else{
919 return substr($package_name, 0, 1);
920 }
921 }
922 # Begin of Dehs functions
923 function dehsdb_conn ($dbname,$mode)
924 {
925 $id = dba_open($dbname, $mode, "db2");
926 return $id;
927 }
928
929 function dehsdb_xml($xml)
930 {
931 $p = xml_parser_create();
932 xml_parse_into_struct($p, $xml, $vals, $index);
933 xml_parser_free($p);
934 $values=array("id"=>$vals[1][value],"up_version"=>$vals[2][value],"wwiz"=>$vals[3][value]);
935 return $values;
936 }
937 function dehs_value($pkg_name,$dist)
938 {
939 $id = dehsdb_conn("/org/qa.debian.org/data/dehs/dehs_qa_" . $dist . ".db","r");
940 if(!$id) return "error";
941 if (!dba_exists($pkg_name,$id)) return array("id"=>"-","up_version"=>"-","wwiz"=>"-");
942 $xml=dba_fetch($pkg_name,$id);
943 dba_close($id);
944 return dehsdb_xml($xml);
945 }
946 function vers_conv($debvers) {
947 preg_match("/(.+:)?(.+)(ds-|-)/",$debvers,$matches);
948 return $matches[2];
949 }
950 function ver_comp($a,$b) {
951 exec("dpkg --compare-versions '$a' gt '" . vers_conv($b) . "'",$output,$res);
952 if ($res==0) return 1;
953 exec("dpkg --compare-versions '$a' lt '" . vers_conv($b) . "'",$output,$res);
954 if ($res==0) return 2;
955 else return 3;
956 }
957 function print_dehs($package,$version,$dist,$type)
958 {
959 $dehs_values=dehs_value($package,$dist);
960 if($dehs_values=="error") return html_td(html_small_color("no value", "grey"));
961 if ($type=="up_version")
962 {
963 $dehs_link= html_small(html_br() . html_a("Details", "http://dehs.alioth.debian.org/maintainer.php?name=" . rawurlencode($package)));
964 if($dehs_values[up_version]=="-")
965 {
966 $dehs_values[up_version] = html_small("-");
967 $dehs_link='';
968 }
969 elseif ($dehs_values[up_version]=='N/A')
970 {
971 $color="black";
972 }
973 elseif ($dehs_values[up_version]=='Error') $color="red";
974 elseif(ver_comp($dehs_values[up_version],$version)==1) $color="magenta";
975 elseif(ver_comp($dehs_values[up_version],$version)==2) $color="#2222AA";
976 else {
977 $color="green";
978 $dehs_link='';
979 }
980 $upstream_print = html_td(html_small_color($dehs_values[up_version], $color) . $dehs_link, "", 1, 1);
981 return $upstream_print;
982 }else{
983 $wwiz_link_desc="Details";
984 if($dehs_values[wwiz]=='-' or !$dehs_values[wwiz])
985 {
986 $dehs_values[wwiz] = html_small("-");
987 $dehs_link='';
988 }
989 elseif ($dehs_values[wwiz]=='N/A') $color="black";
990 elseif ($dehs_values[wwiz]=='error' OR $dehs_values[wwiz]=='notmatch') $color="red";
991 elseif(ver_comp($dehs_values[wwiz],$version)==1)
992 {
993 $color="magenta";
994 $wwiz_link_desc="Watch";
995 }
996 elseif(ver_comp($dehs_values[wwiz],$version)==2)
997 {
998 $color="#2222AA";
999 $wwiz_link_desc="Watch";
1000 }else{
1001 $color="green";
1002 $wwiz_link_desc="Watch";
1003 }
1004 if(!isset($dehs_link))
1005 {
1006 $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"));
1007 }
1008 $wwiz_print= html_td(html_small_color($dehs_values[wwiz], $color, "", 1, 1));
1009 return $wwiz_print;
1010 }
1011 }
1012 # Check whether there is a debcheck entry for that package
1013 function debcheckavailable($branch, $package_name)
1014 {
1015 $package = ereg_replace ("\.", "_", $package_name);
1016 if(ereg ("[^a-zA-Z0-9+_-]", $package) ||
1017 ($branch != "oldstable" && $branch != "stable" && $branch != "testing" && $branch != "unstable"))
1018 {
1019 return 0;
1020 }
1021 $BASEDIR='/org/qa.debian.org/data/debcheck/result/';
1022 return file_exists($BASEDIR.'/'.$branch.'/packages/'.$package);
1023 }
1024
1025 /*
1026 This function print a package table information for specific branch
1027 given in argument
1028 */
1029 function print_package_entries($branch, $packages, $comaint)
1030 {
1031 global $prefix;
1032 $packages = preg_replace ("/, /", ",", $packages);
1033 $pack_array = split(" ", $packages);
1034 $global_count = count($pack_array);
1035 $all = 0;
1036
1037 if ($comaint == "no")
1038 /* don't display co-maintained packages */
1039 {
1040 $result = 0;
1041 for ($i = 0; $i < strlen($packages); $i++)
1042 {
1043 if ($packages[$i] == '#')
1044 {
1045 $result += 1;
1046 }
1047 }
1048 $global_count -= $result;
1049 }elseif($comaint == "only")
1050 /* Only display co-maintained packages */
1051 {
1052 $result = 0;
1053 for ($i = 0; $i < strlen($packages); $i++)
1054 {
1055 if ($packages[$i] == '#')
1056 {
1057 $result += 1;
1058 }
1059 }
1060 $global_count = $result;
1061 }
1062
1063 print html_h("Packages in " . html_em($branch) . "($global_count)", 3);
1064
1065
1066 /* contruct the table header */
1067 $ths = html_th("Source" . html_blank(). "Name", "", 2);
1068 if(isdisplayed('bugs') == 1)
1069 {
1070 $ths .= html_th("Bugs(see above)", "", 1, 5);
1071 }elseif(isdisplayed('bugs') == 2)
1072 {
1073 $ths .= html_th("Bugs(see above)", "", 1, 1);
1074 }elseif(isdisplayed('bugs') == 3)
1075 {
1076 $ths .= html_th("Bugs(see above)", "", 1, 2);
1077 }
1078 if(isdisplayed('version')) $ths .= html_th("Version", "", 1, 5);
1079 if(isdisplayed('excuses')) $ths .= html_th(html_span("Excuses", "", "", "title=\"Raw excuse and Björn Stenberg analysis\""), "", 2, 1);
1080 if(isdisplayed('bin')) $ths .= html_th("Binary" . html_br() . " Package Page", "", 2, 1);
1081 if(isdisplayed('buildd')) $ths .= html_th("Buildd", "", 2, 1);
1082 if(isdisplayed('security')) $ths .= html_th("Security", "", 1, 2);
1083 if(isdisplayed('problems')) $ths .= html_th("Problems", "", 1, 3);
1084 if(isdisplayed('uninstallable')) $ths .= html_th(html_a("Uninstallable", "http://www.debian.org/devel/testing"), "", 1, 3);
1085 if(isdisplayed('watch')) $ths .= html_th("Watch", "", 1, 4);
1086 if(isdisplayed('section')) $ths .= html_th("Section", "", 2, 1);
1087 if(isdisplayed('priority')) $ths .= html_th("Priority", "", 2, 1);
1088 if(isdisplayed('pool')) $ths .= html_th("Pool", "", 2, 1);
1089
1090 $th_level1 = html_tr($ths);
1091 $ths = "";
1092
1093 /* the second header line */
1094 if(isdisplayed('bugs') == 1)
1095 {
1096 $ths .= html_th(html_span("All", "", "", "title=\"All opened bugs\""));
1097 $ths .= html_th(html_span("RC", "", "", "title=\"Release Critical bugs\""));
1098 $ths .= html_th(html_span("I&amp;N", "", "", "title=\"Important &amp; Normal bugs\""));
1099 $ths .= html_th(html_span("M&amp;W", "", "", "title=\"Minor &amp; Wishlist bugs\""));
1100 $ths .= html_th(html_span("F&amp;P", "", "", "title=\"Fixed &amp; Pending bugs\""));
1101 }
1102 elseif(isdisplayed('bugs') == 2)
1103 {
1104 $ths .= html_th(html_span("All", "", "", "title=\"All opened bugs\""));
1105 }
1106 elseif(isdisplayed('bugs') == 3)
1107 {
1108 $ths .= html_th(html_span("All", "", "", "title=\"All opened bugs\""));
1109 $ths .= html_th(html_span("RC", "", "", "title=\"Release Critical bugs\""));
1110 }
1111
1112 if(isdisplayed('version'))
1113 {
1114 $ths .= html_th("Stable");
1115 $ths .= html_th("Testing");
1116 $ths .= html_th("Unstable");
1117 $ths .= html_th(html_span("Prop. Up.", "", "", "title=\"Stable Proposed Updates\""));
1118 $ths .= html_th("Experimental");
1119 }
1120 if(isdisplayed('security'))
1121 {
1122 $ths .= html_th("Stable");
1123 $ths .= html_th("Testing");
1124 }
1125 if(isdisplayed('problems'))
1126 {
1127 $ths .= html_th("Stable");
1128 $ths .= html_th("Testing");
1129 $ths .= html_th("Unstable");
1130 }
1131 if(isdisplayed('uninstallable'))
1132 {
1133 $ths .= html_th("Stable");
1134 $ths .= html_th("Testing");
1135 $ths .= html_th("Unstable");
1136 }
1137 if(isdisplayed('watch'))
1138 {
1139 $ths .= html_th("Upstream Uns.");
1140 $ths .= html_th("WWiz Up. Uns.");
1141 $ths .= html_th("Upstream Exp.");
1142 $ths .= html_th("WWiz Up. Exp.");
1143 }
1144
1145 $ths = $th_level1 . html_tr($ths);
1146
1147 $trs = array();
1148 $package_line = "";
1149 foreach($pack_array as $package)
1150 {
1151 $uploader = false;
1152 preg_match("/(.+)\((.+)\)/", $package, $result);
1153 $list = split (",", $result[2]);
1154 $package_name = $result[1];
1155 if(strstr($package, "#"))
1156 {
1157 $uploader = 1;
1158 $package = str_replace("#", "", $package);
1159 }
1160 if ((($uploader == 1) && ( $comaint == "no")) ||
1161 (($uploader == 0) && ( $comaint == "only"))) continue;
1162 if(strstr($package, "%"))
1163 {
1164 $all = 1;
1165 $package = str_replace("%", "", $package);
1166 }
1167 preg_match("/(.+?)\[(.+)\]\{(.+)\}\{(.+)\}\{(.+)\}\|(.*)\|:(.*):/", $package, $results);
1168 $package = $package_name;
1169 $version = $results[2];
1170 $versions = explode (",", $version);
1171 $version_stable = $versions[0];
1172 $version_testing = $versions[1];
1173 $version_unstable = $versions[2];
1174 $version_prop = $versions[3];
1175 $version_experimental = $versions[4];
1176 $version_experimental_backup= $versions[4];
1177 $security_stable = $versions[5];
1178 $security_testing = $versions[6];
1179 $uninstalable_stable = preg_replace("/,/", html_blank(), $results[3]);
1180 $uninstalable_testing = preg_replace("/,/", html_blank(), $results[4]);
1181 $uninstalable_unstable = preg_replace("/,/", html_blank(), $results[5]);
1182 $priority = $results[6];
1183 $section = $results[7];
1184
1185 // make $bugsdb link persistent during this pagerequest, we don't lock, so
1186 // this doesn't matter at all
1187 static $bugsdb;
1188 if (!$bugsdb) $bugsdb = dba_open("$prefix/bugs.db", 'r-', 'db2');
1189
1190 if (!($bug_list = dba_fetch($package, $bugsdb))) $bug_list = '0(0) 0(0) 0(0) 0(0)';
1191 $bug_list = explode(' ', $bug_list);
1192
1193 if(strcmp($version_stable, "-") == 0 || !debcheckavailable('stable', $package))
1194 {
1195 $stable_dep = html_small("-");
1196 }else{
1197 $stable_dep = html_small(html_a("Stable", "http://qa.debian.org/debcheck.php?dist=stable&amp;package=" . rawurlencode($package)));
1198 }
1199
1200 if(strcmp($version_testing, "-")== 0 || !debcheckavailable('testing', $package))
1201 {
1202 $testing_dep = html_small("-");
1203 }else{
1204 $testing_dep = html_small(html_a("Testing", "http://qa.debian.org/debcheck.php?dist=testing&amp;package=" . rawurlencode($package)));
1205 }
1206
1207 if(strcmp($version_unstable, "-")== 0 || !debcheckavailable('unstable', $package))
1208 {
1209 $sid_dep = html_small("-");
1210 }else{
1211 $sid_dep = html_small(html_a("Unstable", "http://qa.debian.org/debcheck.php?dist=unstable&amp;package=" . rawurlencode($package)));
1212 }
1213
1214 $buildd = "http://buildd.debian.org/build.php?pkg=".$package;
1215 if(strstr($branch, "non-US"))
1216 {
1217 $pool = "http://non-us.debian.org/debian-non-US/pool/". $branch . "/" .get_rep($package) . "/" . $package . "/";
1218 }else{
1219 $pool = "http://ftp.debian.org/debian/pool/". $branch . "/" .get_rep($package) . "/" . $package . "/";
1220 }
1221
1222 if(file_exists("$prefix/excuses/" . $package{0} . "/$package"))
1223 {
1224 $excuse = html_a("Excuses", "developer.php?excuse=$package") . " ";
1225 $excuse .= html_a("More", "http://bjorn.haxx.se/debian/testing.pl?package=$package");
1226 }else{
1227 $excuse = "-";
1228 }
1229 if(strcmp($version_prop, "-"))
1230 {
1231 $version_prop = html_color(html_b($version_prop), "#2222AA");
1232 }
1233 $prop = html_td(html_small($version_prop));
1234
1235 if(strcmp($version_experimental, "-"))
1236 {
1237 $version_experimental = html_color(html_b($version_experimental), "#2222AA");
1238 }
1239 $experimental = html_td(html_small($version_experimental));
1240
1241
1242 if((strcmp ($version_stable, $version_testing) == 0) &&
1243 (strcmp ($version_stable, "/") != 0))
1244 {
1245 if((strcmp ($version_unstable, $version_testing) == 0))
1246 {
1247 $version_print = html_td(html_small($version_stable), "", 3, 1) . $prop . $experimental;
1248 }else{
1249 $version_print = html_td(html_small($version_stable), "", 2, 1) . html_td(html_small($version_unstable)) . $prop . $experimental;
1250 }
1251 $ver = explode("-", $version_unstable);
1252 if((preg_match("/(.+\..+?)$/", $ver[count($ver) - 1], $toto)) && (count($ver) != 1))
1253 {
1254 $version_print = str_replace("$version_unstable", html_color($version_unstable, "red"), $version_print);
1255 }
1256 }elseif(strcmp ($version_testing, $version_unstable) == 0)
1257 {
1258 if(strcmp($version_stable, "/") != 0)
1259 {
1260 $version_stable = html_color($version_stable, "#00AADD");
1261 }
1262 $version_print = html_td(html_small($version_stable)) . html_td(html_small($version_testing), "", 2, 1) . $prop . $experimental;
1263 $ver = explode("-", $version_unstable);
1264 if((preg_match("/(.+\..+?)$/", $ver[count($ver) - 1], $toto)) && (count($ver) != 1))
1265 {
1266 $version_print = str_replace("$version_unstable", html_color($version_unstable, "red"), $version_print);
1267 }
1268 }else{
1269 if(strcmp($version_stable, "/") != 0)
1270 {
1271 $version_stable = html_small_color($version_stable, "#00AADD");
1272 }else{
1273 $version_stable = html_small($version_stable);
1274 }
1275 $version_print = html_td($version_stable) . html_td(html_small_color($version_testing, "#ff00ff")) . html_td(html_small($version_unstable)) . $prop . $experimental;
1276 $ver = explode("-", $version_unstable);
1277 if((preg_match("/(.+\..+?)$/", $ver[count($ver) - 1], $toto)) && (count($ver) != 1))
1278 {
1279 $version_print = str_replace("$version_unstable", html_color($version_unstable, "red"), $version_print);
1280 }
1281 }
1282 $back_tr_color = "";
1283 if (@$background)
1284 {
1285 $background=false;
1286 }else{
1287 $back_tr_color = "#dcdcdc";
1288 $background=true;
1289 }
1290
1291 $line = "";
1292 $line_data = html_b($package) . html_br() . html_a("[pts]", "http://packages.qa.debian.org/".get_rep($package)."/$package.html") . html_blank() . html_a("[popcon]", "developer.php?popcon=$package");
1293 if($uploader == 1)
1294 {
1295 $line = html_td(html_small_color($line_data, "blue"));
1296 }else{
1297 $line = html_td(html_small($line_data));
1298 }
1299
1300
1301 /* if bugs >= 1 always print the summary */
1302 if(isdisplayed('bugs'))
1303 {
1304 $bugs = "http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=". rawurlencode($package)."&amp;archive=no&amp;pend-exc=pending-fixed&amp;pend-exc=fixed&amp;pend-exc=done";
1305 $bugs_all = "http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=". rawurlencode($package);
1306 $bug_count = $bug_list[0] + $bug_list[1] + $bug_list[2] + $bug_list[3];
1307 $real_bug_count = 0;
1308 $bug_data = "";
1309 foreach($bug_list as $bug_item)
1310 {
1311 preg_match("/\d+\((\d+)\)/", $bug_item, $count_array);
1312 $real_bug_count += $count_array[1];
1313 }
1314 if($bug_count == 0)
1315 {
1316 $bug_data = html_a("-", $bugs_all, "dash");
1317 }else{
1318 $bug_data = bugs_display("$bug_count($real_bug_count)", $bugs_all);
1319 }
1320 $line .= html_td(html_small($bug_data));
1321
1322 /* user want to display all the bugs info */
1323 if(isdisplayed('bugs') == 1)
1324 {
1325 if(!strcmp($bug_list[0], "0(0)"))
1326 {
1327 $bug_data = html_a("-", $nobugs . "&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious", "dash");
1328 }else{
1329 $bug_data = bugs_display($bug_list[0], "$bugs" . "&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious");
1330 }
1331 $line .= html_td(html_small($bug_data));
1332
1333 if(!strcmp($bug_list[1], "0(0)"))
1334 {
1335 $bug_data = html_a("-", $nobugs . "&amp;sev-inc=important&amp;sev-inc=normal", "dash");
1336 }else{
1337 $bug_data = bugs_display($bug_list[1], "$bugs" . "&amp;sev-inc=important&amp;sev-inc=normal");
1338 }
1339 $line .= html_td(html_small($bug_data));
1340
1341 if(!strcmp($bug_list[2], "0(0)"))
1342 {
1343 $bug_data = html_a("-", $nobugs . "&amp;sev-inc=minor&amp;sev-inc=wishlist", "dash");
1344 }else{
1345 $bug_data = bugs_display($bug_list[2], "$bugs" . "&amp;sev-inc=minor&amp;sev-inc=wishlist");
1346 }
1347 $line .= html_td(html_small($bug_data));
1348
1349 if(!strcmp($bug_list[3], "0(0)"))
1350 {
1351 $bug_data = html_a("-", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=" . rawurlencode($package) . "&amp;archive=no&amp;pend-inc=pending-fixed&amp;pend-inc=fixed", "dash");
1352 }else{
1353 $bug_data = bugs_display($bug_list[3], "$bugs" . "http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=". rawurlencode($package)."&amp;archive=no&amp;pend-inc=pending-fixed&amp;pend-inc=fixed");
1354 }
1355 $line .= html_td(html_small($bug_data));
1356 /* user only wants summary + rc bugs count */
1357 }elseif(isdisplayed('bugs') == 3)
1358 {
1359 if(!strcmp($bug_list[0], "0(0)"))
1360 {
1361 $bug_data = html_a("-", $nobugs . "&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious", "dash");
1362 }else{
1363 $bug_data = bugs_display($bug_list[0], "$bugs" . "&amp;sev-inc=critical&amp;sev-inc=grave&amp;sev-inc=serious");
1364 }
1365 $line .= html_td(html_small($bug_data));
1366
1367 }
1368 }
1369
1370 if(isdisplayed('version')) $line .= $version_print;
1371 if(isdisplayed('excuses')) $line .= html_td(html_small($excuse));
1372 if(isdisplayed('bin'))
1373 {
1374 $bin_display = "";
1375 for ($i = 1; $i <= count($list); $i++)
1376 {
1377 $bin_package = $list[$i - 1];
1378 $bin_display .= html_a($i, "http://packages.debian.org/" . rawurlencode($bin_package), "", $bin_package);
1379 if(($i % 3 ) == 0)
1380 {
1381 $bin_display .= " ";
1382 }else{
1383 $bin_display .= html_blank();
1384 }
1385 }
1386 $line .= html_td(html_small($bin_display));
1387 }
1388
1389 if(isdisplayed('buildd'))
1390 {
1391 $buildd_display = "";
1392 if(@$all || preg_match("/non-free/", $branch) || (strcmp($version_unstable, "-") == 0))
1393 {
1394 $buildd_display = html_td(html_small("-"));
1395 $all = 0;
1396 }else{
1397 $buildd_display = html_td(html_a(html_small("Buildd"), $buildd));
1398 }
1399 $line .= $buildd_display;
1400 }
1401
1402 if(isdisplayed('security'))
1403 {
1404 if(strcmp($security_stable,"-")) $security_stable = html_color($security_stable, "red");
1405 if(strcmp($security_testing,"-")) $security_testing = html_color($security_testing, "red");
1406 $line .= html_td(html_small($security_stable)) . html_td(html_small($security_testing));
1407 }
1408 if(isdisplayed('problems')) $line .= html_td($stable_dep) . html_td($testing_dep) . html_td($sid_dep);
1409 if(isdisplayed('uninstallable')) $line .= html_td(html_small($uninstalable_stable)) . html_td(html_small($uninstalable_testing)) . html_td(html_small($uninstalable_unstable));
1410 if(isdisplayed('watch'))
1411 {
1412 $line .= print_dehs($package,$version_unstable,"unstable","up_version");
1413 $line .= print_dehs($package,$version_unstable,"unstable","wwiz");
1414 $line .= print_dehs($package,$version_experimental_backup,"experimental","up_version");
1415 $line .= print_dehs($package,$version_experimental_backup,"experimental","wwiz");
1416 }
1417 if(isdisplayed('section')) $line .= html_td(html_small($section));
1418 if(isdisplayed('priority')) $line .= html_td(html_small($priority));
1419 if(isdisplayed('pool')) $line .= html_td(html_a(html_small("Pool"), $pool));
1420 $trs[] = html_tr($line, "center", $back_tr_color);
1421 }
1422 print html_table($ths, $trs);
1423 }
1424
1425 if($comaint == "")
1426 {
1427 $comaint = "yes";
1428 }
1429
1430 if(@$excuse)
1431 {
1432 do_extra($excuse, "excuses", "No excuse for $excuse");
1433 }elseif(@$popcon)
1434 {
1435 do_extra($popcon, "popcon", "No Popularity contest entry for $popcon");
1436 }elseif(@$wnpp)
1437 {
1438 do_extra($wnpp, "wnpp", "No Wnpp entries for $wnpp");
1439 }else if(@$gpg_key)
1440 {
1441 $contents = file("$prefix/extract");
1442
1443 $printed = 0;
1444 $match = 0;
1445
1446 $gpg_key = preg_replace ("/0x/i", "", $gpg_key);
1447 foreach ($contents as $line)
1448 {
1449 if(preg_match("/;(.+?);(.*$gpg_key.*);(.+?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*)/i", $line, $pack_array))
1450 {
1451 $match += 1;
1452 print_header_entries_top($pack_array[1], $pack_array[2], $pack_array[3]);
1453 print_header_entries_body($pack_array[2], $pack_array[3], $comaint, $pack_array[1]);
1454 $count = 4;
1455 foreach ($branch as $value)
1456 {
1457 if($pack_array[$count] != "") print_package_entries($value, $pack_array[$count], $comaint);
1458 $count += 1;
1459 }
1460 print html_br();
1461 }
1462 }
1463 if($match == 0)
1464 {
1465 print_notfound($gpg_key);
1466 }
1467
1468 printBackLink();
1469 }elseif(@$login)
1470 {
1471 $login = preg_replace ("/\+/", "\+", $login);
1472 $fp = fopen("$prefix/extract", "r");
1473 $contents = fread($fp, filesize ("$prefix/extract"));
1474
1475 if (preg_match("/\S \S/", $login) || preg_match("/^[A-Z][^@]+$/", $login))
1476 {
1477 if (preg_match("/;(.*?);(.*?);(.*$login.*);(.*?);(.*?);(.*?);(.*?);(.*?);(.*)/", $contents, $pack_array))
1478 {
1479 print_header_entries_top($pack_array[1], $pack_array[2], $pack_array[3]);
1480 print_header_entries_body($pack_array[2], $pack_array[3], $comaint, $pack_array[1]);
1481 $count = 4;
1482 foreach ($branch as $value)
1483 {
1484 if($pack_array[$count] != "") print_package_entries($value, $pack_array[$count], $comaint);
1485 $count += 1;
1486 }
1487 }else{
1488 print_notfound($login);
1489 }
1490 }else{
1491 if (! preg_match("/@/", $login)) $login .= "@debian.org";
1492 if (preg_match("/;$login;(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*)/i", $contents, $pack_array))
1493 {
1494 print_header_entries_top($login, $pack_array[1], $pack_array[2]);
1495 print_header_entries_body($pack_array[1], $pack_array[2], $comaint, $login);
1496 $count = 3;
1497 foreach ($branch as $value)
1498 {
1499 if($pack_array[$count] != "") print_package_entries($value, $pack_array[$count], $comaint);
1500 $count += 1;
1501 }
1502 }else{
1503 print_notfound($login);
1504 }
1505 }
1506 fclose($fp);
1507 printBackLink();
1508 }elseif(@$package)
1509 {
1510 $fp = fopen("$prefix/extract", "r");
1511 $found = 0;
1512 if(preg_match("/\+\+/", $package))
1513 {
1514 $package_short = preg_replace("/\+/", "", $package);
1515 $regexp="/[ ;]$package_short..\(/";
1516 $regexp2="[ ;]$package_short..\(";
1517 }elseif(preg_match("/\+/", $package))
1518 {
1519 $package_short = preg_replace("/\+/", "", $package);
1520 $regexp="/[ ;]$package_short.\(/";
1521 $regexp2="[ ;]$package_short.\(";
1522 }else{
1523 $regexp="/[ ;]$package\(/";
1524 $regexp2="[ ;]$package\(";
1525 }
1526 while(!feof($fp))
1527 {
1528 $line = freadline($fp, "32768");
1529 if(preg_match("$regexp", $line, $results))
1530 {
1531 $found = 1;
1532 preg_match("/;(.+?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*)/i", $line, $pack_array);
1533 preg_match("/$regexp2(?:.+?\)\[)(?:\S+?):(?:.+?):(.+?) /i", $line, $result);
1534 if(($comaint == "no") && ( preg_match("/\#/", $result[1]))) continue;
1535
1536 print_header_entries_top($pack_array[1], $pack_array[2], $pack_array[3]);
1537 print_header_entries_body($pack_array[2], $pack_array[3], $comaint, $pack_array[1]);
1538 $count = 4;
1539 foreach ($branch as $value)
1540 {
1541 if($pack_array[$count] != "") print_package_entries($value, $pack_array[$count], $comaint);
1542 $count += 1;
1543 }
1544 print html_br();
1545 }
1546 }
1547 if($found == 0)
1548 {
1549 print_notfound($package);
1550 }
1551 fclose($fp);
1552 printBackLink();
1553 }else{
1554 if(@$all) {
1555 print_all();
1556 }else{
1557 print_form();
1558 }
1559 }
1560
1561 print_footer();
1562 ?>

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.5