X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=bin%2Fcreate_index_pages;h=8586671bdbbffb52616d7d331ab4d6255ebb02f1;hb=11d08c95c0b38b80f9595b56121a95744d63b03b;hp=2c62033ddce7a22d6a3155b906ad7b99ce214904;hpb=bedf14e393ba83316aca3e442c14f24914a6cd84;p=deb%2Fpackages.git diff --git a/bin/create_index_pages b/bin/create_index_pages index 2c62033..8586671 100755 --- a/bin/create_index_pages +++ b/bin/create_index_pages @@ -44,16 +44,21 @@ tie my %src2bin, 'DB_File', "$DBDIR/sources_packages.db", my $sections = retrieve "$DBDIR/sections.info"; my $subsections = retrieve "$DBDIR/subsections.info"; -# work around problems with non-US security updates -$subsections->{oldstable}{us}{'non-US'}++; my $priorities = retrieve "$DBDIR/priorities.info"; #use Data::Dumper; #print STDERR Dumper($sections, $subsections, $priorities); -my (%pages); +my (%pages, %tt_vars); -my $template = new Packages::Template( "$TOPDIR/templates", 'html', {} ); +$tt_vars{make_search_url} = sub { return &Packages::CGI::make_search_url(@_) }; +$tt_vars{make_url} = sub { return &Packages::CGI::make_url(@_) }; +# needed to work around the limitations of the the FILTER syntax +$tt_vars{html_encode} = sub { return HTML::Entities::encode_entities(@_,'<>&"') }; +$tt_vars{uri_escape} = sub { return URI::Escape::uri_escape(@_) }; +$tt_vars{quotemeta} = sub { return quotemeta($_[0]) }; + +my $template = new Packages::Template( "$TOPDIR/templates", 'html', \%tt_vars ); print "write suite index files ...\n"; foreach my $s (@SUITES) { @@ -72,13 +77,6 @@ foreach my $s (@SUITES) { my %content = ( subsections => [], suite => $s, lang => $lang, charset => $charset, used_langs => \@LANGUAGES, 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 - $content{html_encode} = sub { return HTML::Entities::encode_entities(@_,'<>&"') }; - $content{uri_escape} = sub { return URI::Escape::uri_escape(@_) }; - $content{quotemeta} = sub { return quotemeta($_[0]) }; - foreach my $ssec ((keys %{$subsections->{$s}}, 'virtual')) { next if $ssec eq '-'; if ($sections_descs{$ssec}) {