]> git.deb.at Git - deb/packages.git/commitdiff
Move version info to arch table (only when there are actually multiple
authorJeroen van Wolffelaar <jeroen@wolffelaar.nl>
Wed, 22 Feb 2006 02:27:38 +0000 (02:27 +0000)
committerJeroen van Wolffelaar <jeroen@wolffelaar.nl>
Wed, 22 Feb 2006 02:27:38 +0000 (02:27 +0000)
versions), making looks at the top a bit more clearer

lib/Packages/DoShow.pm
lib/Packages/Page.pm
lib/Packages/SrcPage.pm

index 3070f1b85f7f0de6feee0c1559f4304c5d36c516..6efef581f101eb2da6f4de28e7079dbba5be187a 100644 (file)
@@ -125,13 +125,13 @@ sub do_show {
                        my $std = timediff($st1, $st0);
                        debug( "Data search and merging took ".timestr($std) );
 
-                       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 $versions = $page->get_arch_field( 'version' );
                        my $sizes_inst = $page->get_arch_field( 'installed-size' );
                        my $sizes_deb = $page->get_arch_field( 'size' );
                        my @archs = sort $page->get_architectures;
@@ -161,6 +161,9 @@ sub do_show {
                                                 $subsection ],
                                               );
 
+                       my $v_str = $version;
+                       my $multiple_versions = grep { $_ ne $version } values %$versions;
+                       $v_str .= " (and others)" if $multiple_versions;
                        my $title .= sprintf( _g( "Package: %s (%s)" ), $pkg, $v_str );
                        $title .=  " ".marker( $archive ) if $archive ne 'us';
                        $title .=  " ".marker( $subsection ) if $subsection eq 'non-US'
@@ -168,8 +171,6 @@ sub do_show {
                        $title .=  " ".marker( $section ) if $section ne 'main';
                        $package_page .= title( $title );
                        
-                       $package_page .= "<h2>"._g( "Versions:" )." $v_str_arch</h2>\n" 
-                           unless $version eq $v_str;
                        if (my $provided_by = $page->{provided_by}) {
                            note( _g( "This is also a virtual package provided by ").join( ', ', map { "<a href=\"$ROOT/$suite/$_\">$_</a>"  } @$provided_by) );
                        }
@@ -225,11 +226,16 @@ sub do_show {
                        $package_page .= "<table summary=\""._g("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\">"._g("Download for all available architectures")."</caption>\n";
                        $package_page .= "<tr>\n";
-                       $package_page .= "<th>"._g("Architecture")."</th><th>"._g("Files")."</th><th>"._g( "Package Size")."</th><th>"._g("Installed Size")."</th></tr>\n";
+                       $package_page .= "<th>"._g("Architecture")."</th>";
+                       $package_page .= "<th>"._g("Version")."</th>"
+                           if $multiple_versions;
+                       $package_page .= "<th>"._g("Files")."</th><th>"._g( "Package Size")."</th><th>"._g("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>".$versions->{$a}."</td>"
+                               if $multiple_versions;
                            $package_page .= "<td>";
                            if ( $suite ne "experimental" ) {
                                $package_page .= sprintf( "[<a href=\"%s\">"._g( "list of files" )."</a>]\n",
@@ -296,7 +302,6 @@ sub do_show {
                    my $std = timediff($st1, $st0);
                    debug( "Data search and merging took ".timestr($std) );
 
-                   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' );
@@ -312,7 +317,7 @@ sub do_show {
                                           );
                    
                    my $title .= sprintf( _g( "Source Package: %s (%s)" ),
-                                         $pkg, $v_str );
+                                         $pkg, $version );
                    $title .=  " ".marker( $archive ) if $archive ne 'us';
                    $title .=  " ".marker( $subsection ) if $subsection eq 'non-US'
                        and $archive ne 'non-US'; # non-US/security
index 201408fb5c9484fdfd77e6c299aff48c16f1d4b2..c2aff059ff468ac324fb00e6ae98c4ba4d188bff 100644 (file)
@@ -212,42 +212,6 @@ sub get_arch_field {
     return \%result;
 }
 
-sub get_versions {
-    my ($self) = @_;
-
-    my %versions;
-    foreach (keys %{$self->{versions}}) {
-       my $version = $self->{versions}{$_}{version};
-       $versions{$version} ||= [];
-       push @{$versions{$version}}, $_;
-    }
-
-    return \%versions;
-}
-
-sub get_version_string {
-    my ($self) = @_;
-
-    my $versions = $self->get_versions;
-    my @versions = version_sort keys %$versions;
-    my (@v_str, $v_str, $v_str_arch);
-    if ( scalar @versions == 1 ) {
-       @v_str = ( [ $versions[0], undef ] );
-       $v_str = $versions[0];
-       $v_str_arch = $versions[0];
-    } else {
-       my @v_str_arch;
-       foreach ( @versions ) {
-           push @v_str, [ $_, $versions->{$_} ];
-           push @v_str_arch, "$_ [".join(', ', @{$versions->{$_}})."]";
-       }
-       $v_str_arch = join( ", ", @v_str_arch );
-       $v_str = join( ", ",  @versions );
-    }
-
-    return ($v_str, $v_str_arch, \@v_str);
-}
-
 sub get_dep_field {
     my ($self, $dep_field) = @_;
 
index 6d03ff20ca7731de0da7123341b327679626dbe5..3d513d77cedbf5b861e4693be7e2b00c9e0dae11 100644 (file)
@@ -93,20 +93,6 @@ sub get_arch_field {
     return $self->{data}{$field};
 }
 
-sub get_versions {
-    my ($self) = @_;
-
-    return [ $self->{version} ];
-}
-
-sub get_version_string {
-    my ($self) = @_;
-
-    my $versions = $self->get_versions;
-
-    return ($self->{version}, $versions);
-}
-
 sub get_dep_field {
     my ($self, $dep_field) = @_;