]> git.deb.at Git - deb/packages.git/blobdiff - lib/Packages/Dispatcher.pm
Packages::I18N::Locale: Simplify format string test regex
[deb/packages.git] / lib / Packages / Dispatcher.pm
index e9b406f0257064f3da54b0c9b23447750ceaaf00..3113683c010cf210de0f24c88162a7189df4b2e8 100755 (executable)
@@ -34,7 +34,7 @@ use I18N::AcceptLanguage;
 use Deb::Versions;
 use Packages::Config qw( $DBDIR $ROOT $TEMPLATEDIR $CACHEDIR
                         @SUITES @SECTIONS @ARCHIVES @ARCHITECTURES @PRIORITIES
-                        @LANGUAGES @DDTP_LANGUAGES $LOCALES );
+                        @LANGUAGES @DDTP_LANGUAGES );
 use Packages::CGI qw( :DEFAULT error get_all_messages );
 use Packages::DB;
 use Packages::Search qw( :all );
@@ -197,8 +197,6 @@ sub do_dispatch {
                    set_param_once( $input, \%params_set, 'suite', $s);
                } elsif (!$need_pkg && $SECTIONS{$_}) {
                    set_param_once( $input, \%params_set, 'section', $_);
-               } elsif (!$need_pkg && $ARCHIVES{$_}) {
-                   set_param_once( $input, \%params_set, 'archive', $_);
                } elsif (!$need_pkg && $sections_descs{$_}) {
                    set_param_once( $input, \%params_set, 'subsection', $_);
                } elsif (!$need_pkg && ($_ eq 'source')) {
@@ -206,6 +204,8 @@ sub do_dispatch {
                } elsif ($ARCHITECTURES{$_}) {
                    set_param_once( $input, \%params_set, 'arch', $_)
                        unless $_ eq 'any';
+               } elsif (!$need_pkg && $ARCHIVES{$_}) {
+                   set_param_once( $input, \%params_set, 'archive', $_);
                } elsif ($PRIORITIES{$_}) {
                    set_param_once( $input, \%params_set, 'priority', $_);
                } else {
@@ -247,7 +247,7 @@ sub do_dispatch {
                                        replace => { all => \@ARCHIVES,
                                                     default => \@ARCHIVES} },
                       exact => { default => 0, match => '^(\w+)$',  },
-                      lang => { default => $http_lang, match => '^(\w+)$',  },
+                      lang => { default => $http_lang, match => '^([\w-]+)$',  },
                       source => { default => 0, match => '^(\d+)$',  },
                       debug => { default => 0, match => '^(\d+)$',  },
                       searchon => { default => 'names', match => '^(\w+)$', },