From 27d33ebb54f354d5d0d1fb68c94ff6a5682b54c3 Mon Sep 17 00:00:00 2001
From: Frank Lichtenheld You can download the requested file from the ";
- print join( '/', @file_components).'/';
- print " subdirectory at";
- print $archive ne 'security' ? " any of these sites:" : ":";
- print " Debian security updates are currently officially distributed only via
- security.debian.org.Download Page for $filen $arch_string
\n".
- "
The MD5sum for $filen is $md5sum
\n" - if $md5sum; -} - -my $trailer = Packages::HTML::trailer( ".." ); -$trailer =~ s/LAST_MODIFIED_DATE/gmtime()/e; -print $trailer; - -exit; - -sub print_links { - my ( $title, $file, @servers ) = @_; - - print "$title
"; - print ""; - -} diff --git a/cgi-bin/search_packages.pl b/cgi-bin/search_packages.pl deleted file mode 100755 index d8d2641..0000000 --- a/cgi-bin/search_packages.pl +++ /dev/null @@ -1,418 +0,0 @@ -#!/usr/bin/perl -wT -# $Id$ -# search_packages.pl -- CGI interface to the Packages files on packages.debian.org -# -# Copyright (C) 1998 James Treacy -# Copyright (C) 2000, 2001 Josip Rodin -# Copyright (C) 2001 Adam Heath -# Copyright (C) 2004 Martin Schulze -# Copyright (C) 2004-2006 Frank Lichtenheld -# -# use is allowed under the terms of the GNU Public License (GPL) -# see http://www.fsf.org/copyleft/gpl.html for a copy of the license - -use strict; -use lib '../lib'; -use CGI qw( -oldstyle_urls ); -use CGI::Carp qw( fatalsToBrowser ); -use POSIX; -use URI::Escape; -use HTML::Entities; -use DB_File; -use Benchmark ':hireswallclock'; - -use Deb::Versions; -use Packages::Config qw( $DBDIR $ROOT $SEARCH_CGI $SEARCH_PAGE - @SUITES @SECTIONS @ARCHIVES @ARCHITECTURES ); -use Packages::CGI; -use Packages::DB; -use Packages::Search qw( :all ); -use Packages::HTML (); - -&Packages::CGI::reset; - -$ENV{PATH} = "/bin:/usr/bin"; - -# Read in all the variables set by the form -my $input; -if ($ARGV[0] && ($ARGV[0] eq 'php')) { - $input = new CGI(\*STDIN); -} else { - $input = new CGI; -} - -my $pet0 = new Benchmark; -my $tet0 = new Benchmark; -# use this to disable debugging in production mode completly -my $debug_allowed = 1; -my $debug = $debug_allowed && $input->param("debug"); -$debug = 0 if !defined($debug) || $debug !~ /^\d+$/o; -$Packages::CGI::debug = $debug; - -&Packages::Config::init( '../' ); -&Packages::DB::init(); - -if (my $path = $input->param('path')) { - my @components = map { lc $_ } split /\//, $path; - - my %SUITES = map { $_ => 1 } @SUITES; - my %SECTIONS = map { $_ => 1 } @SECTIONS; - my %ARCHIVES = map { $_ => 1 } @ARCHIVES; - my %ARCHITECTURES = map { $_ => 1 } @ARCHITECTURES; - - foreach (@components) { - if ($SUITES{$_}) { - $input->param('suite', $_); - } elsif ($SECTIONS{$_}) { - $input->param('section', $_); - } elsif ($ARCHIVES{$_}) { - $input->param('archive', $_); - } elsif ($ARCHITECTURES{$_}) { - $input->param('arch', $_); - } elsif ($_ eq 'source') { - $input->param('searchon','sourcenames'); - } - } -} - -my ( $format, $keyword, $case, $subword, $exact, $searchon, - @suites, @sections, @archives, @archs ); - -my %params_def = ( keywords => { default => undef, - match => '^\s*([-+\@\w\/.:]+)\s*$', - var => \$keyword }, - suite => { default => 'stable', match => '^([\w-]+)$', - alias => 'version', array => ',', - var => \@suites, - replace => { all => \@SUITES } }, - archive => { default => 'all', match => '^([\w-]+)$', - array => ',', var => \@archives, - replace => { all => \@ARCHIVES } }, - case => { default => 'insensitive', match => '^(\w+)$', - var => \$case }, - official => { default => 0, match => '^(\w+)$' }, - subword => { default => 0, match => '^(\w+)$', - var => \$subword }, - exact => { default => undef, match => '^(\w+)$', - var => \$exact }, - searchon => { default => 'all', match => '^(\w+)$', - var => \$searchon }, - section => { default => 'all', match => '^([\w-]+)$', - alias => 'release', array => ',', - var => \@sections, - replace => { all => \@SECTIONS } }, - arch => { default => 'any', match => '^(\w+)$', - array => ',', var => \@archs, replace => - { any => \@ARCHITECTURES } }, - format => { default => 'html', match => '^(\w+)$', - var => \$format }, - ); -my %opts; -my %params = Packages::Search::parse_params( $input, \%params_def, \%opts ); - -#XXX: Don't use alternative output formats yet -$format = 'html'; -if ($format eq 'html') { - print $input->header( -charset => 'utf-8' ); -} - -if ($params{errors}{keywords}) { - fatal_error( "keyword not valid or missing" ); -} elsif (length($keyword) < 2) { - fatal_error( "keyword too short (keywords need to have at least two characters)" ); -} - -my $case_bool = ( $case !~ /insensitive/ ); -$exact = !$subword unless defined $exact; -$opts{h_suites} = { map { $_ => 1 } @suites }; -$opts{h_sections} = { map { $_ => 1 } @sections }; -$opts{h_archives} = { map { $_ => 1 } @archives }; -$opts{h_archs} = { map { $_ => 1 } @archs }; - -# for URL construction -my $suites_param = join ',', @{$params{values}{suite}{no_replace}}; -my $sections_param = join ',', @{$params{values}{section}{no_replace}}; -my $archs_param = join ',', @{$params{values}{arch}{no_replace}}; - -# for output -my $keyword_enc = encode_entities $keyword || ''; -my $searchon_enc = encode_entities $searchon; -my $suites_enc = encode_entities join ', ', @{$params{values}{suite}{no_replace}}; -my $sections_enc = encode_entities join ', ', @{$params{values}{section}{no_replace}}; -my $archs_enc = encode_entities join ', ', @{$params{values}{arch}{no_replace}}; -my $pet1 = new Benchmark; -my $petd = timediff($pet1, $pet0); -debug( "Parameter evaluation took ".timestr($petd) ); - -my $st0 = new Benchmark; -my @results; - -unless (@Packages::CGI::fatal_errors) { - - if ($searchon eq 'names') { - push @results, @{ do_names_search( $keyword, \%packages, - $p_obj, - \&read_entry, \%opts ) }; - } elsif ($searchon eq 'sourcenames') { - push @results, @{ do_names_search( $keyword, \%sources, - $sp_obj, - \&read_src_entry, \%opts ) }; - } elsif ($searchon eq 'contents') { - require "./search_contents.pl"; - &contents($input); - } else { - push @results, @{ do_names_search( $keyword, \%packages, - $p_obj, - \&read_entry, \%opts ) }; - push @results, @{ do_fulltext_search( $keyword, "$DBDIR/descriptions.txt", - \%did2pkg, - \%packages, - \&read_entry, \%opts ) }; - } -} - -my $st1 = new Benchmark; -my $std = timediff($st1, $st0); -debug( "Search took ".timestr($std) ); - -if ($format eq 'html') { - my $suite_wording = $suites_enc eq "all" ? "all suites" - : "suite(s) $suites_enc"; - my $section_wording = $sections_enc eq 'all' ? "all sections" - : "section(s) $sections_enc"; - my $arch_wording = $archs_enc eq 'any' ? "all architectures" - : "architecture(s) $archs_enc"; - if (($searchon eq "names") || ($searchon eq 'sourcenames')) { - my $source_wording = ( $searchon eq 'sourcenames' ) ? "source " : ""; - my $exact_wording = $exact ? "named" : "that names contain"; - msg( "You have searched for ${source_wording}packages $exact_wording $keyword_enc in $suite_wording, $section_wording, and $arch_wording." ); - } else { - my $exact_wording = $exact ? "" : " (including subword matching)"; - msg( "You have searched for $keyword_enc in packages names and descriptions in $suite_wording, $section_wording, and $arch_wording$exact_wording." ); - } -} - -if ($Packages::Search::too_many_hits) { - error( "Your search was too wide so we will only display exact matches. At least $Packages::Search::too_many_hits results have been omitted and will not be displayed. Please consider using a longer keyword or more keywords." ); -} - -if (!@Packages::CGI::fatal_errors && !@results) { - if ($format eq 'html') { - my $keyword_esc = uri_escape( $keyword ); - my $printed = 0; - if (($searchon eq "names") || ($searchon eq 'sourcenames')) { - if (($suites_enc eq 'all') - && ($archs_enc eq 'any') - && ($sections_enc eq 'all')) { - error( "Can't find that package." ); - } else { - error( "Can't find that package, at least not in that suite ". - ( ( $searchon eq 'sourcenames' ) ? "" : " and on that architecture" ) ) - } - - if ($exact) { - $printed++; - hint( "You have searched only for exact matches of the package name. You can try to search for package names that contain your search string." ); - } - } else { - if (($suites_enc eq 'all') - && ($archs_enc eq 'any') - && ($sections_enc eq 'all')) { - error( "Can't find that string." ); - } else { - error( "Can't find that string, at least not in that suite ($suites_enc, section $sections_enc) and on that architecture ($archs_enc)." ); - } - - unless ($subword) { - $printed++; - hint( "You have searched only for words exactly matching your keywords. You can try to search allowing subword matching." ); - } - } - hint( ( $printed ? "Or you" : "You" )." can try a different search on the Packages search page." ); - - } -} - -print Packages::HTML::header( title => 'Package Search Results' , - lang => 'en', - title_tag => 'Debian Package Search Results', - print_title_above => 1, - print_search_field => 'packages', - search_field_values => { - keywords => $keyword_enc, - searchon => $searchon, - arch => $archs_enc, - suite => $suites_enc, - section => $sections_enc, - subword => $subword, - exact => $exact, - case => $case, - debug => $debug, - }, - ); -print_msgs(); -print_errors(); -print_hints(); -print_debug(); -if (@results) { - my (%pkgs, %subsect, %sect, %archives, %desc, %binaries, %provided_by); - - unless ($opts{searchon} eq 'sourcenames') { - foreach (@results) { - my ($pkg_t, $archive, $suite, $arch, $section, $subsection, - $priority, $version, $desc) = @$_; - - my ($pkg) = $pkg_t =~ m/^(.+)/; # untaint - if ($arch ne 'virtual') { - my $real_archive; - if ($archive =~ /^(security|non-US)$/) { - $real_archive = $archive; - $archive = 'us'; - } - - $pkgs{$pkg}{$suite}{$archive}{$version}{$arch} = 1; - $subsect{$pkg}{$suite}{$archive}{$version} = $subsection; - $sect{$pkg}{$suite}{$archive}{$version} = $section - unless $section eq 'main'; - $archives{$pkg}{$suite}{$archive}{$version} = $real_archive - if $real_archive; - - $desc{$pkg}{$suite}{$archive}{$version} = $desc; - } else { - $provided_by{$pkg}{$suite}{$archive} = [ split /\s+/, $desc ]; - } - } - -my @pkgs = sort(keys %pkgs, keys %provided_by); - if ($opts{format} eq 'html') { - #my ($start, $end) = multipageheader( $input, scalar @pkgs, \%opts ); - print "Found ".(scalar @pkgs)." matching packages,"; - #my $count = 0; - - foreach my $pkg (@pkgs) { - #$count++; - #next if $count < $start or $count > $end; - printf "
Found ".(scalar keys %pkgs)." matching packages,"; - #my $count = 0; - - foreach my $pkg (sort keys %pkgs) { - #$count++; - #next if ($count < $start) or ($count > $end); - printf "
"; - for (my $i=0; $i"; -} - -my $tet1 = new Benchmark; -my $tetd = timediff($tet1, $tet0); -print "Total page evaluation took ".timestr($tetd)."
" - if $debug_allowed; - -my $trailer = Packages::HTML::trailer( $ROOT ); -$trailer =~ s/LAST_MODIFIED_DATE/gmtime()/e; #FIXME -print $trailer; - -# vim: ts=8 sw=4 diff --git a/cgi-bin/show_package.pl b/cgi-bin/show_package.pl deleted file mode 100755 index d3d6c7a..0000000 --- a/cgi-bin/show_package.pl +++ /dev/null @@ -1,586 +0,0 @@ -#!/usr/bin/perl -wT -# $Id$ -# show_package.pl -- CGI interface to show info about a package -# -# Copyright (C) 1998 James Treacy -# Copyright (C) 2000, 2001 Josip Rodin -# Copyright (C) 2001 Adam Heath -# Copyright (C) 2004 Martin Schulze -# Copyright (C) 2004-2006 Frank Lichtenheld -# Copyright (C) 2006 Jeroen van Wolffelaar -# -# use is allowed under the terms of the GNU Public License (GPL) -# see http://www.fsf.org/copyleft/gpl.html for a copy of the license - -use strict; -use lib '../lib'; -use CGI qw( -oldstyle_urls ); -use CGI::Carp qw( fatalsToBrowser ); -use POSIX; -use URI::Escape; -use HTML::Entities; -use DB_File; -use Benchmark ':hireswallclock'; - -use Deb::Versions; -use Packages::Config qw( $DBDIR $ROOT @SUITES @ARCHIVES @SECTIONS - @ARCHITECTURES %FTP_SITES ); -use Packages::CGI; -use Packages::DB; -use Packages::Search qw( :all ); -use Packages::HTML; -use Packages::Page (); -use Packages::SrcPage (); - -&Packages::CGI::reset; - -$ENV{PATH} = "/bin:/usr/bin"; - -# Read in all the variables set by the form -my $input; -if ($ARGV[0] && ($ARGV[0] eq 'php')) { - $input = new CGI(\*STDIN); -} else { - $input = new CGI; -} - -my $pet0 = new Benchmark; -my $tet0 = new Benchmark; -# use this to disable debugging in production mode completly -my $debug_allowed = 1; -my $debug = $debug_allowed && $input->param("debug"); -$debug = 0 if !defined($debug) || $debug !~ /^\d+$/o; -$Packages::CGI::debug = $debug; - -&Packages::Config::init( '../' ); -&Packages::DB::init(); - -if (my $path = $input->param('path')) { - my @components = map { lc $_ } split /\//, $path; - - my %SUITES = map { $_ => 1 } @SUITES; - my %SECTIONS = map { $_ => 1 } @SECTIONS; - my %ARCHIVES = map { $_ => 1 } @ARCHIVES; - my %ARCHITECTURES = map { $_ => 1 } @ARCHITECTURES; - - foreach (@components) { - if ($SUITES{$_}) { - $input->param('suite', $_); - } elsif ($SECTIONS{$_}) { - $input->param('section', $_); - } elsif ($ARCHIVES{$_}) { - $input->param('archive', $_); - } elsif ($ARCHITECTURES{$_}) { - $input->param('arch', $_); - } elsif ($_ eq 'source') { - $input->param('source', 1); - } - } -} - -my ( $pkg, $suite, @sections, @archs, @archives, $format ); -my %params_def = ( package => { default => undef, match => '^([a-z0-9.+-]+)$', - var => \$pkg }, - suite => { default => undef, match => '^(\w+)$', - var => \$suite }, - archive => { default => 'all', match => '^(\w+)$', - array => ',', var => \@archives, - replace => { all => [qw(us security non-US)] } }, - section => { default => 'all', match => '^(\w+)$', - array => ',', var => \@sections, - replace => { all => \@SECTIONS } }, - arch => { default => 'any', match => '^(\w+)$', - array => ',', var => \@archs, - replace => { any => \@ARCHITECTURES } }, - format => { default => 'html', match => '^(\w+)$', - var => \$format }, - source => { default => 0, match => '^(\d+)$' }, - ); -my %opts; -my %params = Packages::Search::parse_params( $input, \%params_def, \%opts ); - -#XXX: Don't use alternative output formats yet -$format = 'html'; -if ($format eq 'html') { - print $input->header( -charset => 'utf-8' ); -} - -if ($params{errors}{package}) { - fatal_error( "package not valid or not specified" ); - $pkg = ''; -} -if ($params{errors}{suite}) { - fatal_error( "suite not valid or not specified" ); - $suite = ''; -} - -$opts{h_suites} = { $suite => 1 }; -$opts{h_archs} = { map { $_ => 1 } @archs }; -$opts{h_sections} = { map { $_ => 1 } @sections }; -$opts{h_archives} = { map { $_ => 1 } @archives }; - -my $DL_URL = "$pkg/download"; -my $FILELIST_URL = "$pkg/files"; - -our (%packages_all, %sources_all); -my (@results, @non_results); -my $page = $opts{source} ? - new Packages::SrcPage( $pkg ) : - new Packages::Page( $pkg ); -my $package_page = ""; -my ($short_desc, $version, $archive, $section, $subsection) = ("")x5; - -sub gettext { return $_[0]; }; - -my $st0 = new Benchmark; -unless (@Packages::CGI::fatal_errors) { - tie %packages_all, 'DB_File', "$DBDIR/packages_all_$suite.db", - O_RDONLY, 0666, $DB_BTREE - or die "couldn't tie DB $DBDIR/packages_all_$suite.db: $!"; - tie %sources_all, 'DB_File', "$DBDIR/sources_all_$suite.db", - O_RDONLY, 0666, $DB_BTREE - or die "couldn't tie DB $DBDIR/sources_all_$suite.db: $!"; - - unless ($opts{source}) { - read_entry_all( \%packages, $pkg, \@results, \@non_results, \%opts ); - - unless (@results || @non_results ) { - fatal_error( "No such package". - "{insert link to search page with substring search}" ); - } else { - unless (@results) { - fatal_error( "Package not available in this suite" ); - } else { - for my $entry (@results) { - debug( join(":", @$entry), 1 ); - my (undef, $archive, undef, $arch, $section, $subsection, - $priority, $version, $provided_by) = @$entry; - - if ($arch ne 'virtual') { - my %data = split /\000/, $packages_all{"$pkg $arch $version"}; - $data{package} = $pkg; - $data{architecture} = $arch; - $data{version} = $version; - $page->merge_package(\%data) or debug( "Merging $pkg $arch $version FAILED", 2 ); - } else { - $page->add_provided_by([split /\s+/, $provided_by]); - } - } - - unless ($page->is_virtual()) { - $version = $page->{newest}; - my $source = $page->get_newest( 'source' ); - $archive = $page->get_newest( 'archive' ); - debug( "find source package: source=$source", 1); - my $src_data = $sources_all{"$archive $suite $source"}; - $page->add_src_data( $source, $src_data ) - if $src_data; - - my $st1 = new Benchmark; - my $std = timediff($st1, $st0); - debug( "Data search and merging took ".timestr($std) ); - - my $encodedpkg = uri_escape( $pkg ); - my ($v_str, $v_str_arch, $v_str_arr) = $page->get_version_string(); - my $did = $page->get_newest( 'description' ); - $section = $page->get_newest( 'section' ); - $subsection = $page->get_newest( 'subsection' ); - my $filenames = $page->get_arch_field( 'filename' ); - my $file_md5sums = $page->get_arch_field( 'md5sum' ); - my $archives = $page->get_arch_field( 'archive' ); - my $sizes_inst = $page->get_arch_field( 'installed-size' ); - my $sizes_deb = $page->get_arch_field( 'size' ); - my @archs = sort $page->get_architectures; - - # process description - # - my $desc = $descriptions{$did}; - $short_desc = encode_entities( $1, "<>&\"" ) - if $desc =~ s/^(.*)$//m; - my $long_desc = encode_entities( $desc, "<>&\"" ); - - $long_desc =~ s,((ftp|http|https)://[\S~-]+?/?)((\>\;)?[)]?[']?[:.\,]?(\s|$)),$1$3,go; # syntax highlighting -> ']; - $long_desc =~ s/\A //o; - $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 ); - - my %all_suites; - 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"}++; - } - } - foreach (suites_sort(keys %all_suites)) { - if (("$suite/$archive" eq $_) - || (!$all_suites{"$suite/$archive"} && ($suite eq $_))) { - $package_page .= "[ $_ ] "; - } else { - $package_page .= - "[ $_ ] "; - } - } - $package_page .= '
'; - - $package_page .= simple_menu( [ gettext( "Distribution:" ), - gettext( "Overview over this suite" ), - "$ROOT/$suite/", - $suite ], - [ gettext( "Section:" ), - gettext( "All packages in this section" ), - "$ROOT/$suite/$subsection/", - $subsection ], - ); - - my $title .= sprintf( gettext( "Package: %s (%s)" ), $pkg, $v_str ); - $title .= " ".marker( $archive ) if $archive ne 'us'; - $title .= " ".marker( $subsection ) if $subsection eq 'non-US' - and $archive ne 'non-US'; # non-US/security - $title .= " ".marker( $section ) if $section ne 'main'; - $package_page .= title( $title ); - - $package_page .= "".gettext( "Versions:" )." $v_str_arch
\n" - unless $version eq $v_str; - if (my $provided_by = $page->{provided_by}) { - note( gettext( "This is also a virtual package provided by ").join( ', ', map { "$_" } @$provided_by) ); - } - - if ($suite eq "experimental") { - note( gettext( "Experimental package"), - gettext( "Warning: This package is from the experimental distribution. That means it is likely unstable or buggy, and it may even cause data loss. If you ignore this warning and install it nevertheless, you do it on your own risk.")."". - gettext( "Users of experimental packages are encouraged to contact the package maintainers directly in case of problems." ) - ); - } - if ($subsection eq "debian-installer") { - note( gettext( "debian-installer udeb package"), - gettext( "Warning: This package is intended for the use in building debian-installer images only. Do not install it on a normal Debian system." ) - ); - } - $package_page .= pdesc( $short_desc, $long_desc ); - - # - # display dependencies - # - my $dep_list; - $dep_list = print_deps( \%packages, \%opts, $pkg, - $page->get_dep_field('depends'), - 'depends' ); - $dep_list .= print_deps( \%packages, \%opts, $pkg, - $page->get_dep_field('recommends'), - 'recommends' ); - $dep_list .= print_deps( \%packages, \%opts, $pkg, - $page->get_dep_field('suggests'), - 'suggests' ); - - if ( $dep_list ) { - $package_page .= "
\n"; - $package_page .= sprintf( "\n"; - } - - # - # Download package - # - my $encodedpack = uri_escape( $pkg ); - $package_page .= "".gettext( "Other Packages Related to %s" )."
\n", $pkg ); - if ($suite eq "experimental") { - note( gettext( "Note that the \"experimental\" distribution is not self-contained; missing dependencies are likely found in the \"unstable\" distribution." ) ); - } - - $package_page .= pdeplegend( [ 'dep', gettext( 'depends' ) ], - [ 'rec', gettext( 'recommends' ) ], - [ 'sug', gettext( 'suggests' ) ], ); - - $package_page .= $dep_list; - $package_page .= ""; - $package_page .= sprintf( "\n"; - - # - # more information - # - $package_page .= pmoreinfo( name => $pkg, data => $page, - opts => \%opts, - env => \%FTP_SITES, - bugreports => 1, sourcedownload => 1, - changesandcopy => 1, maintainers => 1, - search => 1 ); - } else { # unless $page->is_virtual - $short_desc = gettext( "virtual package" ); - - my %all_suites; - 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"}++; - } - } - foreach (suites_sort(keys %all_suites)) { - if (("$suite/$archive" eq $_) - || (!$all_suites{"$suite/$archive"} && ($suite eq $_))) { - $package_page .= "[ $_ ] "; - } else { - $package_page .= - "[ $_ ] "; - } - } - $package_page .= '".gettext( "Download %s\n" )."
", - $pkg ) ; - $package_page .= "\n"; - $package_page .= "
\n"; - $package_page .= "".gettext("Download for all available architectures")." \n"; - $package_page .= "\n"; - $package_page .= " \n"; - foreach my $a ( @archs ) { - $package_page .= "".gettext("Architecture")." ".gettext("Files")." ".gettext( "Package Size")." ".gettext("Installed Size")." \n"; - $package_page .= " "; - } - $package_page .= "$a \n"; - $package_page .= ""; - if ( $suite ne "experimental" ) { - $package_page .= sprintf( "[".gettext( "list of files" )."]\n", - "$ROOT/$suite/$encodedpkg/$a/filelist", $pkg ); - } else { - $package_page .= gettext( "no current information" ); - } - $package_page .= " \n"; #FIXME: css - $package_page .= floor(($sizes_deb->{$a}/102.4)+0.5)/10 . " kB"; - $package_page .= " \n"; #FIXME: css - $package_page .= $sizes_inst->{$a} . " kB"; - $package_page .= " \n
'; - $package_page .= simple_menu( [ gettext( "Distribution:" ), - gettext( "Overview over this distribution" ), - "$ROOT/", - $suite ], - [ gettext( "Section:" ), - gettext( "All packages in this section" ), - "$ROOT/$suite/virtual/", - - 'virtual' ], ); - - $package_page .= title( sprintf( gettext( "Virtual Package: %s" ), - $pkg ) ); - - my $policy_url = 'http://www.debian.org/doc/debian-policy/'; - note( sprintf( gettext( "This is a virtual package. See the Debian policy for a definition of virtual packages." ), - $policy_url, $policy_url )); - - $package_page .= sprintf( "".gettext( "Packages providing %s" )."
", $pkg ); - my $provided_by = $page->{provided_by}; - $package_page .= pkg_list( \%packages, \%opts, $provided_by, 'en'); - - } # else (unless $page->is_virtual) - } # else (unless @results) - } # else (unless (@results || @non_results )) - } else { - read_src_entry_all( \%sources, $pkg, \@results, \@non_results, \%opts ); - - unless (@results || @non_results ) { - fatal_error( "No such package". - "{insert link to search page with substring search}" ); - } else { - unless (@results) { - fatal_error( "Package not available in this suite" ); - } else { - for my $entry (@results) { - debug( join(":", @$entry), 1 ); - my (undef, $archive, undef, $section, $subsection, - $priority, $version) = @$entry; - - my $data = $sources_all{"$archive $suite $pkg"}; - $page->merge_data($pkg, $suite, $archive, $data) or debug( "Merging $pkg $version FAILED", 2 ); - } - $version = $page->{version}; - - my $st1 = new Benchmark; - my $std = timediff($st1, $st0); - debug( "Data search and merging took ".timestr($std) ); - - my $encodedpkg = uri_escape( $pkg ); - my ($v_str, $v_str_arr) = $page->get_version_string(); - $archive = $page->get_newest( 'archive' ); - $section = $page->get_newest( 'section' ); - $subsection = $page->get_newest( 'subsection' ); - - my %all_suites; - 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"}++; - } - } - foreach (suites_sort(keys %all_suites)) { - if (("$suite/$archive" eq $_) - || (!$all_suites{"$suite/$archive"} && ($suite eq $_))) { - $package_page .= "[ $_ ] "; - } else { - $package_page .= - "[ $_ ] "; - } - } - $package_page .= '
'; - - $package_page .= simple_menu( [ gettext( "Distribution:" ), - gettext( "Overview over this suite" ), - "/$suite/", - $suite ], - [ gettext( "Section:" ), - gettext( "All packages in this section" ), - "/$suite/$subsection/", - $subsection ], - ); - - my $title .= sprintf( gettext( "Source Package: %s (%s)" ), - $pkg, $v_str ); - $title .= " ".marker( $archive ) if $archive ne 'us'; - $title .= " ".marker( $subsection ) if $subsection eq 'non-US' - and $archive ne 'non-US'; # non-US/security - $title .= " ".marker( $section ) if $section ne 'main'; - $package_page .= title( $title ); - - if ($suite eq "experimental") { - $package_page .= note( gettext( "Experimental package"), - gettext( "Warning: This package is from the experimental distribution. That means it is likely unstable or buggy, and it may even cause data loss. If you ignore this warning and install it nevertheless, you do it on your own risk.")."". - gettext( "Users of experimental packages are encouraged to contact the package maintainers directly in case of problems." ) - ); - } - if ($subsection eq "debian-installer") { - note( gettext( "debian-installer udeb package"), - gettext( "Warning: This package is intended for the use in building debian-installer images only. Do not install it on a normal Debian system." ) - ); - } - - my $binaries = find_binaries( $pkg, $archive, $suite, \%src2bin ); - if ($binaries && @$binaries) { - $package_page .= '
'; - $package_page .= gettext( "The following binary packages are built from this source package:" ); - $package_page .= pkg_list( \%packages, \%opts, $binaries, 'en' ); - $package_page .= ''; - } - - # - # display dependencies - # - my $dep_list; - $dep_list = print_src_deps( \%packages, \%opts, $pkg, - $page->get_dep_field('build-depends'), - 'build-depends' ); - $dep_list .= print_src_deps( \%packages, \%opts, $pkg, - $page->get_dep_field('build-depends-indep'), - 'build-depends-indep' ); - - if ( $dep_list ) { - $package_page .= "\n"; - $package_page .= sprintf( "\n"; - } - - # - # Source package download - # - $package_page .= "".gettext( "Other Packages Related to %s" )."
\n", $pkg ); - if ($suite eq "experimental") { - note( gettext( "Note that the \"experimental\" distribution is not self-contained; missing dependencies are likely found in the \"unstable\" distribution." ) ); - } - - $package_page .= pdeplegend( [ 'adep', gettext( 'build-depends' ) ], - [ 'idep', gettext( 'build-depends-indep' ) ], - ); - - $package_page .= $dep_list; - $package_page .= "\n"; - my $encodedpack = uri_escape( $pkg ); - $package_page .= sprintf( "\n"; - - # - # more information - # - $package_page .= pmoreinfo( name => $pkg, data => $page, - opts => \%opts, - env => \%FTP_SITES, - bugreports => 1, - changesandcopy => 1, maintainers => 1, - search => 1, is_source => 1 ); - } - } - } -} - -use Data::Dumper; -debug( "Final page object:\n".Dumper($page), 3 ); - -my $title = $opts{source} ? - "Details of source package $pkg in $suite" : - "Details of package $pkg in $suite" ; -my $title_tag = $opts{source} ? - "Details of source package $pkg in $suite" : - "Details of package $pkg in $suite" ; -print Packages::HTML::header( title => $title , - lang => 'en', - desc => $short_desc, - keywords => "$suite, $archive, $section, $subsection, $version", - title_tag => "Details of package $pkg in $suite", - ); - -print_errors(); -print_hints(); -print_msgs(); -print_debug(); -print_notes(); - -unless (@Packages::CGI::fatal_errors) { - print $package_page; -} -my $tet1 = new Benchmark; -my $tetd = timediff($tet1, $tet0); -print "Total page evaluation took ".timestr($tetd)."".gettext( "Download %s" )."
\n", - $pkg ) ; - - my $source_files = $page->get_src( 'files' ); - my $source_dir = $page->get_src( 'directory' ); - - $package_page .= sprintf( "\n" - ."
\n"; - $package_page .= "%s %s %s ", - gettext("File"), - gettext("Size (in kB)"), - gettext("md5sum") ); - 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}; - } - $src_url .= "/$source_dir/$src_file_name"; - - $package_page .= ""; - } - $package_page .= " $src_file_name \n" - ."".sprintf("%.1f", (floor(($src_file_size/102.4)+0.5)/10))." \n" - ."$src_file_md5
" - if $debug_allowed; - -my $trailer = Packages::HTML::trailer( $ROOT ); -$trailer =~ s/LAST_MODIFIED_DATE/gmtime()/e; #FIXME -print $trailer; - -# vim: ts=8 sw=4 -- 2.39.2