* complete virtual package support
authorFrank Lichtenheld <frank@lichtenheld.de>
Fri, 10 Feb 2006 02:13:18 +0000 (02:13 +0000)
committerFrank Lichtenheld <frank@lichtenheld.de>
Fri, 10 Feb 2006 02:13:18 +0000 (02:13 +0000)
* hardcode encoding of script output to be declared as utf-8 for now, better
  than the CGI.pm default of ISO-8859-1

bin/create_index_pages
bin/parse-packages
cgi-bin/search_packages.pl
cgi-bin/show_package.pl
lib/Packages/CGI.pm
lib/Packages/Page.pm
lib/Packages/Search.pm

index 4161a7654761acd9bce6d932948eaf455f5e6079..11849bce7a745fff257db4d0520a00fa1fabda27 100755 (executable)
@@ -110,6 +110,7 @@ my %sections_descs = (
 
 my (%pages);
 
+print "opening files ...\n";
 foreach my $s (@SUITES) {
     foreach my $a (@ARCHIVES) {
        next if $a eq 'security';
@@ -149,7 +150,7 @@ foreach my $s (@SUITES) {
            title( $title ), '<dl>';
        }
        my $i = 0; my $num_sections = keys %{$subsections->{$s}{$a}};
-       foreach my $ssec (keys %{$subsections->{$s}{$a}}) {
+       foreach my $ssec ((keys %{$subsections->{$s}{$a}}, 'virtual')) {
            next if $ssec eq '-';
            mkpath ( "$wwwdir/$key/$ssec" );
            open $pages{$key}{$ssec}{fh}, '>', "$wwwdir/$key/$ssec/index.en.html.new"
@@ -186,6 +187,7 @@ foreach my $s (@SUITES) {
     }
 }
 
+print "writing package info ...\n";
 while (my ($pkg, $data) = each %packages) {
     my %pkg;
     foreach (split /\000/o, $data) {
@@ -195,17 +197,30 @@ while (my ($pkg, $data) = each %packages) {
            $key = "$data[1]/$data[0]";
        }
        $pkg{$key} ||= new Packages::Page( $pkg );
-       $pkg{$key}->merge_package( { package => $pkg,
-                                    archive => $data[0],
-                                    suite => $data[1],
-                                    architecture => $data[2],
-                                    section => $data[3],
-                                    subsection => $data[4],
-                                    priority => $data[5],
-                                    version => $data[6],
-                                    description => $data[7] } );
+       if ($data[2] ne 'virtual') {
+           $pkg{$key}->merge_package( { package => $pkg,
+                                        archive => $data[0],
+                                        suite => $data[1],
+                                        architecture => $data[2],
+                                        section => $data[3],
+                                        subsection => $data[4],
+                                        priority => $data[5],
+                                        version => $data[6],
+                                        description => $data[7] } );
+       } else {
+           $pkg{$key}->add_provided_by([split /\s+/, $data[7]]);
+       }
     }
     while (my ($key, $entry) = each %pkg) {
+       if (my $provided_by = $entry->{provided_by}) {
+           my $str = "<dt><a href=\"$pkg\">$pkg</a> ".
+               "</dt>\n     <dd>virtual package provided by ".
+               join( ', ',map { "<a href=\"../$_\">$_</a>" } @$provided_by)."</dd>\n";
+           my $txt_str = "$pkg\tvirtual package provided by ".join(', ', @$provided_by)."\n";
+           print {$pages{$key}{virtual}{fh}} $str
+               or die "couldn't write to output file: $!";
+       }
+       next if $entry->is_virtual;
        my (undef, $v_str) = $entry->get_version_string;
        my $subsection = $entry->get_newest( 'subsection' );
        my $section = $entry->get_newest( 'section' );
@@ -241,6 +256,7 @@ while (my ($pkg, $data) = each %packages) {
     }
 }
 
+print "closing files ...\n";
 foreach my $s (@SUITES) {
     foreach my $a (@ARCHIVES) {
        next if $a eq 'security';
@@ -268,7 +284,7 @@ foreach my $s (@SUITES) {
            rename( "$wwwdir/$key/$sec/index.en.html.new",
                    "$wwwdir/$key/$sec/index.en.html" );
        }
-       foreach my $ssec (keys %{$subsections->{$s}{$a}}) {
+       foreach my $ssec ((keys %{$subsections->{$s}{$a}}, 'virtual')) {
            next if $ssec eq '-';
            print {$pages{$key}{$ssec}{fh}} '</dl>', trailer( "$root../../" );
            close $pages{$key}{$ssec}{fh} or
index 7de51b6e89d0780a0d2186051976046cfb62528c..38c83e988fbfcc8e890d44a30bbe47b5030c5708 100755 (executable)
@@ -130,7 +130,7 @@ for my $archive (@ARCHIVES) {
 
        foreach (keys %virtual_packages) {
            my @provided_by = keys %{$virtual_packages{$_}};
-           $packages_small{$_} .= "$archive $suite virtual - - - - @provided_by\000";
+           $packages_small{$_} .= "$archive $suite virtual v v v v @provided_by\000";
        }
 
        untie %packages_all_db;
index 35729156a5011cba138fb90c3f01997fdf75bdac..e7cb3b6ad32c358166aaa19fd2013ccdc112fd4c 100755 (executable)
@@ -113,7 +113,7 @@ 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;
+    print $input->header( -charset => 'utf-8' );
 }
 
 if ($params{errors}{keywords}) {
index 2ec4616d548512a01d733b6352673ffaf6364ffc..f51110dea9789d6f1a181e443607f09aa1a229ef 100755 (executable)
@@ -102,7 +102,7 @@ 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;
+    print $input->header( -charset => 'utf-8' );
 }
 
 if ($params{errors}{package}) {
@@ -154,7 +154,7 @@ unless (@Packages::CGI::fatal_errors) {
                for my $entry (@results) {
                    debug( join(":", @$entry), 1 );
                    my (undef, $archive, undef, $arch, $section, $subsection,
-                       $priority, $version, @provided_by) = @$entry;
+                       $priority, $version, $provided_by) = @$entry;
                    
                    if ($arch ne 'virtual') {
                        my %data = split /\000/, $packages_all{"$pkg $arch $version"};
@@ -163,174 +163,223 @@ unless (@Packages::CGI::fatal_errors) {
                        $data{version} = $version;
                        $page->merge_package(\%data) or debug( "Merging $pkg $arch $version FAILED", 2 );
                    } else {
-                       $page->add_provided_by(\@provided_by);
+                       $page->add_provided_by([split /\s+/, $provided_by]);
                    }
                }
-
-               $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~-]+?/?)((\&gt\;)?[)]?[']?[:.\,]?(\s|$)),<a href=\"$1\">$1</a>$3,go; # syntax highlighting -> '];
-               $long_desc =~ s/\A //o;
-               $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;
+               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~-]+?/?)((\&gt\;)?[)]?[']?[:.\,]?(\s|$)),<a href=\"$1\">$1</a>$3,go; # syntax highlighting -> '];
+                   $long_desc =~ s/\A //o;
+                   $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 );
 
-               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"}++;
+                   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/$_/".uri_escape($pkg)."\">$_</a> ] ";
-                   }
-               }
-               $package_page .= '<br>';
-
-               $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 .= "<h2>".gettext( "Versions:" )." $v_str_arch</h2>\n" 
-                   unless $version eq $v_str;
-               
-               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." )
-                         );
-               }
-               $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 .= "<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." ) );
+                   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/$_/".uri_escape($pkg)."\">$_</a> ] ";
+                       }
                    }
