[CI-SKIP] make rebuildPatches support BSD sed

because the world can't be a nice place where all seds are equal
This commit is contained in:
Aikar 2018-10-24 00:53:08 -04:00
parent 5f7c6d0d2a
commit 9212632516
1 changed files with 2 additions and 2 deletions

View File

@ -12,8 +12,8 @@ echo "Rebuilding patch files from current fork state..."
function cleanupPatches { function cleanupPatches {
cd "$1" cd "$1"
for patch in *.patch; do for patch in *.patch; do
sed -ri 's/index [a-f0-9]+\.\.[a-f0-9]+/index 7ac07ac07ac0..7ac07ac07ac0/g' "$patch" sed -Ei 's/index [a-f0-9]+\.\.[a-f0-9]+/index 7ac07ac07ac0..7ac07ac07ac0/g' "$patch"
sed -ri 's/^From [a-f0-9]{32,}/From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0/g' "$patch" sed -Ei 's/^From [a-f0-9]{32,}/From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0/g' "$patch"
$gitcmd add -A $patch $gitcmd add -A $patch
gitver=$(tail -n 2 "$patch" | grep -ve "^$" | tail -n 1) gitver=$(tail -n 2 "$patch" | grep -ve "^$" | tail -n 1)
diffs=$($gitcmd diff --staged "$patch" | grep --color=none -E "^(\+|\-)" | grep --color=none -Ev "(From [a-f0-9]{32,}|\-\-\- a|\+\+\+ b|^.index)") diffs=$($gitcmd diff --staged "$patch" | grep --color=none -E "^(\+|\-)" | grep --color=none -Ev "(From [a-f0-9]{32,}|\-\-\- a|\+\+\+ b|^.index)")