]> git.deb.at Git - deb/packages.git/blobdiff - lib/Packages/DoShow.pm
Import marker from Packages::HTML where used
[deb/packages.git] / lib / Packages / DoShow.pm
index b7dfa31e3264d1c8a8bb6d26d9e4ac8867019450..58ed635572ee7ccaa7c7ada0a65f0a6c6b658bb8 100644 (file)
@@ -6,7 +6,7 @@ use POSIX;
 use URI::Escape;
 use HTML::Entities;
 use DB_File;
-use Benchmark;
+use Benchmark ':hireswallclock';
 use Exporter;
 
 use Deb::Versions;
@@ -15,7 +15,7 @@ use Packages::Config qw( $DBDIR $ROOT @SUITES @ARCHIVES @SECTIONS
 use Packages::CGI;
 use Packages::DB;
 use Packages::Search qw( :all );
-use Packages::HTML;
+use Packages::HTML qw(marker);
 use Packages::Page ();
 use Packages::SrcPage ();
 
@@ -177,7 +177,7 @@ sub do_show {
                        
                        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( "Warning: This package is from the <strong>experimental</strong> 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." )
                                  );
                        }
@@ -206,7 +206,7 @@ sub do_show {
                            $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." ) );
+                               note( gettext( "Note that the <strong>experimental</strong> distribution is not self-contained; missing dependencies are likely found in the <a href=\"/unstable/\">unstable</a> distribution." ) );
                            }
                            
                            $package_page .= pdeplegend( [ 'dep',  gettext( 'depends' ) ],
@@ -224,7 +224,7 @@ sub do_show {
                        $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 .= "<table 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";
@@ -239,9 +239,9 @@ sub do_show {
                            } else {
                                $package_page .= gettext( "no current information" );
                            }
-                           $package_page .= "</td>\n<td align=right>"; #FIXME: css
+                           $package_page .= '</td><td class="size">';
                            $package_page .=  floor(($sizes_deb->{$a}/102.4)+0.5)/10 . "&nbsp;kB";
-                           $package_page .= "</td>\n<td align=right>"; #FIXME: css
+                           $package_page .= '</td><td class="size">';
                            $package_page .=  $sizes_inst->{$a} . "&nbsp;kB";
                            $package_page .= "</td>\n</tr>";
                        }
@@ -345,12 +345,12 @@ sub do_show {
                    # 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' );
+                   $dep_list = print_deps( \%packages, $opts, $pkg,
+                                           $page->get_dep_field('build-depends'),
+                                           'build-depends' );
+                   $dep_list .= print_deps( \%packages, $opts, $pkg,
+                                            $page->get_dep_field('build-depends-indep'),
+                                            'build-depends-indep' );
 
                    if ( $dep_list ) {
                        $package_page .= "<div id=\"pdeps\">\n";
@@ -377,7 +377,7 @@ sub do_show {
                    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"
+                   $package_page .= sprintf( "<table 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)"),
@@ -400,8 +400,8 @@ sub do_show {
                        $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>";
+                           ."<td>".sprintf("%.1f", (floor(($src_file_size/102.4)+0.5)/10))."</td>\n"
+                           ."<td class=\"md5sum\">$src_file_md5</td></tr>";
                    }
                    $package_page .= "</table>\n";
                    $package_page .= "</div> <!-- end pdownload -->\n";
@@ -438,7 +438,7 @@ sub do_show {
                      print_search_field => 'packages',
                      search_field_values => { 
                          keywords => '',
-                         searchon => 'names',
+                         searchon => $opts->{source} ? 'sourcenames' : 'names',
                          arch => 'any',
                          suite => 'all',
                          section => 'all',