+                   $package_page .= '<br>';
+
+                   $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 .= pdeplegend( [ 'dep',  gettext( 'depends' ) ],
-                                                [ 'rec',  gettext( 'recommends' ) ],
-                                                [ 'sug',  gettext( 'suggests' ) ], );
+                   $package_page .= "<h2>".gettext( "Versions:" )." $v_str_arch</h2>\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 { "<a href=\"$ROOT/$suite/$_\">$_</a>"  } @$provided_by) );
+                   }
                    
-                   $package_page .= $dep_list;
-                   $package_page .= "</div> <!-- end pdeps -->\n";
-               }
+                   if ($suite eq "experimental") {
+                       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." )
+                             );
+                   }
+                   $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 .= "<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( [ 'dep',  gettext( 'depends' ) ],
+                                                    [ 'rec',  gettext( 'recommends' ) ],
+                                                    [ 'sug',  gettext( 'suggests' ) ], );
+                       
+                       $package_page .= $dep_list;
+                       $package_page .= "</div> <!-- end pdeps -->\n";
+                   }
 
-               #
-               # Download package
-               #
-               my $encodedpack = uri_escape( $pkg );
-               $package_page .= "<div id=\"pdownload\">";
-               $package_page .= sprintf( "<h2>".gettext( "Download %s\n" )."</h2>",
-                                         $pkg ) ;
-               $package_page .= "<table border=\"1\" summary=\"".gettext("The download table links to the download of the package and a file overview. In addition it gives information about the package size and the installed size.")."\">\n";
-               $package_page .= "<caption class=\"hidecss\">".gettext("Download for all available architectures")."</caption>\n";
-               $package_page .= "<tr>\n";
-               $package_page .= "<th>".gettext("Architecture")."</th><th>".gettext("Files")."</th><th>".gettext( "Package Size")."</th><th>".gettext("Installed Size")."</th></tr>\n";
-               foreach my $a ( @archs ) {
+                   #
+                   # Download package
+                   #
+                   my $encodedpack = uri_escape( $pkg );
+                   $package_page .= "<div id=\"pdownload\">";
+                   $package_page .= sprintf( "<h2>".gettext( "Download %s\n" )."</h2>",
+                                             $pkg ) ;
+                   $package_page .= "<table border=\"1\" summary=\"".gettext("The download table links to the download of the package and a file overview. In addition it gives information about the package size and the installed size.")."\">\n";
+                   $package_page .= "<caption class=\"hidecss\">".gettext("Download for all available architectures")."</caption>\n";
                    $package_page .= "<tr>\n";
-                   $package_page .=  "<th><a href=\"$ROOT/$suite/$encodedpkg/$a/download";
-                   $package_page .=  "\">$a</a></th>\n";
-                   $package_page .= "<td>";
-                   if ( $suite ne "experimental" ) {
-                       $package_page .= sprintf( "[<a href=\"%s\">".gettext( "list of files" )."</a>]\n",
-                           "$ROOT/$suite/$encodedpkg/$a/filelist", $pkg );
-                   } else {
-                       $package_page .= gettext( "no current information" );
+                   $package_page .= "<th>".gettext("Architecture")."</th><th>".gettext("Files")."</th><th>".gettext( "Package Size")."</th><th>".gettext("Installed Size")."</th></tr>\n";
+                   foreach my $a ( @archs ) {
+                       $package_page .= "<tr>\n";
+                       $package_page .=  "<th><a href=\"$ROOT/$suite/$encodedpkg/$a/download";
+                       $package_page .=  "\">$a</a></th>\n";
+                       $package_page .= "<td>";
+                       if ( $suite ne "experimental" ) {
+                           $package_page .= sprintf( "[<a href=\"%s\">".gettext( "list of files" )."</a>]\n",
+                                                     "$ROOT/$suite/$encodedpkg/$a/filelist", $pkg );
+                       } else {
+                           $package_page .= gettext( "no current information" );
+                       }
+                       $package_page .= "</td>\n<td align=right>"; #FIXME: css
+                       $package_page .=  floor(($sizes_deb->{$a}/102.4)+0.5)/10 . "&nbsp;kB";
+                       $package_page .= "</td>\n<td align=right>"; #FIXME: css
+                       $package_page .=  $sizes_inst->{$a} . "&nbsp;kB";
+                       $package_page .= "</td>\n</tr>";
                    }
-                   $package_page .= "</td>\n<td align=right>"; #FIXME: css
-                   $package_page .=  floor(($sizes_deb->{$a}/102.4)+0.5)/10 . "&nbsp;kB";
-                   $package_page .= "</td>\n<td align=right>"; #FIXME: css
-                   $package_page .=  $sizes_inst->{$a} . "&nbsp;kB";
-                   $package_page .= "</td>\n</tr>";
-               }
-               $package_page .= "</table>\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 );
-           }
-       }
+                   $package_page .= "</table>\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 { # 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 .= "[ <strong>$_</strong> ] ";
+                       } else {
+                           $package_page .=
+                               "[ <a href=\"$ROOT/$_/".uri_escape($pkg)."\">$_</a> ] ";
+                       }
+                   }
+                   $package_page .= '<br>';
+                   $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 <em>virtual package</em>. See the <a href=\"%s\">Debian policy</a> for a <a href=\"%sch-binary.html#s-virtual_pkg\">definition of virtual packages</a>." ),
+                                  $policy_url, $policy_url ));
+
+                   $package_page .= sprintf( "<h2>".gettext( "Packages providing %s" )."</h2>",                              $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 );
 
