/* +-------------------------------------------------------------------------+ | Copyright (C) 2002 Igor Genibel | | Copyright (C) 2005 Christoph Berg | | | | 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$ +-------------------------------------------------------------------------+ */ header('Content-Type: text/html; charset="utf-8"'); header('Content-Script-Type: text/javascript'); header('Content-Style-Type: text/css'); header('Pragma: no-cache'); // global variables $arg_cookie = array(); $prefix="/org/qa.debian.org/data/ddpo/results"; $counter_span = 0; $seen_packages = array(); error_reporting(0); $time = microtime(); $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'); /* pick up cookies information or generate default one */ if (!empty($_COOKIE['columnsinfo']) and ($_GET['reset'] != 'yes')) { $tmp = $_COOKIE['columnsinfo']; $arg_cookie = unserialize(base64_decode($tmp)); }else{ $arg_cookie = array ( bugs => 1, version => 1, excuses => 1, watch => 1, bin => 1, buildd => 1, security => 1, problems => 1, popc => 1, section => 1, uninstallable => 1, ordering => 0, uploads => 1); } /* add missing popc column, can be removed after some time (2005-11-16) */ if (!in_array('popc', array_keys($arg_cookie))) { $arg_cookie['popc'] = 1; } if (!in_array('uploads', array_keys($arg_cookie))) { $arg_cookie['uploads'] = 1; } if (!in_array('ordering', array_keys($arg_cookie))) { /* 2005-12-01 */ $arg_cookie['ordering'] = 0; } /* always set cookie with that values in order to keep it 3 months old since the last visit */ setcookie('columnsinfo', base64_encode(serialize($arg_cookie)), strtotime('+3 month')); /* if the "reset" arg is passed, need to extract action parameter in order to store the value into the new cookie */ if($_GET['reset'] != 'yes') { foreach(array_keys($_GET) as $key) { if (($key == 'comaint') or ($key == 'login') or ($key == 'package') or ($key == 'wnpp') or ($key == 'gpg_key') or ($key == 'popcon')) { continue; }else{ $arg_cookie[$key] = $_GET[$key]; } } if ($_GET['set'] == 'yes') setcookie('columnsinfo', base64_encode(serialize($arg_cookie)), strtotime('+3 month')); } ?> #use wml::templ::template title="Debian Developer's Packages Overview" author="Igor Genibel, Christoph Berg, and others" {#style#: :##} {#script#: :##} Valid CSS! Valid HTML 4.0!

