about summary refs log tree commit diff
path: root/third_party/git/t/t1509/prepare-chroot.sh
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-09-21T10·03+0300
committerVincent Ambo <mail@tazj.in>2021-09-21T11·29+0300
commit43b1791ec601732ac31195df96781a848360a9ac (patch)
treedaae8d638343295d2f1f7da955e556ef4c958864 /third_party/git/t/t1509/prepare-chroot.sh
parent2d8e7dc9d9c38127ec4ebd13aee8e8f586a43318 (diff)
chore(3p/git): Unvendor git and track patches instead r/2903
This was vendored a long time ago under the expectation that keeping
it in sync with cgit would be easier this way, but it has proven not
to be a big issue.

On the other hand, a vendored copy of git is an annoying maintenance
burden. It is much easier to rebase the single (dottime) patch that we
have.

This removes the vendored copy of git and instead passes the git
source code to cgit via `pkgs.srcOnly`, which includes the applied
patch so that cgit can continue rendering dottime.

Change-Id: If31f62dea7ce688fd1b9050204e9378019775f2b
Diffstat (limited to 'third_party/git/t/t1509/prepare-chroot.sh')
-rwxr-xr-xthird_party/git/t/t1509/prepare-chroot.sh58
1 files changed, 0 insertions, 58 deletions
diff --git a/third_party/git/t/t1509/prepare-chroot.sh b/third_party/git/t/t1509/prepare-chroot.sh
deleted file mode 100755
index 6d47e2c725f7..000000000000
--- a/third_party/git/t/t1509/prepare-chroot.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/sh
-
-die() {
-	echo >&2 "$@"
-	exit 1
-}
-
-xmkdir() {
-	while [ -n "$1" ]; do
-		[ -d "$1" ] || mkdir "$1" || die "Unable to mkdir $1"
-		shift
-	done
-}
-
-R="$1"
-
-[ "$(id -u)" -eq 0 ] && die "This script should not be run as root, what if it does rm -rf /?"
-[ -n "$R" ] || die "usage: prepare-chroot.sh <root>"
-[ -x git ] || die "This script needs to be executed at git source code's top directory"
-if [ -x /bin/busybox ]; then
-	BB=/bin/busybox
-elif [ -x /usr/bin/busybox ]; then
-	BB=/usr/bin/busybox
-else
-	die "You need busybox"
-fi
-
-xmkdir "$R" "$R/bin" "$R/etc" "$R/lib" "$R/dev"
-touch "$R/dev/null"
-echo "root:x:0:0:root:/:/bin/sh" > "$R/etc/passwd"
-echo "$(id -nu):x:$(id -u):$(id -g)::$(pwd)/t:/bin/sh" >> "$R/etc/passwd"
-echo "root::0:root" > "$R/etc/group"
-echo "$(id -ng)::$(id -g):$(id -nu)" >> "$R/etc/group"
-
-[ -x "$R$BB" ] || cp $BB "$R/bin/busybox"
-for cmd in sh su ls expr tr basename rm mkdir mv id uname dirname cat true sed diff; do
-	ln -f -s /bin/busybox "$R/bin/$cmd"
-done
-
-mkdir -p "$R$(pwd)"
-rsync --exclude-from t/t1509/excludes -Ha . "$R$(pwd)"
-# Fake perl to reduce dependency, t1509 does not use perl, but some
-# env might slip through, see test-lib.sh, unset.*PERL_PATH
-sed 's|^PERL_PATH=.*|PERL_PATH=/bin/true|' GIT-BUILD-OPTIONS > "$R$(pwd)/GIT-BUILD-OPTIONS"
-for cmd in git $BB;do 
-	ldd $cmd | grep '/' | sed 's,.*\s\(/[^ ]*\).*,\1,' | while read i; do
-		mkdir -p "$R$(dirname $i)"
-		cp "$i" "$R/$i"
-	done
-done
-cat <<EOF
-All is set up in $R, execute t1509 with the following commands:
-
-sudo chroot $R /bin/su - $(id -nu)
-IKNOWWHATIAMDOING=YES ./t1509-root-worktree.sh -v -i
-
-When you are done, simply delete $R to clean up
-EOF