File: cgit-regen-config

package info (click to toggle)
dgit 12.16
  • links: PTS, VCS
  • area: main
  • in suites: trixie-proposed-updates
  • size: 3,368 kB
  • sloc: perl: 13,443; sh: 6,466; python: 334; makefile: 324; tcl: 69
file content (26 lines) | stat: -rwxr-xr-x 447 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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"
'