+ $package_page .= "</table><p>".gettext ( "Size is measured in kBytes." )."</p>\n";
+ $package_page .= "</div> <!-- end pdownload -->\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 {
+ 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{"$pkg $version"};
+ $page->merge_data($pkg, $version, $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 .= "[ <strong>$_</strong> ] ";
+ } else {
+ $package_page .=
+ "[ <a href=\"$ROOT/$_/source/".uri_escape($pkg)."\">$_</a> ] ";
+ }
+ }
+ $package_page .= '<br>';
+
+ $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 <span class=\"pred\">experimental</span> 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.")."</p><p>".
+ 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 <a href=\"http://www.debian.org/devel/debian-installer\">debian-installer</a> images only. Do not install it on a normal Debian system." )
+ );
+ }
+
+ my $binaries = find_binaries( $pkg, $archive, $suite, \%src2bin );
+ if ($binaries && @$binaries) {
+ $package_page .= '<div class="pdesc">';
+ $package_page .= gettext( "The following binary packages are built from this source package:" );
+ $package_page .= pkg_list( \%packages, \%opts, $binaries, 'en' );
+ $package_page .= '</div> <!-- end pdesc -->';
+ }
+
+ #
+ # 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 .= "<div id=\"pdeps\">\n";
+ $package_page .= sprintf( "<h2>".gettext( "Other Packages Related to %s" )."</h2>\n", $pkg );
+ if ($suite eq "experimental") {
+ note( gettext( "Note that the \"<span class=\"pred\">experimental</span>\" distribution is not self-contained; missing dependencies are likely found in the \"<a href=\"/unstable/\">unstable</a>\" distribution." ) );
+ }
+
+ $package_page .= pdeplegend( [ 'adep', gettext( 'build-depends' ) ],
+ [ 'idep', gettext( 'build-depends-indep' ) ],
+ );
+
+ $package_page .= $dep_list;
+ $package_page .= "</div> <!-- end pdeps -->\n";
+ }
+
+ #
+ # Source package download
+ #
+ $package_page .= "<div id=\"pdownload\">\n";
+ my $encodedpack = uri_escape( $pkg );
+ $package_page .= sprintf( "<h2>".gettext( "Download %s" )."</h2>\n",
+ $pkg ) ;
+
+ my $source_files = $page->get_src( 'files' );
+ my $source_dir = $page->get_src( 'directory' );
+
+ $package_page .= sprintf( "<table cellspacing=\"0\" cellpadding=\"2\" summary=\"Download information for the files of this source package\">\n"
+ ."<tr><th>%s</th><th>%s</th><th>%s</th>",
+ gettext("File"),
+ gettext("Size (in kB)"),
+ gettext("md5sum") );
+ foreach( @$source_files ) {
+ my ($src_file_md5, $src_file_size, $src_file_name) = @$_;
+ 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 .= "<tr><td><a href=\"$src_url\">$src_file_name</a></td>\n"
+ ."<td class=\"dotalign\">".sprintf("%.1f", (floor(($src_file_size/102.4)+0.5)/10))."</td>\n"
+ ."<td>$src_file_md5</td></tr>";