index b2b261db705b7c009b9cb62c2534b2c3ed4039a7..d9aceeb35eafd2dd627e503774b65caa60e0578b 100644 (file)
@@ -31,9 +31,6 @@ sub msg {
     push @msgs, $_[0];
 }
 sub note {
-    push @notes, $_[0];
-}
-sub notes {
     push @notes, [ @_ ];
 }
 sub print_errors {
@@ -69,15 +66,14 @@ sub print_msgs {
 sub print_notes {
     foreach (@notes) {
        my ( $title, $note ) = @$_;
-       my $str = "";
 
+       print '<div style="border: solid thin black; background-color: #ccf">';
        if ($note) {
-           $str .= "<h2 class=\"pred\">$title</h2>";
+           print "<h2 class=\"pred\">$title</h2>";
        } else {
            $note = $title;
        }
-       $str .= "<p>$note</p>";
-       return $str;
+       print "<p>$note</p></div>";
     }
 }
 
index e550fcc372556e7ffc7bb49ec63d1e437eaf77a4..c77d8facee9f2c358517a179507dbcbe4b2e1227 100644 (file)
@@ -88,7 +88,7 @@ sub add_provided_by {
     push @{$self->{provided_by}}, @$provided_by;
 }
 
-sub is_virutal {
+sub is_virtual {
     my ($self) = @_;
 
     return (exists($self->{provided_by}) && !exists($self->{versions}));
index b616f6f213de0b23392632af6b1be19ae4158810..64fa295d29498f8ef2071742478591c2855b0a88 100644 (file)
@@ -348,7 +348,7 @@ sub read_entry_all {
        if ($opts->{h_archives}{$data[0]} && $opts->{h_suites}{$data[1]}
            && ($opts->{h_archs}{$data[2]} || $data[2] eq 'all'
                || $data[2] eq 'virtual')
-           && ($opts->{h_sections}{$data[3]} || $data[3] eq '-')) {
+           && ($opts->{h_sections}{$data[3]} || $data[3] eq 'v')) {
            debug( "Using entry ".join( ':', @data), 2);
            push @$results, [ $key, @data ];
        } else {