]> git.deb.at Git - deb/packages.git/blobdiff - lib/Packages/Config.pm
Move $debug_allowed to CGI as a real constant and modify all debug() calls
[deb/packages.git] / lib / Packages / Config.pm
index d2efe2fa885741d1155e6cf0afd3c2fc635c06a0..538e912e855a965485eeffde8f4c9d8353f5befb 100644 (file)
@@ -9,14 +9,14 @@ use Packages::CGI;
 our @ISA = qw( Exporter );
 
 our ( $TOPDIR, $DBDIR, $ROOT, $HOME, $CONTACT_MAIL, $WEBMASTER_MAIL,
-      $SEARCH_PAGE, $SEARCH_CGI, $SEARCH_URL,
+      $SEARCH_PAGE, $SEARCH_URL, @LANGUAGES, $LOCALES,
       $SRC_SEARCH_URL, $CONTENTS_SEARCH_CGI,
       $CN_HELP_URL, $BUG_URL, $SRC_BUG_URL, $QA_URL, $DDPO_URL,
       @SUITES, @SECTIONS, @ARCHIVES, @ARCHITECTURES,
       %FTP_SITES );
 our @EXPORT_OK = qw( $TOPDIR $DBDIR $ROOT $HOME $CONTACT_MAIL
-                    $WEBMASTER_MAIL
-                    $SEARCH_PAGE $SEARCH_CGI $SEARCH_URL
+                    $WEBMASTER_MAIL @LANGUAGES $LOCALES
+                    $SEARCH_PAGE $SEARCH_URL
                     $SRC_SEARCH_URL $CONTENTS_SEARCH_CGI
                     $CN_HELP_URL $BUG_URL $SRC_BUG_URL $QA_URL $DDPO_URL
                     @SUITES @SECTIONS @ARCHIVES @ARCHITECTURES
@@ -39,7 +39,8 @@ sub init {
            $TOPDIR = $1 if /^\s*topdir="?([^\"]*)"?\s*$/o;
            $ROOT = $1 if /^\s*root="?([^\"]*)"?\s*$/o;
            $HOME = $1 if /^\s*home="?([^\"]*)"?\s*$/o;
-           $SEARCH_CGI = $1 if /^\s*search_cgi="?([^\"]*)"?\s*$/o;
+           $LOCALES = $1 if /^\s*localedir="?([^\"]*)"?\s*$/o;
+#          $SEARCH_CGI = $1 if /^\s*search_cgi="?([^\"]*)"?\s*$/o;
            $SEARCH_PAGE = $1 if /^\s*search_page="?([^\"]*)"?\s*$/o;
            $SEARCH_URL = $1 if /^\s*search_url="?([^\"]*)"?\s*$/o;
            $SRC_SEARCH_URL = $1 if /^\s*search_src_url="?([^\"]*)"?\s*$/o;
@@ -49,18 +50,21 @@ sub init {
            $SRC_BUG_URL = $1 if /^\s*src_bug_url="?([^\"]*)"?\s*$/o;
            $QA_URL = $1 if /^\s*qa_url="?([^\"]*)"?\s*$/o;
            $DDPO_URL = $1 if /^\s*ddpo_url="?([^\"]*)"?\s*$/o;
+           $CN_HELP_URL = $1 if /^\s*cn_help_url="?([^\"]*)"?\s*$/o;
            $FTP_SITES{us} = $1 if /^\s*ftpsite="?([^\"]*)"?\s*$/o;
            $FTP_SITES{$1} = $2 if /^\s*(\w+)_ftpsite="?([^\"]*)"?\s*$/o;
+           @LANGUAGES = split(/\s+/, $1) if /^\s*polangs="?([^\"]*)"?\s*$/o;
            @SUITES = split(/\s+/, $1) if /^\s*suites="?([^\"]*)"?\s*$/o;
            @SECTIONS = split(/\s+/, $1) if /^\s*sections="?([^\"]*)"?\s*$/o;
            @ARCHIVES = split(/\s+/, $1) if /^\s*archives="?([^\"]*)"?\s*$/o;
            @ARCHITECTURES = split(/\s+/, $1) if /^\s*architectures="?([^\"]*)"?\s*$/o;
        }
        close (C);
-       debug( "read config ($modtime > $config_read_time)" );
+       debug( "read config ($modtime > $config_read_time)" ) if DEBUG;
        $config_read_time = $modtime;
     }
     $DBDIR = "$TOPDIR/files/db";
+    unshift @LANGUAGES, 'en';
 }
 
 1;