index.cgi 654 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/perl
  2. use lib 'lib';
  3. use LXR::Common;
  4. use LXR::Config;
  5. ($Conf, undef, $Path, $head) = &init($0);
  6. print "$head
  7. ";
  8. unless (defined $Conf->{'trees'} &&
  9. $Conf->baseurl eq $Conf->realbaseurl) {
  10. # this is the root of an individual tree
  11. # or the root of the only tree
  12. open INDEX, "<index.html";
  13. } else {
  14. # this is a list of published trees
  15. open INDEX, "<root/index.html";
  16. }
  17. {
  18. local $/ = undef;
  19. my $template = <INDEX>;
  20. print &expandtemplate($template,
  21. ('rootname', sub { return $Conf->{'sourceprefix'}; }),
  22. ('treename', sub { return $Conf->{'treename'}; }),
  23. );
  24. }
  25. close INDEX;