fixup.sh: Remove unused chroot variable
[girocco.git] / fixupd / fixup.sh
blobc9ce5f313a248eb1356271475f6ba28ba115a8ae
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 set -e
10 proj="$1"
11 groupfile="$2"
12 mirror_user="$3"
14 # disallow paths containing ../
15 case "$proj" in
16 *../*)
17 echo "Invalid path" >&2
18 exit 1
20 esac
21 cd "$proj.git"
23 chmod ug+rw,o+r . -R 2>&1 | (grep -v 'No such file or directory' || true)
25 [ -e .nofetch ] || exit
27 xproj="$(echo "$proj" | sed 's/[.\/]/\\&/g')"
28 gid="$(sed -ne "/^$xproj:/ { s/^[^:]*:[^:]*:\([0-9]*\):.*/\1/; p }" "$groupfile")"
29 if [ -z "$gid" ]; then
30 echo "cannot resolve gid for $proj ($xproj)" >&2
31 exit 1
34 chown "$mirror_user"."$gid" info refs packed-refs objects -R 2>&1 | (grep -v 'No such file or directory' || true)