diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-07-18 16:53:26 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-07-18 17:30:14 +0100 |
commit | 71314fb22dac47254619db465f618818afcca3b5 (patch) | |
tree | e7600d6a42bfc16172e88d1c04738b1fefc9bcd0 | |
parent | b7f362f25ab0d961df1e100af7d07165b5ecdfc3 (diff) |
Provide cgit-regen-config command for cgi-grnet-01.
-rw-r--r-- | debian/changelog | 1 | ||||
-rwxr-xr-x | infra/cgit-regen-config | 26 |
2 files changed, 27 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index 610322e..b5ae326 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ dgit (0.31~~) unstable; urgency=low Infrastructure: * Provide for mirroring git updates to a different server. + * Provide cgit-regen-config command for cgi-grnet-01. -- Ian Jackson <ijackson@chiark.greenend.org.uk> Sat, 11 Jul 2015 14:30:19 +0100 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" +' |