diff options
Diffstat (limited to 'infra')
-rwxr-xr-x | infra/cgit-regen-config | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/infra/cgit-regen-config b/infra/cgit-regen-config new file mode 100755 index 0000000..36228a1 --- /dev/null +++ b/infra/cgit-regen-config @@ -0,0 +1,26 @@ +#!/bin/sh +set -e + +root=/srv/dgit.debian.org + +repos=$root/unpriv/repos +outfile=$root/etc/projects.cgit +lockfile=$outfile.lock +template=$root/config/cgit-template + +flock $lockfile -c ' + outfile='"$outfile"' + repos='"$repos"' + exec >"$outfile.tmp" + for ff in "$repos"/[0-9a-z]*.git; do + f=${ff##*/} + p=${f%.git} + cat <<END +repo.url=$f +repo.path=$repos/$f +END + sed "s/%PACKAGE%/$p/g" <'"$template"' + echo + done + mv -f "$outfile.tmp" "$outfile" +' |