2017-01-30 08:34:39 +11:00
|
|
|
#!/bin/sh
|
2013-01-15 12:18:40 +11:00
|
|
|
|
2014-04-14 21:01:27 +10:00
|
|
|
PS1="$"
|
2013-01-21 20:24:30 +11:00
|
|
|
basedir=`pwd`
|
2013-01-15 12:18:40 +11:00
|
|
|
echo "Rebuilding Forked projects.... "
|
|
|
|
|
2017-01-30 08:34:39 +11:00
|
|
|
applyPatch() {
|
2013-01-15 12:18:40 +11:00
|
|
|
what=$1
|
|
|
|
target=$2
|
2014-12-01 10:29:54 +00:00
|
|
|
branch=$3
|
2013-01-19 14:04:56 -05:00
|
|
|
|
2013-11-05 16:26:20 -08:00
|
|
|
cd "$basedir"
|
2019-01-04 20:04:33 +11:00
|
|
|
if [ ! -d "$target" ]; then
|
|
|
|
git clone ../$what $target
|
2013-01-15 12:18:40 +11:00
|
|
|
fi
|
|
|
|
cd "$basedir/$target"
|
|
|
|
echo "Resetting $target to $what..."
|
2018-12-20 18:39:17 +01:00
|
|
|
git config commit.gpgSign false
|
2019-01-04 20:04:33 +11:00
|
|
|
git remote rm origin >/dev/null 2>&1
|
|
|
|
git remote add origin ../../$what >/dev/null 2>&1
|
2013-01-19 14:04:56 -05:00
|
|
|
git checkout master >/dev/null 2>&1
|
2019-01-04 20:04:33 +11:00
|
|
|
git fetch origin >/dev/null 2>&1
|
|
|
|
git reset --hard $branch
|
|
|
|
|
2013-01-15 12:18:40 +11:00
|
|
|
echo " Applying patches to $target..."
|
2018-12-26 08:00:00 +11:00
|
|
|
git am --abort >/dev/null 2>&1
|
2013-11-05 16:26:20 -08:00
|
|
|
git am --3way "$basedir/${what}-Patches/"*.patch
|
2013-01-15 12:18:40 +11:00
|
|
|
if [ "$?" != "0" ]; then
|
|
|
|
echo " Something did not apply cleanly to $target."
|
|
|
|
echo " Please review above details and finish the apply then"
|
|
|
|
echo " save the changes with rebuildPatches.sh"
|
2013-01-19 19:18:20 +11:00
|
|
|
exit 1
|
2013-01-15 12:18:40 +11:00
|
|
|
else
|
|
|
|
echo " Patches applied cleanly to $target"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2015-01-24 01:00:49 +00:00
|
|
|
cd ../Bukkit
|
|
|
|
hash=$(git rev-parse HEAD)
|
|
|
|
git branch -f spigot "$hash"
|
|
|
|
|
|
|
|
applyPatch Bukkit Spigot-API origin/spigot && applyPatch CraftBukkit Spigot-Server origin/patched
|