'; } /* Print the footer information such as page generating time. */ function print_footer() { global $time; global $prefix; $fp = fopen("$prefix/extract.date", "r"); $general = freadline($fp, "512"); fclose($fp); $fp = fopen("$prefix/bugs.date", "r"); $bugs = freadline($fp, "512"); fclose($fp); $footer .= "General information: $general (updated once per day)" . html_br(); $footer .= "Bug information: $bugs (updated every 15 minutes)" . html_br(); list($micro,$sec) = explode(' ', microtime()); list($smicro,$ssec) = explode(' ', $time); $footer .= sprintf("Time needed to generate page: %.2fs", $sec-$ssec+$micro-$smicro); print html_p(html_small($footer)); print html_hr(). print_validator(); } /* form function Args: $method: "GET" "POST" $preamble: inner form data not considered as visible parameters $data: visible parameters $name: submit button name Returns: an valid html form */ function html_form($method, $preamble, $fields, $name) { $form = "
"; $form .= $preamble; $form .= $fields; $form .= html_input_submit($name); $form .= "
\n"; return $form; } /* label function Args: $text: text to be labelized Return: labelized text */ function html_label($text) { return "\n"; } /* submit button function Args: $name: submit button name Returns: a valid html submit button */ function html_input_submit($name) { return "\n"; } /* text field unction Args: $name: the text field name Returns: a valid html text field */ function html_input_text($name, $value) { if ($value) $value = " value=\"$value\""; return "\n"; } /* hidden field unction Args: $name: the hidden field name $value: hidden field value Returns: a valid html hidden field */ function html_input_hidden($name,$value) { return "\n"; } /* radio button function Args: $name: the radio button field name $value: radio button field value $checked: boolean $text: text to explain the radio button Returns: a valid html radio button */ function html_input_radio($name,$value,$checked,$text) { $data = "" . html_color("$title ", "green") . html_br() . html_color("($extra)", "black") . "\n"; }else{ return "" . html_color($title, "green") . "\n"; } } /* table element Args: $data: text element $width: width in % $rowspan: how many rows in the table the element covers $colspan: how many cols in the table the element covers Returns: A valid table element */ function html_td($data, $width, $colspan, $rowspan) { if($colspan == "") $colspan = 1; if($rowspan == "") $rowspan = 1; if($width == "") { return "$data\n"; }else{ return "$data"; } } /* table line Args: $data: all tds $align: center, left, right $bgcolor: background color Returns: A valid table line */ function html_tr($data, $align, $bgcolor) { if($align == "") $align = "center"; if($bgcolor == "") { return "$data\n"; }else{ return "$data\n"; } } /* table Args: $header: all table headers (a tr) $data: array of data lines $width: table width in % Returns: A valid html table */ function html_table($header, $data, $width, $class) { if($width) $width = " width=\"${width}%\""; if($class) $class = " class=\"$class\""; $table = ""; $table .= $header ; foreach ($data as $line) $table .= $line; return "$table\n\n"; } /* Html Anchor Args: $text: anchor text $link: anchor link $class: anchor class $title: info bullet text Returns: A valid html anchor */ function html_a($text,$link,$class, $title) { if($title != "") $title = " title=\"$title\""; if($class != "") $class = " class=\"$class\""; return "$text"; } /* Html headers Args: $text: header text $level: header level $align: header align Returns: A valid html header */ function html_h($text, $level, $align) { if ($align == "") { return "$text\n"; }else{ return "$text\n"; } } /* The following function are basic html functions (from html_tt to html_span */ function html_tt($text) { return "$text"; } function html_b($text) { return "$text"; } function html_u($text) { return "$text"; } function html_em($text) { return "$text"; } function html_p($text) { return "

$text

"; } function html_blank() { return " "; } function html_br() { return "
\n"; } function html_hr() { return "
\n"; } function html_small($text) { return "$text"; } function html_font($text, $data) { return "$text"; } function html_color($text, $color) { return "$text"; } function html_div($text,$id,$class,$extra) { if($class != "") { return "
$text
\n"; }else{ return "
$text
\n"; } } function html_span($text,$id,$class,$extra) { if($id != "") $id = " id=\"$id\""; if($class != "") $class = " class=\"$class\""; return "$text"; } function html_ul($text, $class) { if ($class) $class = " class=\"$class\""; return "$text"; } function html_li($text) { return "
  • $text
  • "; } function html_wrap2lines($text) { $list = explode(",", $text); if(count($list) < 2) { return $text; } $half = (int)(count($list)/2); return implode(html_blank(), array_slice($list, 0, $half)) . " " . implode(html_blank(), array_slice($list, $half)); } /* This funtion is used to provide the collapsable areas and their title You need to use an auto incremented number in order not to have collisions when expand/collapse an area You need to have a css style class named span_ This function return a html valid block */ function html_collexp($number, $text, $class, $collapsed, $data) { if($collapsed) { $info = html_blank() . "(click to expand)"; $display = "none"; }else{ $info = html_blank() . "(click to collapse)"; $display = "block"; } $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\")'"); $result .= html_div($data, "text_$number", $class, "style='margin-left:0;display:$display'") ; return $result; } /* Function needed to know if the columns has to be displayed or not */ function isdisplayed($value) { global $arg_cookie; return $arg_cookie[$value]; } /* This function is used for the display settings table Note that there is a exception with bugs */ function checkbox($value) { global $arg_cookie; if($arg_cookie[$value] == 1) { $data = html_input_radio($value,1,true,"Show\n") . html_br(); $data .= html_input_radio($value,0,false,"Hide") . html_br(); }else{ $data = html_input_radio($value,1,false,"Show\n") . html_br(); $data .= html_input_radio($value,0,true,"Hide") . html_br(); } /* if($value == 'version') { if($arg_cookie[$value] == 2) { $data = html_input_radio($value,1,false,"Show\n") . html_br(); $data .= html_input_radio($value,0,false,"Hide\n") . html_br(); $data .= html_input_radio($value,2,true,"Without Exp. & Prop. Upt.\n") . html_br(); }elseif($arg_cookie[$value] == 1) { $data = html_input_radio($value,1,true,"Show\n") . html_br(); $data .= html_input_radio($value,0,false,"Hide\n") . html_br(); $data .= html_input_radio($value,2,false,"Without Exp. & Prop. Upt.\n") . html_br(); }else{ $data = html_input_radio($value,1,false,"Show\n") . html_br(); $data .= html_input_radio($value,0,true,"Hide\n") . html_br(); $data .= html_input_radio($value,2,false,"Without Exp. & Prop. Upt.\n") . html_br(); } } */ if($value == 'bugs') { $data = html_input_radio($value,1,$arg_cookie[$value] == 1,"Show (1)\n") . html_br(); $data .= html_input_radio($value,0,$arg_cookie[$value] == 0,"Hide (0)\n") . html_br(); $data .= html_input_radio($value,2,$arg_cookie[$value] == 2,"Sum. (2)\n") . html_br(); $data .= html_input_radio($value,3,$arg_cookie[$value] == 3,"Sum.&RC (3)\n") . html_br(); } elseif ($value == 'ordering') { $data = html_input_radio($value,0,$arg_cookie[$value] == 0,"Name (0)\n") . html_br(); $data .= html_input_radio($value,1,$arg_cookie[$value] == 1,"Date (1)\n") . html_br(); $data .= html_input_radio($value,2,$arg_cookie[$value] == 2,"N./D. (2)\n") . html_br(); } $data = html_color($data,"green"); return $data; } /* return hidden fields with action parameters to be provided for the form validation */ function setaction() { $action = ""; global $_GET; foreach(array_keys($_GET) as $key) { if (($key == 'login') or ($key == 'package') or ($key == 'gpg_key') or ($key == 'comaint')) { $action .= html_input_hidden($key,$_GET[$key]); } } return $action; } /* These functions provides links to the bts for a maintainer */ function bugs_nonfixed($login) { return html_a("Non-fixed bugs, most recent first", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=maint&data=". urlencode($login) . "&archive=no&raw=yes&bug-rev=yes&pend-exc=fixed&pend-exc=done"); } function bugs_all_related($login) { return html_a("All bugs related to <$login>", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?maint=". urlencode($login)); } function bugs_rc($login) { return html_a("RC Bugs related to <$login>", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=maint&data=" . urlencode($login) . "&archive=no&pend-exc=done&sev-inc=critical&sev-inc=grave&sev-inc=serious"); } function bugs_submitter($login) { return html_a("All bugs submitted by <$login>", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?submitter=" . urlencode($login)); } /* Functions used to construct the correct links in several fields (from bugs_display to stat_bug_link) */ function bugs_display($bug_number, $base_url) { $bug_link=""; preg_match("/(\d+)\((\d+)\)/", $bug_number, $result); if (strcmp($result[1], $result[2]) == 0) { $bug_link = html_a($result[1], $base_url, "a"); }else{ $bug_link = html_a($result[1], "${base_url}&repeatmerged=no", "a"); $bug_link .= " " . html_color("(", "blue") . html_a($result[2], "${base_url}&repeatmerged=yes", "a") . html_color(")", "blue"); } return $bug_link; } function lintian_link($lintian) { return html_a("Lintian report", "http://lintian.debian.org/reports/m${lintian}.html"); } function buildd_link($buildd, $login) { return html_a("Buildd report", "http://buildd.debian.org/bymaint.php?maint=$buildd") . html_blank() . html_a("Igloo's buildd report", "http://people.debian.org/~igloo/status.php?email=". urlencode($login)); } function stat_bug_link($login) { return html_a("Bug statistics", "http://www.debian.gr.jp/~kitame/maint.cgi?num=srcs&limit=0&showpkgs=on&maint=" . urlencode($login)); } /* Function is used to display or not the extra features such as pocon, wnpp, and excuses */ function do_extra($data, $data_prefix, $error) { global $prefix; $data = str_replace(" ", "+", $data); $filepath = "$prefix/$data_prefix/" . $data{0} . "/$data"; if(file_exists($filepath)) { require "$filepath"; }else{ print html_h($error, 2); } if($data_prefix == "excuses") { print html_br() . html_a("More excuses", "http://bjorn.haxx.se/debian/testing.pl?package=$data"); } } function printBackLink($arg) { if ($arg) { print html_p(html_a("Back to maintainer page", "developer.php$arg", "")); } else { print html_p(html_a("Back to main page", "developer.php", "")); } } /* function used to display the main maintainer links in a collapsable area */ function print_header_entries_body($keys, $name, $comaint, $login) { global $counter_span; global $prefix; $add_comaint = "&comaint=$comaint"; $lintian = preg_replace('/%../', "_", urlencode($name)); $lintian = preg_replace('/\+/', "_", $lintian); $lintian = preg_replace('/-/', "_", $lintian); $fp = fopen("$prefix/../../ftp/Maintainers", "r"); $ok = 0; while(!feof($fp)) { $line = freadline($fp, "10240"); 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> "); } } if ($ok == 1 ) { break; } } fclose($fp); $counter_span += 1; $title = html_b("General information"); $maintainer_data = ""; /* GPG is broken if ($keys == "NOID") { $maintainer_data = html_font("GPG key id not found!", 'size="+1" color="red"'); $maintainer_data .= html_blank() . html_font("(key id was not found neither in the Debian keyring nor on a public keyserver)", 'size="-2"'); $maintainer_data .= html_br(); }else{ $maintainer_data .= "GPG key id: "; foreach (explode(",", $keys) as $key) { $maintainer_data .= html_small(html_a($key, "developer.php?gpg_key=" .$key . $add_comaint)) . " "; } $maintainer_data .= html_br(); } */ $maintainer_data .= bugs_nonfixed($login) . html_br(); $maintainer_data .= bugs_all_related($login) . html_br(); $maintainer_data .= bugs_rc($login) . html_br(); $maintainer_data .= bugs_submitter($login) . html_br(); $maintainer_data .= lintian_link($lintian) . html_br(); $maintainer_data .= buildd_link($buildd, $login) . html_br(); $maintainer_data .= stat_bug_link($login) . html_br(); $maintainer_data .= html_a("WNPP bugs opened by <$login>", "developer.php?wnpp=$login"); print html_collexp($counter_span, $title, "general", false, html_small($maintainer_data)); } /* Function used to display the generic information (help and display settings) */ function print_header_entries_top($login, $key, $name) { global $counter_span; static $already_displayed; print html_h("Packages overview for $name <$login>", 2, "center"); if($already_displayed) return; $counter_span += 1; $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. ")); $display_data .= "You can override the settings by providing an extra arg to the URL (e.g. &buildd=1 if you want to display the buildd column). These args will not change the custom settings you defined before (the cookie is not modified)." . html_br(); $display_data .= "The 'Name' ordering sorts by package name, 'Date' sorts by upload date (descending), and 'N./D.' sorts by name for main/contrib/non-free packages and by date for other sections." . html_br(); $display_data = html_small($display_data); $display_table_th = html_th("Bugs","&bugs="); $display_table_th .= html_th("Version","&version="); $display_table_th .= html_th("Excuses","&excuses="); $display_table_th .= html_th("Binary" . html_br() . "Package Page","&bin="); $display_table_th .= html_th("Buildd","&buildd="); $display_table_th .= html_th("Security","&security="); $display_table_th .= html_th("Debcheck","&problems="); $display_table_th .= html_th("Uninstallable","&uninstallable="); $display_table_th .= html_th("Popcon","&popc="); $display_table_th .= html_th("Watch","&watch="); $display_table_th .= html_th("Section","&section="); $display_table_th .= html_th("Ordering","&ordering="); $display_table_th .= html_th("Uploads","&uploads="); $display_table_tds = html_td(checkbox('bugs')); $display_table_tds .= html_td(checkbox('version')); $display_table_tds .= html_td(checkbox('excuses')); $display_table_tds .= html_td(checkbox('bin')); $display_table_tds .= html_td(checkbox('buildd')); $display_table_tds .= html_td(checkbox('security')); $display_table_tds .= html_td(checkbox('problems')); $display_table_tds .= html_td(checkbox('uninstallable')); $display_table_tds .= html_td(checkbox('popc')); $display_table_tds .= html_td(checkbox('watch')); $display_table_tds .= html_td(checkbox('section')); $display_table_tds .= html_td(checkbox('ordering')); $display_table_tds .= html_td(checkbox('uploads')); $display_table_tr = html_tr($display_table_tds, "left"); $display_data .= html_table(html_tr($display_table_th), array($display_table_tr), "", "small") . html_br(); $display_data .= "Additionally show packages: ". html_input_text("packages", isdisplayed('packages')); $display_data .= " uploaders: ". html_input_text("uploader", isdisplayed('uploader')) . html_br(); $preamble = setaction() . html_input_hidden("set", "yes"); $display_data = html_form("GET", $preamble, $display_data, "Submit"); $preamble = setaction() . html_input_hidden("reset", "yes"); $display_data .= html_form("GET", $preamble, "", "Show all"); $title = html_b("Display configuration:"); print html_br() . html_collexp($counter_span, $title, "general", true, $display_data); $counter_span += 1; $help_data = html_color("Blue", "blue") . " packages are co-maintained by developer (reference to Uploaders: field)" . html_br(); $help_data .= "The 'Bugs' columns display the real number of bugs. If there are merged bugs, the total is in parentheses" . html_br(); $help_data .= "Version columns:" . html_br(); $help_data .= html_blank(). html_color("Red", "red") . ": NMU" . html_br(); $help_data .= html_blank(). html_color("Magenta", "#ff00ff") . ": unstable version differs from testing version" . html_br(); $help_data .= "The 'Popcon' column displays the maximal install count for any binary in the source package" . html_br(); $help_data .= "Watch columns:" . html_br(); $help_data .= html_blank().html_blank(). html_color("green", "green") . ": upstream found version is in sync with version unstable/experimental" . html_br(); $help_data .= html_blank().html_blank(). html_color("magenta", "#ff00ff") . ": upstream found version is greater than version in unstable" . html_br(); $help_data .= html_blank().html_blank(). html_color("navy blue", "#2222AA") . ": upstream found version is lower than version in unstable (a bug in the watch file)" . html_br(); $help_data .= html_blank().html_blank(). html_color("error", "red") . ": uscan had problems following the watch file" . html_br(); $help_data .= html_blank().html_blank(). "Watch is N/A: package does not have a watch file" . html_br(); $help_data .= html_blank().html_blank(). "Wwiz is N/A: package does not have a copyright file suitable to automatically generate a watch file" . html_br(); $help_data .= html_blank().html_blank(). "Wwiz is " . html_color("notmatch", "red") . ": package had a copyright file but no useful URL download link was found to automatically generate a watch file" . html_br(); $help_data .= html_blank().html_blank(). html_color("no value", "grey") . ": there is a problem with the dehs database files" . html_br(); $help_data .= "The 'uploads' section shows all packages uploaded with this developer's key (NMUs, sponsored uploads)" . html_br().html_br(); $help_data = html_small($help_data); $title = html_b("Help"); print html_collexp($counter_span, $title, "general", true, $help_data); $already_displayed = true; } function print_notfound($login) { print html_h("No information available for $login", 2); } /* Construct page provided when no command is provided */ function print_form() { $form = html_h("Debian Developer's Packages Overview", 1); $form .= html_p("Use the following search forms to determine the Debian developer whose packages overview you wish to see:"); $preamble = "Search based on the Maintainer field in packages:" . html_br(); $preamble .= html_small("If a single username is provided, @debian.org is automatically appended.") . html_br(); $preamble .= html_small("If you start with an uppercase letter or type two words, it is assumed that you want to do a (partial) match on the maintainer name.") . html_br(); $preamble .= html_input_text("login"); $preamble = html_label($preamble) . html_br(); $form_data = "Display co-maintained packages:" . html_blank(); $form_data .= html_input_radio("comaint", "yes", true, "yes"); $form_data .= html_input_radio("comaint", "no", false, "no"); $form_data .= html_input_radio("comaint", "only", false, "only"); $form_data = html_label($form_data) . html_br(); $form .= html_form("GET", $preamble, $form_data, "Find"); #$preamble = "Search based on the " . html_tt("GPG key ID:") . html_br(); #$preamble .= html_input_text("gpg_key"); #$preamble = html_label($preamble) . html_br(); #$form_data = "Display co-maintained packages:" . html_blank(); #$form_data .= html_input_radio("comaint", "yes", true, "yes"); #$form_data .= html_input_radio("comaint", "no", false, "no"); #$form_data .= html_input_radio("comaint", "only", false, "only"); #$form_data = html_label($form_data) .html_br(); #$form .= html_form("GET", $preamble, $form_data, "Find") . html_br(); $preamble = "Search based on a source package name:" . html_br(); $preamble .= html_input_text("package"); $preamble = html_label($preamble) . html_br(); $form_data = "Display co-maintained packages:" . html_blank(); $form_data .= html_input_radio("comaint", "yes", true, "yes"); $form_data .= html_input_radio("comaint", "no", false, "no"); $form_data .= html_input_radio("comaint", "only", false, "only"); $form_data = html_label($form_data) .html_br(); $form .= html_form("GET", $preamble, $form_data, "Find"); $query = "Show complete, sorted list of developers (600kB)"; $hidden = html_input_hidden("all", "1"); $form .= $query . html_form("GET", $hidden, "", "Show the list"); $form .= html_h("Subscribing to Packages", 2); $form .= "Additional packages can be added to the list of packages shown. There are two interfaces, mail and URL based.". html_br().html_br(); $form .= "Using the DDPO control bot at ". html_a("ddpo@qa.debian.org", "mailto:ddpo@qa.debian.org") .", packages are added to the listing for a login (mail address), optionally sorted in user-defined sections. The following commands are accepted:"; $form .= "
    user <address>
      Process commands for <address>. Defaults to the address used in the From:
      header.
    subscribe <srcpackage> [<section>]
      Adds <srcpackage> to the listing. If <section> is omitted, defaults to
      \"ddpo\". This command can also be used to move <srcpackage> to a different
      section.
      The special section \"uploader\" allows subscription to uploads made by a developer
      (identified by key id).
    unsubscribe <srcpackage>
      Removes the <srcpackage> from the listing.
    help
      Print help text.
    quit
    thanks
      Stops processing commands.
    
    "; $form .= "Example:"; $form .= "
    user cb@df7cb.de
    subscribe endeavour
    subscribe rdiff-backup sponsor-panthera
    unsubscribe libextractor
    subscribe myon@debian.org uploader
    
    "; $form .= "Alternatively, one can append &packages=pkg1+pkg2+... to the URL, or enter package names in the 'Display configuration' form. This will create a new section \"url\" in the listing, independently of the selected login.". html_br().html_br(); $form .= "Report problems with DDPO to the ". html_a("qa.debian.org pseudopackage", "http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=qa.debian.org") ."."; print $form; } /* Construct the page where all maintainer are displayed */ function print_all() { global $prefix; $maint = file("$prefix/ddpo_maintainers"); $html = html_h("Sorted developer list", 2); $display_table_th = html_th("Name and email"); $display_table_th .= html_th("main"); $display_table_th .= html_th("non-us"); $display_table_th .= html_th("Other" . html_br(), html_small("all contrib &" . html_br() . "non-free packages")); $display_table_th .= html_th("Total"); $trs = array(); foreach($maint as $line) { if($line != "") { $count = 0; $line = preg_replace("/, /", ",", $line); preg_match("/;([^;]+?);([^;]+?);([^;]*?);([^;]*?);([^;]*?);([^;]*?);([^;]*?);([^;]*?);([^;]*)$/", $line, $info_array); $tds = html_td(html_b(html_a(str_replace(" ", html_blank(), "$info_array[3]") . html_blank() . "<$info_array[1]>", "developer.php?login=" . rawurlencode($info_array[1]))), 15); $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])); } $tds .= html_td($main) . html_td($nonUS) . html_td($other) . html_td(html_b($count)); $trs[] = html_tr($tds, "center"); } } print html_table(html_tr($display_table_th), $trs, "80"); } /* Small useful function to construct the link to the excuses */ function get_rep($package_name) { if(preg_match("/^lib/", $package_name)) { return substr($package_name, 0, 4); }else{ return substr($package_name, 0, 1); } } # Begin of Dehs functions function dehsdb_conn ($dbname,$mode) { $id = dba_open($dbname, $mode, "db4"); return $id; } function dehsdb_xml($xml) { $p = xml_parser_create(); xml_parse_into_struct($p, $xml, $vals, $index); xml_parser_free($p); $values=array("id"=>$vals[1][value],"up_version"=>$vals[2][value],"wwiz"=>$vals[3][value]); return $values; } function dehs_value($pkg_name,$dist) { $id = dehsdb_conn("/org/qa.debian.org/data/dehs/dehs_qa_" . $dist . ".db","r"); if(!$id) return "error"; if (!dba_exists($pkg_name,$id)) return array("id"=>"-","up_version"=>"-","wwiz"=>"-"); $xml=dba_fetch($pkg_name,$id); dba_close($id); return dehsdb_xml($xml); } function vers_conv($debvers) { preg_match("/(.+:)?([^-]+)(ds|dsfg|debian)/",$debvers,$matches); if (!$matches[3]) { unset($matches); preg_match("/(.+:)?([^-]+)/",$debvers,$matches); } if (substr($matches[2],-1)=='.') $matches[2]=substr($matches[2],0,-1); return $matches[2]; } function ver_comp($a,$b) { exec("dpkg --compare-versions '$a' gt '" . vers_conv($b) . "'",$output,$res); if ($res==0) return 1; exec("dpkg --compare-versions '$a' lt '" . vers_conv($b) . "'",$output,$res); if ($res==0) return 2; else return 3; } function print_dehs($package,$version,$dist,$type) { $dehs_values=dehs_value($package,$dist); if($dehs_values=="error") return html_td(html_color("no value", "grey")); if ($type=="up_version") { $dehs_link= html_br() . html_a("Details", "http://dehs.alioth.debian.org/maintainer.php?name=" . rawurlencode($package)); if($dehs_values[up_version]=="-") { $dehs_values[up_version] = "-"; $dehs_link=''; } elseif ($dehs_values[up_version]=='N/A') { $color="black"; } elseif ($dehs_values[up_version]=='Error') $color="red"; elseif(ver_comp($dehs_values[up_version],$version)==1) $color="magenta"; elseif(ver_comp($dehs_values[up_version],$version)==2) $color="#2222AA"; else { $color="green"; $dehs_link=''; } $upstream_print = html_td(html_color($dehs_values[up_version], $color) . $dehs_link, "", 1, 1); return $upstream_print; }else{ $wwiz_link_desc="Details"; if($dehs_values[wwiz]=='-' or !$dehs_values[wwiz]) { $dehs_values[wwiz] = "-"; $dehs_link=''; } elseif ($dehs_values[wwiz]=='N/A') $color="black"; elseif ($dehs_values[wwiz]=='error' OR $dehs_values[wwiz]=='notmatch') $color="red"; elseif(ver_comp($dehs_values[wwiz],$version)==1) { $color="magenta"; $wwiz_link_desc="Watch"; } elseif(ver_comp($dehs_values[wwiz],$version)==2) { $color="#2222AA"; $wwiz_link_desc="Watch"; }else{ $color="green"; $wwiz_link_desc="Watch"; } if(!isset($dehs_link)) { $dehs_link= html_br() . html_a($wwiz_link_desc, "http://dehs.alioth.debian.org/wwiz_detail.php?id=" . $dehs_values[id] . "&type=watch"); } $wwiz_print= html_td(html_color($dehs_values[wwiz], $color, "", 1, 1)); return $wwiz_print; } } # Check whether there is a debcheck entry for that package function debcheckavailable($suite, $package_name) { $package = ereg_replace ("\.", "_", $package_name); if(ereg ("[^a-zA-Z0-9+_-]", $package) || ($suite != "oldstable" && $suite != "stable" && $suite != "testing" && $suite != "unstable")) { return 0; } $BASEDIR='/org/qa.debian.org/data/debcheck/result/'; return file_exists($BASEDIR.'/'.$suite.'/packages/'.$package); } /* Print possible wnpp entries and/or removal requests for this source package as consise links, or nothing if there are none */ function get_wnpp_rm($package) { static $db; if (!$db) $db = dba_open("/org/qa.debian.org/data/bts/wnpp_rm.db", 'r-', 'db4'); if (!$db) return; $entries = dba_fetch($package, $db); if (!$entries) return; $entries = explode('|', $entries); $ret = ""; foreach ($entries as $entry) { preg_match('/(\\S+)\\s+(\\S+)/', $entry, $m); $ret .= "[$m[1]]"; } return $ret; } /* annotate version number with mouseover title */ function format_version($package, $version, $class) { global $uploads_db; $date = dba_fetch("ud:$package:$version", $uploads_db); $uploader = dba_fetch("ul:$package:$version", $uploads_db); if ($date or $uploader) return html_span($version, "", $class, "title=\"$date ($uploader)\""); return $version; } /* This function prints a package table information row */ function print_package_entry($branch, $package, $comaint, $back_tr_color) { global $prefix; global $pack_db; global $seen_packages; # handle co-maintained packages $uploader = false; if(strstr($package, "#")) { $uploader = 1; $package = str_replace("#", "", $package); } if ((($uploader == 1) && ( $comaint == "no")) || (($uploader == 0) && ( $comaint == "only"))) return ""; # skip already displayed packages if(in_array($package, $seen_packages)) return ""; $seen_packages[] = $package; # get package data $packagedata = dba_fetch($package, $pack_db); preg_match("/(.+)\((.+)\)/", $packagedata, $result); $binaries = split (", ", $result[2]); if(strstr($packagedata, "%")) { $arch_all = 1; $packagedata = str_replace("%", "", $packagedata); } preg_match("/(.+?)\[(.+)\]\{(.+)\}\{(.+)\}\{(.+)\}\|(.*)\|:(.*):/", $packagedata, $results); $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 = html_wrap2lines($results[3]); $uninstalable_testing = html_wrap2lines($results[4]); $uninstalable_unstable = html_wrap2lines($results[5]); $priority = $results[6]; $section = $results[7]; $urlpackage = rawurlencode($package); // 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-', 'db4'); if (!($bug_list = dba_fetch($package, $bugsdb))) $bug_list = '0(0) 0(0) 0(0) 0(0)'; $bug_list = explode(' ', $bug_list); if(strcmp($version_stable, "-") == 0 || !debcheckavailable('stable', $package)) { $stable_dep = "-"; }else{ $stable_dep = html_a("St", "http://qa.debian.org/debcheck.php?dist=stable&package=$urlpackage"); } if(strcmp($version_testing, "-")== 0 || !debcheckavailable('testing', $package)) { $testing_dep = "-"; }else{ $testing_dep = html_a("Te", "http://qa.debian.org/debcheck.php?dist=testing&package=$urlpackage"); } if(strcmp($version_unstable, "-")== 0 || !debcheckavailable('unstable', $package)) { $sid_dep = "-"; }else{ $sid_dep = html_a("Un", "http://qa.debian.org/debcheck.php?dist=unstable&package=$urlpackage"); } $buildd = "http://buildd.debian.org/build.php?pkg=$urlpackage"; $pool = "http://ftp.debian.org/debian/pool/"; if(strstr($section, "non-free")) { $pool .= "non-free"; }elseif(strstr($section, "contrib")) { $pool .= "contrib"; }else{ $pool .= "main"; } $pool .= "/" . get_rep($urlpackage) . "/" . $urlpackage . "/"; if(file_exists("$prefix/excuses/" . $package{0} . "/$package")) { $excuse = html_a("Excuses", "developer.php?excuse=$urlpackage") . " "; $excuse .= html_a("More", "http://bjorn.haxx.se/debian/testing.pl?package=$urlpackage"); }else{ $excuse = "-"; } # version numbers $stable = format_version($package, $version_stable, "stable"); $testing = format_version($package, $version_testing, "testing"); $ver = explode("-", $version_unstable); if((preg_match("/(.+\..+?)$/", $ver[count($ver) - 1], $toto)) && (count($ver) != 1)) { $unstable = format_version($package, $version_unstable, "nmu"); } else { $unstable = format_version($package, $version_unstable); } if((strcmp ($version_stable, $version_testing) == 0) && (strcmp ($version_stable, "/") != 0)) { if((strcmp ($version_unstable, $version_testing) == 0)) { $version_print = html_td($stable, "", 3, 1); }else{ $version_print = html_td($stable, "", 2, 1) . html_td($unstable); } }elseif(strcmp ($version_testing, $version_unstable) == 0) { $version_print = html_td($stable) . html_td($unstable, "", 2, 1); }else{ $version_print = html_td($stable) . html_td($testing) . html_td($unstable); } $version_print .= html_td(format_version($package, $version_prop, "tpu")) . html_td(format_version($package, $version_experimental, "experimental")); /* * Create output */ $line_data = html_b(htmlspecialchars($package)) . get_wnpp_rm($package) . html_br() . html_a("PTS", "http://packages.qa.debian.org/".get_rep($urlpackage)."/$urlpackage.html") . html_blank() . html_a("Pool", $pool); $line = html_td(html_color($line_data, $uploader == 1 ? "blue" : "")); /* if bugs >= 1 always print the summary */ if(isdisplayed('bugs')) { $bugs = "http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=$urlpackage&archive=no&pend-exc=pending-fixed&pend-exc=fixed&pend-exc=done"; $bugs_all = "http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=$urlpackage"; $bug_count = $bug_list[0] + $bug_list[1] + $bug_list[2] + $bug_list[3]; $real_bug_count = 0; $bug_data = ""; foreach($bug_list as $bug_item) { preg_match("/\d+\((\d+)\)/", $bug_item, $count_array); $real_bug_count += $count_array[1]; } if($bug_count == 0) { $bug_data = html_a("-", $bugs_all, "dash"); }else{ $bug_data = bugs_display("$bug_count($real_bug_count)", $bugs_all); } $line .= html_td($bug_data); /* user want to display all the bugs info */ if(isdisplayed('bugs') == 1) { if(!strcmp($bug_list[0], "0(0)")) { $bug_data = html_a("-", $bugs_all . "&sev-inc=critical&sev-inc=grave&sev-inc=serious", "dash"); }else{ $bug_data = bugs_display($bug_list[0], "$bugs" . "&sev-inc=critical&sev-inc=grave&sev-inc=serious"); } $line .= html_td($bug_data); if(!strcmp($bug_list[1], "0(0)")) { $bug_data = html_a("-", $bugs_all . "&sev-inc=important&sev-inc=normal", "dash"); }else{ $bug_data = bugs_display($bug_list[1], "$bugs" . "&sev-inc=important&sev-inc=normal"); } $line .= html_td($bug_data); if(!strcmp($bug_list[2], "0(0)")) { $bug_data = html_a("-", $bugs_all . "&sev-inc=minor&sev-inc=wishlist", "dash"); }else{ $bug_data = bugs_display($bug_list[2], "$bugs" . "&sev-inc=minor&sev-inc=wishlist"); } $line .= html_td($bug_data); if(!strcmp($bug_list[3], "0(0)")) { $bug_data = html_a("-", $bugs_all . "&archive=no&pend-inc=pending-fixed&pend-inc=fixed", "dash"); }else{ $bug_data = bugs_display($bug_list[3], $bugs_all ."&archive=no&pend-inc=pending-fixed&pend-inc=fixed"); } $line .= html_td($bug_data); /* user only wants summary + rc bugs count */ }elseif(isdisplayed('bugs') == 3) { if(!strcmp($bug_list[0], "0(0)")) { $bug_data = html_a("-", $bugs_all . "&sev-inc=critical&sev-inc=grave&sev-inc=serious", "dash"); }else{ $bug_data = bugs_display($bug_list[0], "$bugs" . "&sev-inc=critical&sev-inc=grave&sev-inc=serious"); } $line .= html_td($bug_data); } } if(isdisplayed('version')) $line .= $version_print; if(isdisplayed('excuses')) $line .= html_td($excuse); if(isdisplayed('bin')) { $bin_display = ""; for ($i = 1; $i <= count($binaries); $i++) { $bin_package = $binaries[$i - 1]; if (!$bin_package) continue; $description = dba_fetch("d:$bin_package", $pack_db); $bin_display .= html_a($i, "http://packages.debian.org/" . rawurlencode($bin_package), "", "$bin_package - $description") . " "; if (count($binaries) > 9 and $i == 7) { $bin_display .= "... "; $i = count($binaries) - 1; continue; } } $line .= html_td($bin_display); } if(isdisplayed('buildd')) { $buildd_display = ""; if(@$arch_all || preg_match("/non-free/", $branch) || (strcmp($version_unstable, "-") == 0)) { $buildd_display = html_td("-"); $arch_all = 0; }else{ $buildd_display = html_td(html_a("Buildd", $buildd) . html_br() . html_a("More", "http://people.debian.org/~igloo/status.php?packages=$urlpackage")); } $line .= $buildd_display; } if(isdisplayed('security')) { if(strcmp($security_stable,"-")) $security_stable = format_version($package, $security_stable, "security"); if(strcmp($security_testing,"-")) $security_testing = format_version($package, $security_testing, "security"); $line .= html_td($security_stable) . html_td($security_testing); } if(isdisplayed('problems')) $line .= html_td($stable_dep) . html_td($testing_dep) . html_td($sid_dep); if(isdisplayed('uninstallable')) $line .= html_td($uninstalable_stable) . html_td($uninstalable_testing) . html_td($uninstalable_unstable); if(isdisplayed('popc')) { $line .= html_td(dba_fetch("p:$package", $pack_db) . html_br(). html_a("More", "developer.php?popcon=$urlpackage")); } if(isdisplayed('watch')) { $line .= print_dehs($package,$version_unstable,"unstable","up_version"); $line .= print_dehs($package,$version_unstable,"unstable","wwiz"); $line .= print_dehs($package,$version_experimental_backup,"experimental","up_version"); $line .= print_dehs($package,$version_experimental_backup,"experimental","wwiz"); } if(isdisplayed('section')) $line .= html_td($section . html_br() . $priority); return html_tr($line, "center", $back_tr_color); } /* This function prints a package table information for specific branch given in argument */ function print_package_entries($branch, $packages, $comaint) { global $prefix; global $uploads_db; $packages = preg_replace ("/, /", ",", $packages); $pack_array = split(" ", $packages); if ((isdisplayed('ordering') == 1) or ((isdisplayed('ordering') == 2) and ($branch != 'main') and ($branch != 'contrib') and ($branch != 'non-free'))) { $pack_sort = array(); foreach ($pack_array as $package) { $date = dba_fetch("ud:$package", $uploads_db); $pack_sort[$date.$package] = $package; } krsort($pack_sort, SORT_STRING); $pack_array = $pack_sort; } $trs = array(); foreach($pack_array as $package) { $tr = print_package_entry($branch, $package, $comaint, $back_tr_color); if($tr) { $trs[] = $tr; $back_tr_color = $back_tr_color ? "" : "#dcdcdc"; } } if (!count($trs)) return; print html_h(html_em($branch) . " (" . count($trs) . ")", 3); /* contruct the table header */ $ths = html_th("Source" . html_blank(). "Name", "", 2); if(isdisplayed('bugs') == 1) { $ths .= html_th("Bugs", "", 1, 5); }elseif(isdisplayed('bugs') == 2) { $ths .= html_th("Bugs", "", 1, 1); }elseif(isdisplayed('bugs') == 3) { $ths .= html_th("Bugs", "", 1, 2); } if(isdisplayed('version')) $ths .= html_th("Version", "", 1, 5); if(isdisplayed('excuses')) $ths .= html_th(html_span("Excuses", "", "", "title=\"Raw excuse and Björn Stenberg analysis\""), "", 2, 1); if(isdisplayed('bin')) $ths .= html_th("Binary" . html_br() . "Package Page", "", 2, 1); if(isdisplayed('buildd')) $ths .= html_th("Buildd", "", 2, 1); if(isdisplayed('security')) $ths .= html_th("Security", "", 1, 2); if(isdisplayed('problems')) $ths .= html_th("Debcheck", "", 1, 3); if(isdisplayed('uninstallable')) $ths .= html_th("Uninstallable", "", 1, 3); if(isdisplayed('popc')) $ths .= html_th("Popcon", "", 2, 1); if(isdisplayed('watch')) $ths .= html_th("Watch", "", 1, 4); if(isdisplayed('section')) $ths .= html_th("Section" . html_br() . "Priority", "", 2, 1); $th_level1 = html_tr($ths); $ths = ""; /* the second header line */ if(isdisplayed('bugs') == 1) { $ths .= html_th(html_span("All", "", "", "title=\"All opened bugs\"")); $ths .= html_th(html_span("RC", "", "", "title=\"Release Critical bugs\"")); $ths .= html_th(html_span("I&N", "", "", "title=\"Important & Normal bugs\"")); $ths .= html_th(html_span("M&W", "", "", "title=\"Minor & Wishlist bugs\"")); $ths .= html_th(html_span("F&P", "", "", "title=\"Fixed & Pending bugs\"")); } elseif(isdisplayed('bugs') == 2) { $ths .= html_th(html_span("All", "", "", "title=\"All opened bugs\"")); } elseif(isdisplayed('bugs') == 3) { $ths .= html_th(html_span("All", "", "", "title=\"All opened bugs\"")); $ths .= html_th(html_span("RC", "", "", "title=\"Release Critical bugs\"")); } if(isdisplayed('version')) { $ths .= html_th("Stable"); $ths .= html_th("Testing"); $ths .= html_th("Unstable"); $ths .= html_th(html_span("Prop Up", "", "", "title=\"Stable Proposed Updates\"")); $ths .= html_th("Exp"); } if(isdisplayed('security')) { $ths .= html_th("St"); $ths .= html_th("Te"); } if(isdisplayed('problems')) { $ths .= html_th("St"); $ths .= html_th("Te"); $ths .= html_th("Un"); } if(isdisplayed('uninstallable')) { $ths .= html_th("St"); $ths .= html_th("Te"); $ths .= html_th("Un"); } if(isdisplayed('watch')) { $ths .= html_th("Watch Unstable"); $ths .= html_th("WWiz Unstable"); $ths .= html_th("W Exp"); $ths .= html_th("WW Exp"); } $ths = $th_level1 . html_tr($ths); print html_table($ths, $trs, "", "small"); } function print_subscribed_packages($login, $comaint) { global $prefix; static $subscribe_db; # section1:pkg1 pkg2;section2:pkg3 if (!$subscribe_db) $subscribe_db = dba_open("$prefix/ddpo_subscribe.db", 'r-', 'db4'); $data = dba_fetch($login, $subscribe_db); if(!$data) { return; } $sections = explode(";", $data); foreach($sections as $section) { if (preg_match("/^uploader:(.*)/", $section, $secarray)) { $uploaders = explode(" ", $secarray[1]); foreach ($uploaders as $uploader) print_uploaded_packages($uploader, $comaint); continue; } preg_match("/^([^:]*):(.*)/", $section, $secarray); print_package_entries($secarray[1], $secarray[2], $comaint); } } function print_uploaded_packages($login, $comaint) { global $prefix; global $uploads_db; if (!strstr($login, "@")) $login .= "@debian.org"; $packages = dba_fetch($login, $uploads_db); if(!$packages) { return; } print_package_entries("Uploads by $login", $packages, $comaint); } function print_developer($login, $key, $name, $comaint, $pack_array) { global $branch; # reset seen packages list global $seen_packages; $seen_packages = array(); print_header_entries_top($login, $key, $name); print_header_entries_body($key, $name, $comaint, $login); $count = 1; foreach ($branch as $value) { if($pack_array[$count] != "") { print_package_entries($value, $pack_array[$count], $comaint); $no_packages = true; }elseif(! $no_packages){ print html_h("No packages in unstable", 3); $no_packages = true; } $count += 1; } print_subscribed_packages($login, $comaint); if(isdisplayed('packages')) print_package_entries("url", isdisplayed('packages'), $comaint); if(isdisplayed('uploads')) print_uploaded_packages($login, $comaint); if(isdisplayed('uploader')) { $uploaders = explode(" ", isdisplayed('uploader')); foreach ($uploaders as $uploader) print_uploaded_packages($uploader, $comaint); } } # popcon function print_popcon_entry($package, $back_tr_color) { global $pack_db; $row = html_tr( html_td(html_b($package)) . html_td(dba_fetch("pi:$package", $pack_db)) . html_td(sprintf("%.2f%%", 100 * dba_fetch("pi:$package", $pack_db) / dba_fetch("pimax:", $pack_db))) . html_td(dba_fetch("pir:$package", $pack_db)) . html_td(dba_fetch("pv:$package", $pack_db)) . html_td(sprintf("%.2f%%", 100 * dba_fetch("pv:$package", $pack_db) / dba_fetch("pvmax:", $pack_db))) . html_td(dba_fetch("pvr:$package", $pack_db)) . html_td(dba_fetch("po:$package", $pack_db)) . html_td(sprintf("%.2f%%", 100 * dba_fetch("po:$package", $pack_db) / dba_fetch("pomax:", $pack_db))) . html_td(dba_fetch("por:$package", $pack_db)) . html_td(dba_fetch("pr:$package", $pack_db)) . html_td(sprintf("%.2f%%", 100 * dba_fetch("pr:$package", $pack_db) / dba_fetch("prmax:", $pack_db))) . html_td(dba_fetch("prr:$package", $pack_db)) . html_td(dba_fetch("pn:$package", $pack_db)) . html_td(sprintf("%.2f%%", 100 * dba_fetch("pn:$package", $pack_db) / dba_fetch("pnmax:", $pack_db))) . html_td(dba_fetch("pnr:$package", $pack_db)) . html_td(html_a("Graph", "http://people.debian.org/~igloo/popcon-graphs/index.php?packages=". rawurlencode($package))), "", $back_tr_color ); return $row; } function print_popcon($popcon) { global $pack_db; global $counter_span; $packagedata = dba_fetch($popcon, $pack_db); if (!$packagedata) { print html_h("No Popularity contest entry for $popcon", 2); return; } preg_match("/(.+)\((.+)\)/", $packagedata, $result); $binaries = split (", ", $result[2]); print html_h("Popularity contest statistics for $popcon", 2); $help = html_ul( html_li("Name is the package name") . html_li("Inst. is the number of people who installed this package") . html_li("Vote is the number of people who use this package regularly") . html_li("Old is the number of people who installed, but do not use this package regularly") . html_li("Recent is the number of people who upgraded this package recently") . html_li("No Files is the number of people whose entry did not contain enough information (atime and ctime were 0)") . html_li("Within parenthesis the number represents the number of registered popcon users that sent information about this topic"), "small"); print html_collexp($counter_span, html_b("Help"), "general", true, $help); $table = array(); foreach ($binaries as $bin_package) { $table[] = print_popcon_entry($bin_package, $back_tr_color); $back_tr_color = $back_tr_color ? "" : "#dcdcdc"; } print html_table( html_tr( html_th("Name", "", 2, 1) . html_th("Inst (". dba_fetch("pimax:", $pack_db) .")", "1st: ". dba_fetch("pimax:n", $pack_db), 1, 3) . html_th("Vote (". dba_fetch("pvmax:", $pack_db) .")", "1st: ". dba_fetch("pvmax:n", $pack_db), 1, 3) . html_th("Old (". dba_fetch("pomax:", $pack_db) .")", "1st: ". dba_fetch("pomax:n", $pack_db), 1, 3) . html_th("Recent (". dba_fetch("prmax:", $pack_db) .")", "1st: ". dba_fetch("prmax:n", $pack_db), 1, 3) . html_th("No Files (". dba_fetch("pnmax:", $pack_db) .")", "1st: ". dba_fetch("pnmax:n", $pack_db), 1, 3) . html_th("Graph", "", 2, 1)) . html_tr( html_th("Number") . html_th("%") . html_th("Rank") . html_th("Number") . html_th("%") . html_th("Rank") . html_th("Number") . html_th("%") . html_th("Rank") . html_th("Number") . html_th("%") . html_th("Rank") . html_th("Number") . html_th("%") . html_th("Rank")), $table, "", "small"); } # get WNPP bugs function print_wnpp_entry($key) { static $wnpp_db; if (!$wnpp_db) $wnpp_db = dba_open("/org/qa.debian.org/data/bts/wnpp_by_maint.db", 'r-', 'db4'); $wnpp = dba_fetch($key, $wnpp_db); # [so]:address -> (nnnnnn time title)|* if (!$wnpp) { $li = html_li("None"); } else { $bugs = explode("|", $wnpp); foreach ($bugs as $bug) { preg_match("/^(\d+) (\d+) (.*)/", $bug, $result); $a = html_a("#$result[1]: $result[3]", "http://bugs.debian.org/$result[1]"); $li .= html_li($a ." (". ceil((time() - $result[2])/86400) ." day(s) old)"); } } print html_ul($li); } # main program # open package info db # source(binary, binary)[versions]{uninstalable_stable}{_testing}{_unstable}|priority|:section: $pack_db = dba_open("$prefix/ddpo_packages.db", 'r-', 'db4'); $uploads_db = dba_open("$prefix/uploads.db", 'r-', 'db4'); if($comaint == "") { $comaint = "yes"; } if(@$excuse) { do_extra($excuse, "excuses", "No excuse for $excuse"); }elseif(@$popcon) { print_popcon($popcon); printBackLink("?package=$popcon"); }elseif(@$wnpp) { if (!strstr($wnpp, "@")) $wnpp .= "@debian.org"; print html_h("WNPP bugs submitted by $wnpp", 2); print_wnpp_entry("s:$wnpp"); print html_h("WNPP bugs owned by $wnpp", 2); print_wnpp_entry("o:$wnpp"); printBackLink("?login=$wnpp"); }else if(@$gpg_key) { $contents = file("$prefix/ddpo_maintainers"); $match = 0; $gpg_key = preg_replace ("/0x/i", "", $gpg_key); foreach ($contents as $line) { if(preg_match("/^;[^;]*;[^;]*$gpg_key/i", $line)) { preg_match("/^;(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*)/i", $line, $pack_array); $match += 1; print_developer($pack_array[1], $pack_array[2], $pack_array[3], $comaint, array_slice($pack_array, 3)); print html_br(); if($match > 10){ break; } } } if($match == 0) { print_notfound($gpg_key); } printBackLink(); }elseif(@$login) { $login = preg_replace ("/\+/", "\+", $login); if (preg_match("/^[a-z0-9]+$/", $login)) $login .= "@debian.org"; $contents = file("$prefix/ddpo_maintainers"); $match = 0; foreach($contents as $line) { if (preg_match("/^;[^;]*;[^;]*;[^;]*$login/i", $line) || # substring for name preg_match("/^;$login;/i", $line)) # exact match for mail { preg_match("/^;(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*)/i", $line, $pack_array); $match += 1; print_developer($pack_array[1], $pack_array[2], $pack_array[3], $comaint, array_slice($pack_array, 3)); print html_br(); if($match > 10){ break; } } } if($match == 0) { print_notfound($login); if(isdisplayed('uploads')) print_uploaded_packages($login, $comaint); } printBackLink(); }elseif(@$package) { $contents = file("$prefix/ddpo_maintainers"); $package_re = preg_replace("/\+/", ".", $package); $match = 0; foreach($contents as $line) { if (preg_match("/[; ]${package_re}[; \#]/i", $line)) { preg_match("/^;(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*?);(.*)/i", $line, $pack_array); $match += 1; print_developer($pack_array[1], $pack_array[2], $pack_array[3], $comaint, array_slice($pack_array, 3)); print html_br(); if($match > 10){ break; } } } if($match == 0) { print_notfound($package); } printBackLink(); }elseif(@$all) { print_all(); }else{ print_form(); } print_footer(); ?> # vim:sw=4:ft=php:et: