X-Git-Url: https://git.deb.at/?p=deb%2Fpackages.git;a=blobdiff_plain;f=cgi-bin%2Fshow_package.pl;h=e4e897c970bf4cf2a18dfb79f31fb1ea2b43438e;hp=f6324d6bb0db35638088ce459b8136cce23d54c2;hb=87124f967c3da82618899b3d2c114981b12ffb7f;hpb=08852aab550de858d4e4956ea357dbc3ae713a26 diff --git a/cgi-bin/show_package.pl b/cgi-bin/show_package.pl index f6324d6..e4e897c 100755 --- a/cgi-bin/show_package.pl +++ b/cgi-bin/show_package.pl @@ -50,7 +50,8 @@ $Packages::CGI::debug = $debug; # read the configuration our $config_read_time ||= 0; our $db_read_time ||= 0; -our ( $topdir, $ROOT, @SUITES, @SECTIONS, @ARCHIVES, @ARCHITECTURES ); +our ( $topdir, $ROOT, @SUITES, @SECTIONS, @ARCHIVES, @ARCHITECTURES, + %FTP_SITES ); # FIXME: move to own module my $modtime = (stat( "../config.sh" ))[9]; @@ -71,6 +72,8 @@ if ($modtime > $config_read_time) { $Packages::HTML::BUG_URL = $1 if /^\s*bug_url="?([^\"]*)"?\s*$/o; $Packages::HTML::SRC_BUG_URL = $1 if /^\s*src_bug_url="?([^\"]*)"?\s*$/o; $Packages::HTML::QA_URL = $1 if /^\s*qa_url="?([^\"]*)"?\s*$/o; + $FTP_SITES{us} = $1 if /^\s*ftpsite="?([^\"]*)"?\s*$/o; + $FTP_SITES{$1} = $2 if /^\s*(\w+)_ftpsite="?([^\"]*)"?\s*$/o; @SUITES = split(/\s+/, $1) if /^\s*suites="?([^\"]*)"?\s*$/o; @SECTIONS = split(/\s+/, $1) if /^\s*sections="?([^\"]*)"?\s*$/o; @ARCHIVES = split(/\s+/, $1) if /^\s*archives="?([^\"]*)"?\s*$/o; @@ -280,7 +283,8 @@ unless (@Packages::CGI::fatal_errors) { # # display dependencies # - my $dep_list = print_deps( \%packages, \%opts, $pkg, + my $dep_list; + $dep_list = print_deps( \%packages, \%opts, $pkg, $page->get_dep_field('depends'), 'depends' ); $dep_list .= print_deps( \%packages, \%opts, $pkg, @@ -302,62 +306,63 @@ unless (@Packages::CGI::fatal_errors) { [ 'sug', gettext( 'suggests' ) ], ); $package_page .= $dep_list; - $package_page .= " \n"; - - # - # Download package - # - my $encodedpack = uri_escape( $pkg ); - $package_page .= "
"; - $package_page .= sprintf( "

".gettext( "Download %s\n" )."

", - $pkg ) ; - $package_page .= "\n"; - $package_page .= "\n"; + $package_page .= "\n"; + } + + # + # Download package + # + my $encodedpack = uri_escape( $pkg ); + $package_page .= "
"; + $package_page .= sprintf( "

".gettext( "Download %s\n" )."

", + $pkg ) ; + $package_page .= "
".gettext("Download for all available architectures")."
\n"; + $package_page .= "\n"; + $package_page .= "\n"; + $package_page .= "\n"; + foreach my $a ( @archs ) { $package_page .= "\n"; - $package_page .= "\n"; - foreach my $a ( @archs ) { - $package_page .= "\n"; - $package_page .= "\n"; - $package_page .= "\n\n\n"; + $package_page .= "
".gettext("Download for all available architectures")."
".gettext("Architecture")."".gettext("Files")."".gettext( "Package Size")."".gettext("Installed Size")."
".gettext("Architecture")."".gettext("Files")."".gettext( "Package Size")."".gettext("Installed Size")."
{$a}); - $package_page .= "&md5sum=$file_md5sums->{$a}"; - $package_page .= "&arch=$a"; - # there was at least one package with two - # different source packages on different - # archs where one had a security update - # and the other one not - for ($archives->{$a}) { - /security/o && do { - $package_page .= "&type=security"; last }; - /volatile/o && do { - $package_page .= "&type=volatile"; last }; - /non-us/io && do { - $package_page .= "&type=nonus"; last }; - $package_page .= "&type=main"; - } - $package_page .= "\">$a"; - if ( $suite ne "experimental" ) { - $package_page .= sprintf( "[".gettext( "list of files" )."]\n", "$FILELIST_URL$encodedpkg&version=$suite&arch=$a", $pkg ); - } else { - $package_page .= gettext( "no current information" ); - } - $package_page .= ""; - $package_page .= floor(($sizes_deb->{$a}/102.4)+0.5)/10; - $package_page .= ""; - $package_page .= $sizes_inst->{$a}; - $package_page .= "
{$a}); + $package_page .= "&md5sum=$file_md5sums->{$a}"; + $package_page .= "&arch=$a"; + # there was at least one package with two + # different source packages on different + # archs where one had a security update + # and the other one not + for ($archives->{$a}) { + /security/o && do { + $package_page .= "&type=security"; last }; + /volatile/o && do { + $package_page .= "&type=volatile"; last }; + /non-us/io && do { + $package_page .= "&type=nonus"; last }; + $package_page .= "&type=main"; } - $package_page .= "

".gettext ( "Size is measured in kBytes." )."

\n"; - $package_page .= "
\n"; - - # - # more information - # - $package_page .= pmoreinfo( name => $pkg, data => $page, - bugreports => 1, sourcedownload => 1, - changesandcopy => 0, maintainers => 1, - search => 1 ); + $package_page .= "\">$a\n"; + $package_page .= ""; + if ( $suite ne "experimental" ) { + $package_page .= sprintf( "[".gettext( "list of files" )."]\n", "$FILELIST_URL$encodedpkg&version=$suite&arch=$a", $pkg ); + } else { + $package_page .= gettext( "no current information" ); + } + $package_page .= "\n"; + $package_page .= floor(($sizes_deb->{$a}/102.4)+0.5)/10; + $package_page .= "\n"; + $package_page .= $sizes_inst->{$a}; + $package_page .= "\n"; } + $package_page .= "

".gettext ( "Size is measured in kBytes." )."

\n"; + $package_page .= " \n"; + + # + # more information + # + $package_page .= pmoreinfo( name => $pkg, data => $page, + env => \%FTP_SITES, + bugreports => 1, sourcedownload => 1, + changesandcopy => 1, maintainers => 1, + search => 1 ); } } }