package Packages::DoShow;
use strict;
+use warnings;
use POSIX;
use URI::Escape;
unless (@results || @non_results ) {
fatal_error( _g( "No such package." )."<br>".
- sprintf( _g( '<a href="%s">Search for the package</a>' ), "$SEARCH_URL/$pkg" ) );
+ sprintf( _g( '<a href="%s">Search for the package</a>' ), make_search_url('','keywords='.uri_escape($pkg)) ) );
} else {
my %all_suites;
foreach (@results, @non_results) {
if ($suite eq $_) {
$$menu .= "[ <strong>$_</strong> ] ";
} else {
- $$menu .= "[ <a href=\"$ROOT/$_/$encodedpkg\">$_</a> ] ";
+ $$menu .= "[ <a href=\"".make_url($encodedpkg,'',{suite=>$_})."\">$_</a> ] ";
}
}
$$menu .= '<br>';
$data{package} = $pkg;
$data{architecture} = $arch;
$data{version} = $version;
- $page->merge_package(\%data) or debug( "Merging $pkg $arch $version FAILED", 2 ) if DEBUG;
+ $page->merge_package(\%data)
+ or debug( "Merging $pkg $arch $version FAILED", 2 ) if DEBUG;
} else {
$page->add_provided_by([split /\s+/, $provided_by]);
}
debug( "Data search and merging took ".timestr($std) ) if DEBUG;
my $did = $page->get_newest( 'description' );
+ my @tags = split(/, /, $page->get_newest( 'tag' ));
$section = $page->get_newest( 'section' );
$subsection = $page->get_newest( 'subsection' );
my $filenames = $page->get_arch_field( 'filename' );
$long_desc =~ s/\n /\n/sgo;
$long_desc =~ s/\n.\n/\n<p>\n/go;
$long_desc =~ s/(((\n|\A) [^\n]*)+)/\n<pre>$1\n<\/pre>/sgo;
-# $long_desc = conv_desc( $lang, $long_desc );
-# $short_desc = conv_desc( $lang, $short_desc );
-
- $$menu .= simple_menu( [ _g( "Distribution:" ),
- _g( "Overview over this suite" ),
- "$ROOT/$suite/",
- $suite ],
- [ _g( "Section:" ),
- _g( "All packages in this section" ),
- "$ROOT/$suite/$subsection/",
- $subsection ],
- [ _g( "Source:" ),
- _g( "Source package building this package" ),
- "$ROOT/$suite/source/".$page->get_src('package'),
- $page->get_src('package') ],
- );
+ my @menu = ( [ _g( "Distribution:" ),
+ _g( "Overview over this suite" ),
+ make_url("/",''),
+ $suite ],
+ [ _g( "Section:" ),
+ _g( "All packages in this section" ),
+ make_url("$subsection/",''),
+ $subsection ], );
+ push @menu, [ _g( "Source:" ),
+ _g( "Source package building this package" ),
+ make_url($source,'',{source=>'source'}),
+ $source ] if $source;
+ $$menu .= simple_menu( @menu );
my $v_str = $version;
my $multiple_versions = grep { $_ ne $version } values %$versions;
$package_page .= title( $title );
if (my $provided_by = $page->{provided_by}) {
- note( _g( "This is also a virtual package provided by ").join( ', ', map { "<a href=\"$ROOT/$suite/$_\">$_</a>" } @$provided_by) );
+ note( _g( "This is also a virtual package provided by ").join( ', ', map { "<a href=\"".make_url($_,'')."\">$_</a>" } @$provided_by) );
}
if ($suite eq "experimental") {
);
}
$package_page .= pdesc( $short_desc, $long_desc );
+ $package_page .= ptags( $pkg, @tags ) if @tags;
#
# display dependencies
if ( $dep_list ) {
$package_page .= "<div id=\"pdeps\">\n";
$package_page .= sprintf( "<h2>"._g( "Other Packages Related to %s" )."</h2>\n", $pkg );
- if ($suite eq "experimental") {
- note( sprintf( _g( 'Note that the <strong>experimental</strong> distribution is not self-contained; missing dependencies are likely found in the <a href="%s">unstable</a> distribution.' ), "$ROOT/unstable/" ) );
- }
$package_page .= pdeplegend( [ 'dep', _g( 'depends' ) ],
[ 'rec', _g( 'recommends' ) ],
$package_page .= "<th>"._g( "Package Size")."</th><th>"._g("Installed Size")."</th><th>"._g("Files")."</th></tr>\n";
foreach my $a ( @archs ) {
$package_page .= "<tr>\n";
- $package_page .= "<th><a href=\"$ROOT/$suite/$encodedpkg/$a/download";
+ $package_page .= "<th><a href=\"".make_url("$encodedpkg/$a/download",'');
$package_page .= "\">$a</a></th>\n";
$package_page .= "<td>".$versions->{$a}."</td>"
if $multiple_versions;
$package_page .= '<td class="size">';
- $package_page .= floor(($sizes_deb->{$a}/102.4)+0.5)/10 . " kB";
+ # package size
+ $package_page .= sprintf(_g('%.1f kB'),
+ floor(($sizes_deb->{$a}/102.4)+0.5)/10);
$package_page .= '</td><td class="size">';
- $package_page .= $sizes_inst->{$a} . " kB";
+ # installed size
+ $package_page .= sprintf(_g('%d kB'),
+ $sizes_inst->{$a});
$package_page .= "</td>\n<td>";
- if ( $suite ne "experimental" ) {
+ if ( ($suite ne "experimental")
+ && ($subsection ne 'debian-installer')) {
$package_page .= sprintf( "[<a href=\"%s\">"._g( "list of files" )."</a>]\n",
- "$ROOT/$suite/$encodedpkg/$a/filelist", $pkg );
+ make_url("$encodedpkg/$a/filelist",''), $pkg );
} else {
$package_page .= _g( "no current information" );
}
$$menu .= simple_menu( [ _g( "Distribution:" ),
_g( "Overview over this distribution" ),
- "$ROOT/",
+ make_url('/',''),
$suite ],
[ _g( "Section:" ),
_g( "All packages in this section" ),
- "$ROOT/$suite/virtual/",
+ make_url("virtual/",''),
'virtual' ], );
$$menu .= simple_menu( [ _g( "Distribution:" ),
_g( "Overview over this suite" ),
- "/$suite/",
+ make_url('/',''),
$suite ],
[ _g( "Section:" ),
_g( "All packages in this section" ),
- "/$suite/$subsection/",
+ make_url("$subsection/",''),
$subsection ],
);
if ( $dep_list ) {
$package_page .= "<div id=\"pdeps\">\n";
$package_page .= sprintf( "<h2>"._g( "Other Packages Related to %s" )."</h2>\n", $pkg );
- if ($suite eq "experimental") {
- note( sprintf( _g( 'Note that the <strong>experimental</strong> distribution is not self-contained; missing dependencies are likely found in the <a href="%s">unstable</a> distribution.' ), "$ROOT/unstable/" ) );
-
- }
$package_page .= pdeplegend( [ 'adep', _g( 'build-depends' ) ],
[ 'idep', _g( 'build-depends-indep' ) ],
foreach( @$source_files ) {
my ($src_file_md5, $src_file_size, $src_file_name)
= split /\s+/, $_;
- my $src_url;
- for ($archive) {
- /security/o && do {
- $src_url = $FTP_SITES{security}; last };
- /volatile/o && do {
- $src_url = $FTP_SITES{volatile}; last };
- /backports/o && do {
-
- $src_url = $FTP_SITES{backports}; last };
- /non-us/io && do {
- $src_url = $FTP_SITES{'non-US'}; last };
- $src_url = $FTP_SITES{us};
- }
+ (my $server = lc $archive) =~ s/-//go; # non-US hack
+ my $src_url = $FTP_SITES{$server}
+ || $FTP_SITES{us};
$src_url .= "/$source_dir/$src_file_name";
$package_page .= "<tr><td><a href=\"$src_url\">$src_file_name</a></td>\n"