From 6a37fbbd9884a57c246c954f82f8fdc1acc53cdb Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Mon, 2 Mar 2015 21:17:02 -0800 Subject: [PATCH] genindex.sh: keep a gitproj.list file in addition to gitweb.list The gitproj.list file is simply the initial version of the sorted project list, but without the silly %-escaping required by gitweb or the .git suffix on the project name. It can be more easily used by scripts like projlist.cgi without having to deal with the %-escaping and since we were already creating it as a step in the process, save it as gitproj.list. --- gitweb/genindex.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gitweb/genindex.sh b/gitweb/genindex.sh index b819f21..bdc36d9 100755 --- a/gitweb/genindex.sh +++ b/gitweb/genindex.sh @@ -17,13 +17,15 @@ fi # displayed as a ' ' in the owner email and will cause a project name # containing it to be omitted from the project list page. get_repo_list | while read proj; do - echo "$proj.git $(cd "$cfg_reporoot/$proj.git" && config_get owner)" -done | LC_ALL=C sort -k 1,1 | sed -e 's/+/%2B/g' >/tmp/gitweb.list.$$ + echo "$proj $(cd "$cfg_reporoot/$proj.git" && config_get owner)" +done | LC_ALL=C sort -k 1,1 >/tmp/gitproj.list.$$ +sed -e 's/ /.git /;s/+/%2B/g' /tmp/gitweb.list.$$ # Set the proper group, if configured, before the move if [ -n "$cfg_owning_group" ]; then - chgrp "$cfg_owning_group" /tmp/gitweb.list.$$ + chgrp "$cfg_owning_group" /tmp/gitproj.list.$$ /tmp/gitweb.list.$$ fi # Atomically move into place +mv -f /tmp/gitproj.list.$$ "$cfg_chroot/etc/gitproj.list" mv -f /tmp/gitweb.list.$$ "$cfg_chroot/etc/gitweb.list" -- 2.11.4.GIT