cgi/regproj.cgi: Add fork parameter, accepting full project name
[girocco/susan.git] / jobs / fixupcheck.sh
blobd3aad74271dc358d6dfef08b2e7952ba612cda29
1 #!/bin/bash
3 # THIS SCRIPT IS BEING RUN UNDER ROOT!!!
5 # [repo.or.cz] You will need to manually update this file if you modify
6 # it in the repository.
8 # We want to make sure the push-access projects have the right directories
9 # in the right groups.
11 ## For maximum security separation, the fixup script is configured separately
12 ## and does not reuse Girocco::Config settings.
14 ## Girocco::Config::reporoot
15 reporoot="/srv/git"
16 ## Girocco::Config::chroot
17 chroot="/home/repo/j"
18 ## Girocco::Config::mirror_user
19 mirror_user="repo"
20 ## Directory with this script and fixup.sh; WARNING: COPY THEM OVER to ~root!
21 ## Otherwise, the owner of these scripts can execute anything as root.
22 fixup_dir="/root/repomgr"
24 # No need to lock.
26 groupfile="$(sed -ne "/^$xproj:/ { s/^[^:]*:[^:]*:\([0-9]*\):.*/\1/; p }" /home/repo/j/etc/group)"
27 gid="$(sed -ne "/^$xproj:/ { s/^[^:]*:[^:]*:\([0-9]*\):.*/\1/; p }" /home/repo/j/etc/group)"
29 cd "$reporoot"
30 find . -name base_url | cut -c 3- | sed -e 's/\/base_url$//' |
31 while read dir; do
32 "$fixup_dir"/fixup.sh "${dir%.git}" "$chroot/etc/group" "$mirroruser"
33 done