From ea94878228187e52a330f77e626daf247b4b0623 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Tue, 3 Nov 2009 03:20:51 +0100 Subject: [PATCH] gitweb: Use pre-generated project list instead of find --- Girocco/Project.pm | 1 + gitweb/genindex.sh | 12 ++++++++++++ gitweb/gitweb_config.perl | 2 ++ 3 files changed, 15 insertions(+) create mode 100644 gitweb/genindex.sh diff --git a/Girocco/Project.pm b/Girocco/Project.pm index 8d1155f..e30b53a 100644 --- a/Girocco/Project.pm +++ b/Girocco/Project.pm @@ -395,6 +395,7 @@ sub _setup { $self->_group_add($pushers); $self->_hooks_install; $self->perm_initialize; + system($Girocco::Config::basedir . '/gitweb/genindex.sh'); } sub premirror { diff --git a/gitweb/genindex.sh b/gitweb/genindex.sh new file mode 100644 index 0000000..05709ca --- /dev/null +++ b/gitweb/genindex.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# +# genindex - Generate gitweb project list from Girocco's + +. @basedir@/shlib.sh + +set -e + +get_repo_list | while read proj; do + echo "$proj.git $(cd "$cfg_reporoot/$proj.git" && config_get owner)" +done >/tmp/gitweb.list.$$ +mv /tmp/gitweb.list.$$ "$cfg_chroot/etc/gitweb.list" diff --git a/gitweb/gitweb_config.perl b/gitweb/gitweb_config.perl index 4b5bda9..186e548 100644 --- a/gitweb/gitweb_config.perl +++ b/gitweb/gitweb_config.perl @@ -15,6 +15,8 @@ our $GIT = $Girocco::Config::git_bin; # ## absolute fs-path which will be prepended to the project path our $projectroot = $Girocco::Config::reporoot; +# source of projects list +our $projects_list = $Girocco::Config::chroot."/etc/gitweb.list"; # ## target of the home link on top of all pages our $home_link = $Girocco::Config::gitweburl; -- 2.11.4.GIT