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',
);
}
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}";
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 );
$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;