11 use Packages::CommonCode qw(:all);
12 use Packages::Config qw( $TOPDIR $DBDIR @ARCHIVES @SUITES @LANGUAGES );
13 use Packages::Template;
14 use Packages::I18N::Locale;
15 use Packages::Sections;
16 &Packages::Config::init( './' );
18 my $wwwdir = "$TOPDIR/www";
20 my $subsections = retrieve "$DBDIR/subsections.info";
23 #print STDERR Dumper($sections, $subsections, $priorities);
27 my $template = new Packages::Template( "$TOPDIR/templates", 'html');
29 print "write suite index files ...\n";
30 foreach my $s (@SUITES) {
32 mkdirp ( "$wwwdir/$key" );
33 mkdirp ( "$wwwdir/source/$key" );
34 foreach my $lang (@LANGUAGES) {
35 my $charset = 'UTF-8';
36 my $cat = Packages::I18N::Locale->get_handle($lang)
37 or die "get_handle failed for $lang";
38 print "writing $key/index (lang=$lang)...\n";
40 my %content = ( subsections => [], suite => $s,
41 po_lang => $lang, ddtp_lang => $lang,
42 charset => $charset, cat => $cat,
43 used_langs => \@LANGUAGES, suites => \@SUITES );
44 foreach my $ssec (sort (keys %{$subsections->{$s}}, 'virtual')) {
46 if ($sections_descs{$ssec}) {
47 push @{$content{subsections}}, {
49 name => $cat->g($sections_descs{$ssec}[0]),
50 desc => $cat->g($sections_descs{$ssec}[1]),
55 $template->page( 'suite_index', \%content,
56 "$wwwdir/$key/index.$lang.html.new");
57 activate( "$wwwdir/$key/index.$lang.html" );
59 $content{source} = 'source';
60 $template->page( 'suite_index', \%content,
61 "$wwwdir/source/$key/index.$lang.html.new");
62 activate( "$wwwdir/source/$key/index.$lang.html" );