aboutsummaryrefslogtreecommitdiffstats
path: root/cgit-chroot
diff options
context:
space:
mode:
authorWynn Wolf Arbor2020-05-27 21:48:14 +0200
committerWynn Wolf Arbor2020-05-27 21:48:14 +0200
commit5d12f42bb6d8f339dbe76689a0fb2afa51f994d9 (patch)
tree0f9e83ef29af6c0634f91164fee69eb284052fc6 /cgit-chroot
parent3bd87dc46ff202ee3d37e9d5e3e0c5ebfe504bba (diff)
downloadskein-5d12f42bb6d8f339dbe76689a0fb2afa51f994d9.tar.gz
cgit-chroot: Rename to skein-infra
Be more clear about the purpose of this script and rename it to "skein-infra" since users might expect a program carrying "chroot" in its name to enter or otherwise manage a chroot. Additionally, use a consistent format for the environment variables controlling the locations of the cgit chroot and git repositories.
Diffstat (limited to '')
-rwxr-xr-xskein-infra (renamed from cgit-chroot)26
1 files changed, 13 insertions, 13 deletions
diff --git a/cgit-chroot b/skein-infra
index 5d229db..44f55a5 100755
--- a/cgit-chroot
+++ b/skein-infra
@@ -2,11 +2,11 @@
set -e
-CGIT_CHROOT=${CGIT_CHROOT:-/srv/cgit}
-CGIT_GIT_ROOT=${CGIT_GIT_ROOT:-/srv/git}
+SKEIN_CGIT_ROOT=${SKEIN_CGIT_ROOT:-/srv/cgit}
+SKEIN_GIT_ROOT=${SKEIN_GIT_ROOT:-/srv/git}
usage() {
- printf 'usage: cgit-chroot setup|teardown\n' >&2
+ printf 'usage: skein-infra setup|teardown\n' >&2
exit 1
}
@@ -23,7 +23,7 @@ ldel() {
}
remove_prefix() {
- printf "%s" "${1#$CGIT_CHROOT/*}"
+ printf "%s" "${1#$SKEIN_CGIT_ROOT/*}"
}
bind_mount() {
@@ -40,19 +40,19 @@ bind_umount() {
}
setup() {
- mkdir "$CGIT_CHROOT"/dev
- mknod "$CGIT_CHROOT"/dev/null c 1 3
- chmod 666 "$CGIT_CHROOT"/dev/null
+ mkdir "$SKEIN_CGIT_ROOT"/dev
+ mknod "$SKEIN_CGIT_ROOT"/dev/null c 1 3
+ chmod 666 "$SKEIN_CGIT_ROOT"/dev/null
- for i in "$CGIT_CHROOT"/instances/*; do
+ for i in "$SKEIN_CGIT_ROOT"/instances/*; do
test -d "$i" || continue
user=$(basename "$i")
id -ru "$user" >/dev/null || continue
- git_repo_dir="${CGIT_GIT_ROOT}/$user"
+ git_repo_dir="${SKEIN_GIT_ROOT}/$user"
test -d "$git_repo_dir" || continue
- instance_repo_dir="$CGIT_CHROOT"/instances/$user/repos
+ instance_repo_dir="$SKEIN_CGIT_ROOT"/instances/$user/repos
bind_mount "$git_repo_dir" "$instance_repo_dir"
chmod 0701 "$instance_repo_dir"
@@ -60,10 +60,10 @@ setup() {
}
teardown() {
- rm "$CGIT_CHROOT"/dev/null
- rmdir "$CGIT_CHROOT"/dev
+ rm "$SKEIN_CGIT_ROOT"/dev/null
+ rmdir "$SKEIN_CGIT_ROOT"/dev
- for i in "$CGIT_CHROOT"/instances/*/repos; do
+ for i in "$SKEIN_CGIT_ROOT"/instances/*/repos; do
bind_umount "$i"
done
}