X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=lib%2FPackages%2FDoIndex.pm;h=239f3301a7af582f8faf1478483224fdb63548d8;hb=c40b1514a9289273df1ae785fd938b8fa0f31183;hp=064a18ad2aa4b386c336dccc3d01af144ca25a0e;hpb=01393b020237bbfa4571d41cc98899b4d25acd8b;p=deb%2Fpackages.git diff --git a/lib/Packages/DoIndex.pm b/lib/Packages/DoIndex.pm index 064a18a..239f330 100644 --- a/lib/Packages/DoIndex.pm +++ b/lib/Packages/DoIndex.pm @@ -21,12 +21,6 @@ sub do_allpackages { return send_file( 'allpackages', @_ ); } -# no real need for more flexibility here, I think... -my %mime_types = ( - txt => 'text/plain', - 'txt.gz' => 'text/plain', - html => 'text/html', - ); my %encoding = ( 'txt.gz' => 'x-gzip', ); @@ -44,9 +38,12 @@ sub send_file { } my $wwwdir = "$TOPDIR/www"; - my $path = "$opts->{suite}[0]/"; + my $path = ""; + $path .= "source/" if $opts->{source}; + $path .= "$opts->{suite}[0]/"; $path .= "$opts->{archive}[0]/" if @{$opts->{archive}} == 1; $path .= "$opts->{subsection}[0]/" if @{$opts->{subsection}}; + $path .= "$opts->{priority}[0]/" if @{$opts->{priority}}; # we don't have translated index pages for subsections yet $opts->{lang} = 'en' if @{$opts->{subsection}} or $file eq 'allpackages'; $path .= "$file.$opts->{lang}.$opts->{format}"; @@ -56,7 +53,7 @@ sub send_file { if (open( INDEX, '<', "$wwwdir/$path" )) { my %headers; $headers{'-charset'} = get_charset( $opts->{lang} ); - $headers{'-type'} = $mime_types{$opts->{format}} || 'text/plain'; + $headers{'-type'} = get_mime( $opts->{format}, 'text/plain' ); $headers{'-content-encoding'} = $encoding{$opts->{format}} if exists $encoding{$opts->{format}}; print header( %headers ); @@ -71,21 +68,6 @@ sub send_file { $path, $! ) ); } } - - %$html_header = ( title => _g('Error'), - lang => $opts->{lang}, - print_title => 1, - print_search_field => 'packages', - search_field_values => { - keywords => _g('search for a package'), - searchon => 'default', - arch => 'any', - suite => 'all', - section => 'all', - exact => 1, - debug => $Packages::CGI::debug, - }, - ); } 1;