X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=lib%2FPackages%2FDoShow.pm;h=e3e1945b6b7cc7123e4705a47f681e79f16106f1;hb=a4c9c1c1debdde95b8e83e85ada074de0fc035d5;hp=08eb376d236ddb237999af2258cae7048eabb64d;hpb=f27f1fcc5bffc0696f694e962eb40dbb0c554855;p=deb%2Fpackages.git
diff --git a/lib/Packages/DoShow.pm b/lib/Packages/DoShow.pm
index 08eb376..e3e1945 100644
--- a/lib/Packages/DoShow.pm
+++ b/lib/Packages/DoShow.pm
@@ -1,6 +1,7 @@
package Packages::DoShow;
use strict;
+use warnings;
use POSIX;
use URI::Escape;
@@ -75,19 +76,13 @@ sub do_show {
foreach (@results, @non_results) {
my $a = $_->[1];
my $s = $_->[2];
- if ($a =~ /^(?:us|security|non-US)$/o) {
- $all_suites{$s}++;
- } else {
- $all_suites{"$s/$a"}++;
- }
+ $all_suites{$s}++;
}
foreach (suites_sort(keys %all_suites)) {
- if (("$suite/$archive" eq $_)
- || (!$all_suites{"$suite/$archive"} && ($suite eq $_))) {
+ if ($suite eq $_) {
$$menu .= "[ $_ ] ";
} else {
- $$menu .=
- "[ $_ ] ";
+ $$menu .= "[ $suite})."\">$_ ] ";
}
}
$$menu .= '
';
@@ -106,7 +101,8 @@ sub do_show {
$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]);
}
@@ -148,22 +144,24 @@ sub do_show {
$long_desc =~ s/\n /\n/sgo;
$long_desc =~ s/\n.\n/\n
\n/go; $long_desc =~ s/(((\n|\A) [^\n]*)+)/\n
$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 ], - ); + my @menu = ( [ _g( "Distribution:" ), + _g( "Overview over this suite" ), + make_url("/",''), + $suite ], + [ _g( "Section:" ), + _g( "All packages in this section" ), + make_url("$subsection/",''), + $subsection ], ); + my $source = $page->get_src('package'); + 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; - $v_str .= " (and others)" if $multiple_versions; + $v_str .= _g(" and others") if $multiple_versions; my $title .= sprintf( _g( "Package: %s (%s)" ), $pkg, $v_str ); $title .= " ".marker( $archive ) if $archive ne 'us'; $title .= " ".marker( $subsection ) if $subsection eq 'non-US' @@ -172,7 +170,7 @@ sub do_show { $package_page .= title( $title ); if (my $provided_by = $page->{provided_by}) { - note( _g( "This is also a virtual package provided by ").join( ', ', map { "$_" } @$provided_by) ); + note( _g( "This is also a virtual package provided by ").join( ', ', map { "$_" } @$provided_by) ); } if ($suite eq "experimental") { @@ -204,9 +202,6 @@ sub do_show { if ( $dep_list ) { $package_page .= "\n"; $package_page .= sprintf( ""._g( "Other Packages Related to %s" )."
\n", $pkg ); - if ($suite eq "experimental") { - note( sprintf( _g( 'Note that the experimental distribution is not self-contained; missing dependencies are likely found in the unstable distribution.' ), "$ROOT/unstable/" ) ); - } $package_page .= pdeplegend( [ 'dep', _g( 'depends' ) ], [ 'rec', _g( 'recommends' ) ], @@ -232,18 +227,22 @@ sub do_show { $package_page .= ""._g( "Package Size")." "._g("Installed Size")." "._g("Files")." \n"; foreach my $a ( @archs ) { $package_page .= "\n"; - $package_page .= " $a \n"; $package_page .= "".$versions->{$a}." " if $multiple_versions; + $package_page .= ''; + # package size + $package_page .= sprintf(_g('%.1f kB'), + floor(($sizes_deb->{$a}/102.4)+0.5)/10); $package_page .= ' '; - $package_page .= floor(($sizes_deb->{$a}/102.4)+0.5)/10 . " kB"; - $package_page .= ' '; - $package_page .= $sizes_inst->{$a} . " kB"; + # installed size + $package_page .= sprintf(_g('%d kB'), + $sizes_inst->{$a}); $package_page .= " \n"; if ( $suite ne "experimental" ) { $package_page .= sprintf( "["._g( "list of files" )."]\n", - "$ROOT/$suite/$encodedpkg/$a/filelist", $pkg ); + make_url("$encodedpkg/$a/filelist",''), $pkg ); } else { $package_page .= _g( "no current information" ); } @@ -266,11 +265,11 @@ sub do_show { $$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' ], ); @@ -308,11 +307,11 @@ sub do_show { $$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 ], ); @@ -357,10 +356,6 @@ sub do_show { if ( $dep_list ) { $package_page .= " \n"; $package_page .= sprintf( ""._g( "Other Packages Related to %s" )."
\n", $pkg ); - if ($suite eq "experimental") { - note( sprintf( _g( 'Note that the experimental distribution is not self-contained; missing dependencies are likely found in the unstable distribution.' ), "$ROOT/unstable/" ) ); - - } $package_page .= pdeplegend( [ 'adep', _g( 'build-depends' ) ], [ 'idep', _g( 'build-depends-indep' ) ], @@ -389,7 +384,7 @@ sub do_show { my ($src_file_md5, $src_file_size, $src_file_name) = split /\s+/, $_; my $src_url; - for ($archive) { + for ("$suite/$archive") { /security/o && do { $src_url = $FTP_SITES{security}; last }; /volatile/o && do {