]> git.deb.at Git - deb/packages.git/blobdiff - lib/Packages/DoIndex.pm
Fix some minor issues
[deb/packages.git] / lib / Packages / DoIndex.pm
index 3e6041d26d03a735459e3e59301ccd58333a99b4..8ca34f5a0097a2a235be92465f0260a1441dce26 100644 (file)
@@ -12,10 +12,17 @@ use Packages::I18N::Locale;
 use Packages::CGI;
 
 our @ISA = qw( Exporter );
-our @EXPORT = qw( do_index );
+our @EXPORT = qw( do_index do_allpackages );
 
 sub do_index {
-    my ($params, $opts, $html_header) = @_;
+    return send_file( 'index', @_ );
+}
+sub do_allpackages {
+    return send_file( 'allpackages', @_ );
+}
+
+sub send_file {
+    my ($file, $params, $opts, $html_header) = @_;
 
     if ($params->{errors}{suite}) {
        fatal_error( _g( "suite not valid or not specified" ) );
@@ -33,7 +40,7 @@ sub do_index {
     $path .= "$opts->{subsection}[0]/" if @{$opts->{subsection}};
     # we don't have translated index pages for subsections yet
     $opts->{lang} = 'en' if @{$opts->{subsection}};
-    $path .= "index.$opts->{lang}.html";
+    $path .= "$file.$opts->{lang}.$opts->{format}";
 
     unless (@Packages::CGI::fatal_errors) {
        my $buffer;
@@ -64,7 +71,7 @@ sub do_index {
                          suite => 'all',
                          section => 'all',
                          exact => 1,
-                         debug => $Packages::Search::debug,
+                         debug => $Packages::CGI::debug,
                      },
                      );
 }