]> git.deb.at Git - deb/packages.git/commitdiff
Also create source versions for suite_index
authorFrank Lichtenheld <frank@lichtenheld.de>
Fri, 24 Nov 2006 01:30:19 +0000 (01:30 +0000)
committerFrank Lichtenheld <frank@lichtenheld.de>
Fri, 24 Nov 2006 01:30:19 +0000 (01:30 +0000)
bin/create_index_pages

index 69b60a28b26ddf866b92f18446a5a560ddc4581d..23dd0e69303d887437c8237a71b26ee205b0b271 100755 (executable)
@@ -67,11 +67,10 @@ foreach my $s (@SUITES) {
            next;
        };
        print "writing $key/index (lang=$lang)...\n";
-       open $pages{$key}{$lang}{index}{fh}, '>', "$wwwdir/$key/index.$lang.html.new"
-           or die "can't open index file for output: $!";
 
        my %content = ( subsections => [], suite => $s,
-                       lang => $lang, charset => $charset );
+                       lang => $lang, charset => $charset,
+                       suites => \@SUITES );
        $content{make_search_url} = sub { return &Packages::CGI::make_search_url(@_) };
        $content{make_url} = sub { return &Packages::CGI::make_url(@_) };
         # needed to work around the limitations of the the FILTER syntax
@@ -89,14 +88,26 @@ foreach my $s (@SUITES) {
                };
            }
        }
-       
+
+       open $pages{$key}{$lang}{index}{fh}, '>', "$wwwdir/$key/index.$lang.html.new"
+           or die "can't open index file for output: $!";
        print {$pages{$key}{$lang}{index}{fh}} $template->page( 'suite_index', \%content );
        print {$pages{$key}{$lang}{index}{fh}} $template->trailer( 'index', $lang, \@LANGUAGES );
        close $pages{$key}{$lang}{index}{fh} or
            warn "can't close index file $wwwdir/$key/index.$lang.html.new: $!";
        rename( "$wwwdir/$key/index.$lang.html.new",
                "$wwwdir/$key/index.$lang.html" );
-       
+
+       $content{source} = 'source';
+       open $pages{$key}{$lang}{source_index}{fh}, '>', "$wwwdir/source/$key/index.$lang.html.new"
+           or die "can't open index file for output: $!";
+       print {$pages{$key}{$lang}{source_index}{fh}} $template->page( 'suite_index', \%content );
+       print {$pages{$key}{$lang}{source_index}{fh}} $template->trailer( 'index', $lang, \@LANGUAGES );
+       close $pages{$key}{$lang}{source_index}{fh} or
+           warn "can't close index file $wwwdir/source/$key/index.$lang.html.new: $!";
+       rename( "$wwwdir/source/$key/index.$lang.html.new",
+               "$wwwdir/source/$key/index.$lang.html" );
+
     }
 }
 setlocale( LC_ALL, 'C' ) or die "couldn't reset locale";