+ $archs{$arch}++ unless $arch eq 'all';
+ }
+ next unless keys %pkgs;
+ $results{$file} = \%pkgs;
+ }
+ my @all_archs = keys %archs;
+ debug( "all_archs = @all_archs", 1 ) if DEBUG;
+
+ $$page_content .= "<p>".sprintf( _g( 'Found %s results' ),
+ scalar @results )."</p>";
+ $$page_content .= '<div
+ id="pcontentsres"><table><colgroup><col><col></colgroup><tr><th>'._g('File').'</th><th>'._g('Packages')
+ .'</th></tr>';
+ foreach my $file (sort keys %results) {
+ $$page_content .= "<tr><td class=\"file\">/$file</td><td>";
+ my @pkgs;
+ foreach my $pkg (sort keys %{$results{$file}}) {
+ my $arch_str = '';
+ my @archs = keys %{$results{$file}{$pkg}};
+ unless ($results{$file}{$pkg}{all} ||
+ (@archs == @all_archs)) {
+ if (@archs < @all_archs/2) {
+ $arch_str = ' ['.join(' ',sort @archs).']';
+ } else {
+ $arch_str = ' ['._g('not').' '.
+ join(' ', grep { !$results{$file}{$pkg}{$_} } @all_archs).']';
+ }
+ }
+ push @pkgs, "<a href=\"$ROOT/$suite/$pkg\">$pkg</a>$arch_str";