$p = new DBPackage($package_id);
$str_changelog = $p->changelog;
echo "
";
/** Changelog **/
echo "\n";
$arr_patterns = array(
'/((bug\n?)( {1,2}\D?)|#)(\d+)/i',
'/([0123]?[0-9] (Jan|Feb|Mar|Apr|May|Ju[nl]|Aug|Sep|Oct|Nov|Dec) (19|20)\d{2});/',
'/<(.+)@gentoo.org>/'
);
$arr_replacements = array(
"
$1$4",
"
$1;",
"(
$1)",
);
$str_changelog = wordwrap($str_changelog, 80);
$str_changelog = htmlspecialchars($str_changelog);
$str_changelog = preg_replace($arr_patterns, $arr_replacements, $str_changelog);
if(!empty($str_changelog)) {
$str = gettext("CHANGELOG");
echo "
$str
";
echo "
\n";
echo "
";
echo "
";
echo $str_changelog;
echo "
";
echo "
";
echo "
\n";
}
echo "
\n";
/** Bugs **/
echo "\n";
$gentoo_bugs = "https://bugs.gentoo.org/buglist.cgi?query_format=&short_desc_type=allwords&short_desc=".urlencode($p->name)."&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED";
$str = gettext("BUGS");
echo "
$str
\n";
$sql = "SELECT bug, description FROM package_bugs WHERE package = ".$db->quote($package_id)." AND status = 0 ORDER BY bug;";
$arr = $db->getAssoc($sql);
if(count($arr)) {
echo "
\n";
// echo "\t\n";
// echo "\t\tBug | Description | \n";
// echo "\t
\n";
$x = 0;
foreach($arr as $bug => $description) {
$class = getRowClass($x++);
echo "\t\n";
echo "\t\t$bug | \n";
echo "\t\t".htmlentities($description)." | \n";
echo "\t
\n";
}
echo "
\n";
} else {
$str = gettext("No bugs found");
echo "
$str
\n";
}
if($lingua == "en")
echo "
Notes: This list is taken from a snapshot, and is not a reliable reference. Search bugzilla for accurate results.
\n";
echo "
\n";
/** Use Flags **/
echo "\n";
$str = gettext("USE FLAGS");
echo "
$str
\n";
if($view == 'ebuild')
$sql = "SELECT name, description FROM view_ebuild_use WHERE ebuild = ".$db->quote($ebuild_id)." ORDER BY name;";
else
$sql = "SELECT name, description FROM view_package_use WHERE package = ".$db->quote($package_id)." ORDER BY name;";
$arr = $db->getAssoc($sql);
if(count($arr)) {
echo "
\n";
$x = 0;
foreach($arr as $name => $description) {
$class = getRowClass($x++);
$url = $base_uri.'useflags/'.urlencode($name);
echo "\t\n";
echo "\t\t$name | \n";
echo "\t\t".htmlentities($description)." | \n";
echo "\t
\n";
}
echo "
\n";
} else {
$str = gettext("No Use Flags");
echo "
$str
";
}
echo "
\n";
/** Dependencies **/
echo "\n";
if($view == 'ebuild')
$sql = "SELECT type, cp, description FROM view_ebuild_depend WHERE ebuild = ".$db->quote($ebuild_id)." ORDER BY cp;";
else
$sql = "SELECT type, cp, description FROM view_package_depend WHERE package = ".$db->quote($package_id)." ORDER BY cp;";
$arr = $db->getAll($sql);
foreach($arr as $row) {
$arr_depends[$row['type']][$row['cp']] = $row['description'];
}
if(count($arr_depends)) {
ksort($arr_depends);
foreach($arr_depends as $type => $arr) {
if($type == 'depend')
$str = gettext('BUILD DEPENDENCIES');
else
$str = gettext('RUNTIME DEPENDENCIES');
if(count($arr)) {
echo "
$str
\n";
echo "
\n";
$x = 0;
foreach($arr as $cp => $description) {
$class = getRowClass($x++);
$url = $base_uri.$cp;
echo "\t\n";
echo "\t\t$cp | \n";
echo "\t\t$description | \n";
echo "\t
\n";
}
echo "
\n";
}
}
}
if($view == 'package') {
$sql = "SELECT DISTINCT cp, description FROM view_reverse_depend WHERE package = ".$db->quote($package_id)." ORDER BY cp;";
$arr = $db->getAssoc($sql);
if(count($arr)) {
$str = gettext("REVERSE DEPENDENCIES");
echo "
$str
\n";
echo "
\n";
$x = 0;
foreach($arr as $cp => $description) {
$class = getRowClass($x++);
$url = $base_uri.$cp;
echo "\t\n";
echo "\t\t$cp | \n";
echo "\t\t$description | \n";
echo "\t
\n";
}
echo "
\n";
}
$arr_licenses = $p->getLicenses();
$url_licenses = array();
/** License **/
echo "
\n";
$str = gettext("LICENSE");
echo "
$str
\n";
if(count($arr_licenses)) {
foreach($arr_licenses as $name) {
$str = nl2br(wordwrap(str_replace('-', ' ', $name), 25));
$url_licenses[$str] = $base_uri."licenses/".urlencode($name);
}
}
$str = "\t\t\t\t\t
\n";
foreach($url_licenses as $name => $url)
$str .= "\t\t\t\t\t\t- $name
\n";
$str .= "\t\t\t\t\t
\n";
echo $str;
echo "
\n";
}
echo "
\n";
/** Ebuild Source **/
if($view == 'ebuild') {
$e = new DBEbuild($ebuild_id);
$sql = "SELECT source FROM ebuild WHERE id = ".$db->quote($ebuild_id).";";
$source = $db->getOne($sql);
echo "\n";
$str = gettext("SOURCE CODE");
echo "
$str
\n";
echo "
\n";
$str = wordwrap($source, 80);
echo "
$str
";
echo "
\n";
echo "
\n";
$arr_licenses = $e->licenses;
$url_licenses = array();
/** License **/
echo "\n";
$str = gettext("LICENSE");
echo "
$str
\n";
if(count($arr_licenses)) {
foreach($arr_licenses as $name) {
$str = nl2br(wordwrap(str_replace('-', ' ', $name), 25));
$url_licenses[$str] = $base_uri."licenses/".urlencode($name);
}
}
$str = "\t\t\t\t\t
\n";
foreach($url_licenses as $name => $url)
$str .= "\t\t\t\t\t\t- $name
\n";
$str .= "\t\t\t\t\t
\n";
echo $str;
echo "
\n";
}
/** Downloads **/
echo "\n";
$str = gettext("DOWNLOADS");
echo "
$str
\n";
echo "\n";
if(($view == 'package' && in_array($section, $arr_package_sections)) || ($view == 'ebuild' && in_array($section, $arr_ebuild_sections))) {
echo "\n";
}
?>