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

Diff of /trunk/wml/developer.wml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.803  
changed lines
  Added in v.834

  ViewVC Help
Powered by ViewVC 1.1.5