mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Update scripts
This commit is contained in:
27
purpur
27
purpur
@@ -7,9 +7,9 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
|
||||
SOURCE="$(readlink "$SOURCE")"
|
||||
[[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
SOURCE=$([[ "$SOURCE" = /* ]] && echo "$SOURCE" || echo "$PWD/${SOURCE#./}")
|
||||
SOURCE=$([[ "$SOURCE" == /* ]] && echo "$SOURCE" || echo "$PWD/${SOURCE#./}")
|
||||
basedir=$(dirname "$SOURCE")
|
||||
. $basedir/scripts/init.sh
|
||||
. "$basedir"/scripts/init.sh
|
||||
|
||||
purpurstash() {
|
||||
STASHED=$(git stash)
|
||||
@@ -22,15 +22,15 @@ purpurunstash() {
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
"a" | "am" | "amend")
|
||||
"am" | "amend")
|
||||
(
|
||||
cd $basedir/Purpur-API/
|
||||
cd "$basedir"/Purpur-API/
|
||||
git add .
|
||||
git commit --amend --no-edit
|
||||
cd $basedir/Purpur-Server/
|
||||
cd "$basedir"/Purpur-Server/
|
||||
git add .
|
||||
git commit --amend --no-edit
|
||||
cd $basedir
|
||||
cd "$basedir"
|
||||
scripts/rebuildpatches.sh "$basedir"
|
||||
)
|
||||
;;
|
||||
@@ -52,8 +52,10 @@ case "$1" in
|
||||
(
|
||||
basedir
|
||||
mvn -N install
|
||||
cd ${FORK_NAME}-API
|
||||
mvn -e clean install && cd ../${FORK_NAME}-Server && mvn -e clean install
|
||||
cd Purpur-API
|
||||
mvn -e clean install
|
||||
cd ../Purpur-Server
|
||||
mvn -e clean install
|
||||
)
|
||||
;;
|
||||
"jar" | "purpurclip")
|
||||
@@ -71,8 +73,10 @@ case "$1" in
|
||||
(
|
||||
basedir
|
||||
mvn -N install
|
||||
cd ${FORK_NAME}-API
|
||||
mvn clean deploy && cd ../${FORK_NAME}-Server && mvn clean install
|
||||
cd Purpur-API
|
||||
mvn clean deploy
|
||||
cd ../Purpur-Server
|
||||
mvn clean install
|
||||
)
|
||||
;;
|
||||
"up" | "upstream")
|
||||
@@ -93,7 +97,7 @@ case "$1" in
|
||||
"setup")
|
||||
if [[ -f ~/.bashrc ]]; then
|
||||
NAME="purpur"
|
||||
if [[ ! -z "${2+x}" ]] ; then
|
||||
if [[ -n "${2+x}" ]]; then
|
||||
NAME="$2"
|
||||
fi
|
||||
(grep "alias $NAME=" ~/.bashrc >/dev/null) && (sed -i "s|alias $NAME=.*|alias $NAME='. $SOURCE'|g" ~/.bashrc) || (echo "alias $NAME='. $SOURCE'" >>~/.bashrc)
|
||||
@@ -107,6 +111,7 @@ case "$1" in
|
||||
echo "'setup' command. View below for details. For essential building and patching, you do not need to do the setup."
|
||||
echo ""
|
||||
echo " Normal commands:"
|
||||
echo " * am, amend | Amend current edits to last patches"
|
||||
echo " * rb, rebuild | Rebuild patches, can be called from anywhere."
|
||||
echo " * p, patch | Apply all patches to top of Paper without building it. Can be run from anywhere."
|
||||
echo " * up, upstream | Build Paper upstream, pass arg up to update paper. Can be run from anywhere."
|
||||
|
||||
@@ -22,7 +22,7 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
|
||||
SOURCE="$(readlink "$SOURCE")"
|
||||
[[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
. $(dirname $SOURCE)/init.sh
|
||||
. "$(dirname "$SOURCE")/init.sh"
|
||||
PS1="$"
|
||||
|
||||
paperVer=$(cat current-paper)
|
||||
@@ -30,24 +30,24 @@ gpgsign="$(git config commit.gpgsign || echo "false")"
|
||||
echo "Rebuilding Forked projects.... "
|
||||
function applyPatch {
|
||||
what=$1
|
||||
what_name=$(basename $what)
|
||||
what_name=$(basename "$what")
|
||||
target=$2
|
||||
branch=$3
|
||||
patch_folder=$4
|
||||
|
||||
cd "$basedir/$what"
|
||||
cd "$basedir/$what" || exit
|
||||
git fetch --all
|
||||
git branch -f upstream "$branch" >/dev/null
|
||||
|
||||
cd "$basedir"
|
||||
cd "$basedir" || exit
|
||||
if [ ! -d "$basedir/$target" ]; then
|
||||
mkdir "$basedir/$target"
|
||||
cd "$basedir/$target"
|
||||
cd "$basedir/$target" || exit
|
||||
git init
|
||||
git remote add origin $5
|
||||
cd "$basedir"
|
||||
git remote add origin "$5"
|
||||
cd "$basedir" || exit
|
||||
fi
|
||||
cd "$basedir/$target"
|
||||
cd "$basedir/$target" || exit
|
||||
|
||||
# Disable GPG signing before AM, slows things down and doesn't play nicely.
|
||||
# There is also zero rational or logical reason to do so for these sub-repo AMs.
|
||||
@@ -56,7 +56,7 @@ function applyPatch {
|
||||
|
||||
echo "Resetting $target to $what_name..."
|
||||
git remote rm upstream > /dev/null 2>&1
|
||||
git remote add upstream $basedir/$what >/dev/null 2>&1
|
||||
git remote add upstream "$basedir"/"$what" >/dev/null 2>&1
|
||||
git checkout master 2>/dev/null || git checkout -b master
|
||||
git fetch upstream >/dev/null 2>&1
|
||||
git reset --hard upstream/upstream
|
||||
@@ -80,8 +80,8 @@ function enableCommitSigningIfNeeded {
|
||||
}
|
||||
|
||||
(
|
||||
(applyPatch Paper/Paper-API ${FORK_NAME}-API HEAD api $API_REPO &&
|
||||
applyPatch Paper/Paper-Server ${FORK_NAME}-Server HEAD server $SERVER_REPO) || exit 1
|
||||
(applyPatch Paper/Paper-API Purpur-API HEAD api "$API_REPO" &&
|
||||
applyPatch Paper/Paper-Server Purpur-Server HEAD server "$SERVER_REPO") || exit 1
|
||||
enableCommitSigningIfNeeded
|
||||
) || (
|
||||
echo "Failed to apply patches"
|
||||
|
||||
@@ -6,35 +6,32 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
|
||||
SOURCE="$(readlink "$SOURCE")"
|
||||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
. $(dirname $SOURCE)/init.sh
|
||||
. "$(dirname "$SOURCE")/init.sh"
|
||||
|
||||
|
||||
cd $basedir
|
||||
cd "$basedir" || exit
|
||||
paperVer=$(cat current-paper)
|
||||
|
||||
minecraftversion=$(cat $basedir/Paper/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4)
|
||||
minecraftversion=$(< "$basedir"/Paper/work/BuildData/info.json grep minecraftVersion | cut -d '"' -f 4)
|
||||
decompile="Paper/work/Minecraft/$minecraftversion/spigot"
|
||||
|
||||
mkdir -p mc-dev/src/net/minecraft/server
|
||||
|
||||
cd mc-dev
|
||||
cd mc-dev || exit
|
||||
if [ ! -d ".git" ]; then
|
||||
git init
|
||||
fi
|
||||
|
||||
rm src/net/minecraft/server/*.java
|
||||
cp $basedir/$decompile/net/minecraft/server/*.java src/net/minecraft/server
|
||||
cp "$basedir"/"$decompile"/net/minecraft/server/*.java src/net/minecraft/server
|
||||
|
||||
base="$basedir/Paper/Paper-Server/src/main/java/net/minecraft/server"
|
||||
cd $basedir/mc-dev/src/net/minecraft/server/
|
||||
for file in $(/bin/ls $base)
|
||||
do
|
||||
cd "$basedir"/mc-dev/src/net/minecraft/server/ || exit
|
||||
for file in $(/bin/ls "$base"); do
|
||||
if [ -f "$file" ]; then
|
||||
rm -f "$file"
|
||||
fi
|
||||
done
|
||||
cd $basedir/mc-dev
|
||||
cd "$basedir"/mc-dev || exit
|
||||
git add . -A
|
||||
git commit . -m "mc-dev"
|
||||
git tag -a "$paperVer" -m "$paperVer" 2>/dev/null
|
||||
pushRepo . $MCDEV_REPO $paperVer
|
||||
|
||||
@@ -6,26 +6,26 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
|
||||
SOURCE="$(readlink "$SOURCE")"
|
||||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
. $(dirname $SOURCE)/init.sh
|
||||
. "$(dirname "$SOURCE")/init.sh"
|
||||
|
||||
workdir=$basedir/Paper/work
|
||||
minecraftversion=$(cat $basedir/Paper/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4)
|
||||
minecraftversion=$(< "$basedir"/Paper/work/BuildData/info.json grep minecraftVersion | cut -d '"' -f 4)
|
||||
decompiledir=$workdir/Minecraft/$minecraftversion/spigot
|
||||
|
||||
nms="net/minecraft/server"
|
||||
export MODLOG=""
|
||||
cd $basedir
|
||||
cd "$basedir" || exit
|
||||
|
||||
function containsElement {
|
||||
function containsElement() {
|
||||
local e
|
||||
for e in "${@:2}"; do
|
||||
[[ "$e" == "$1" ]] && return 0;
|
||||
[[ "$e" == "$1" ]] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
export importedmcdev=""
|
||||
function import {
|
||||
function import() {
|
||||
if [ -f "$basedir/Paper/Paper-Server/src/main/java/net/minecraft/server/$1.java" ]; then
|
||||
echo "ALREADY IMPORTED $1"
|
||||
return 0
|
||||
@@ -36,7 +36,7 @@ function import {
|
||||
base="$decompiledir/$nms/$file"
|
||||
|
||||
if [[ ! -f "$target" ]]; then
|
||||
export MODLOG="$MODLOG Imported $file from mc-dev\n";
|
||||
export MODLOG="$MODLOG Imported $file from mc-dev\n"
|
||||
echo "$(bashColor 1 32) Copying $(bashColor 1 34)$base $(bashColor 1 32)to$(bashColor 1 34) $target $(bashColorReset)"
|
||||
cp "$base" "$target"
|
||||
else
|
||||
@@ -45,26 +45,25 @@ function import {
|
||||
}
|
||||
|
||||
(
|
||||
cd Paper/Paper-Server/
|
||||
cd Paper/Paper-Server/ || exit
|
||||
lastlog=$(git log -1 --oneline)
|
||||
if [[ "$lastlog" = *"Purpur-Extra mc-dev Imports"* ]]; then
|
||||
if [[ "$lastlog" == *"Purpur-Extra mc-dev Imports"* ]]; then
|
||||
git reset --hard HEAD^
|
||||
fi
|
||||
)
|
||||
|
||||
|
||||
files=$(cat patches/server/* | grep "+++ b/src/main/java/net/minecraft/server/" | sort | uniq | sed 's/\+\+\+ b\/src\/main\/java\/net\/minecraft\/server\///g' | sed 's/.java//g')
|
||||
|
||||
nonnms=$(cat patches/server/* | grep "create mode " | grep -Po "src/main/java/net/minecraft/server/(.*?).java" | sort | uniq | sed 's/src\/main\/java\/net\/minecraft\/server\///g' | sed 's/.java//g')
|
||||
|
||||
for f in $files; do
|
||||
containsElement "$f" ${nonnms[@]}
|
||||
containsElement "$f" "${nonnms[@]}"
|
||||
if [ "$?" == "1" ]; then
|
||||
if [ ! -f "$basedir/Paper/Paper-Server/src/main/java/net/minecraft/server/$f.java" ]; then
|
||||
if [ ! -f "$decompiledir/$nms/$f.java" ]; then
|
||||
echo "$(bashColor 1 31) ERROR!!! Missing NMS$(bashColor 1 34) $f $(bashColorReset)";
|
||||
echo "$(bashColor 1 31) ERROR!!! Missing NMS$(bashColor 1 34) $f $(bashColorReset)"
|
||||
else
|
||||
import $f
|
||||
import "$f"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -80,10 +79,8 @@ done
|
||||
|
||||
################
|
||||
(
|
||||
cd Paper/Paper-Server/
|
||||
cd Paper/Paper-Server/ || exit
|
||||
rm -rf nms-patches
|
||||
git add src -A
|
||||
echo -e "Purpur-Extra mc-dev Imports\n\n$MODLOG" | git commit src -F -
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,36 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
# BEGIN config
|
||||
FORK_NAME="Purpur"
|
||||
API_REPO=""
|
||||
SERVER_REPO=""
|
||||
PAPER_API_REPO=""
|
||||
PAPER_SERVER_REPO=""
|
||||
MCDEV_REPO=""
|
||||
# END config
|
||||
|
||||
sourceBase=$(dirname $SOURCE)/../
|
||||
cd ${basedir:-$sourceBase}
|
||||
sourceBase=$(dirname "$SOURCE")/../
|
||||
cd "${basedir:-$sourceBase}" || exit
|
||||
|
||||
basedir=$(pwd -P)
|
||||
cd -
|
||||
cd - || exit
|
||||
|
||||
|
||||
function bashColor {
|
||||
if [ $2 ]; then
|
||||
function bashColor() {
|
||||
if [ "$2" ]; then
|
||||
echo -e "\e[$1;$2m"
|
||||
else
|
||||
echo -e "\e[$1m"
|
||||
fi
|
||||
}
|
||||
function bashColorReset {
|
||||
function bashColorReset() {
|
||||
echo -e "\e[m"
|
||||
}
|
||||
|
||||
function cleanupPatches {
|
||||
cd "$1"
|
||||
function cleanupPatches() {
|
||||
cd "$1" || exit
|
||||
for patch in *.patch; do
|
||||
gitver=$(tail -n 2 $patch | grep -ve "^$" | tail -n 1)
|
||||
diffs=$(git diff --staged $patch | grep -E "^(\+|\-)" | grep -Ev "(From [a-z0-9]{32,}|\-\-\- a|\+\+\+ b|.index|Date\: )")
|
||||
gitver=$(tail -n 2 "$patch" | grep -ve "^$" | tail -n 1)
|
||||
diffs=$(git diff --staged "$patch" | grep -E "^(\+|\-)" | grep -Ev "(From [a-z0-9]{32,}|\-\-\- a|\+\+\+ b|.index|Date\: )")
|
||||
|
||||
testver=$(echo "$diffs" | tail -n 2 | grep -ve "^$" | tail -n 1 | grep "$gitver")
|
||||
if [ "x$testver" != "x" ]; then
|
||||
@@ -38,28 +29,17 @@ function cleanupPatches {
|
||||
fi
|
||||
|
||||
if [ "x$diffs" == "x" ]; then
|
||||
git reset HEAD $patch >/dev/null
|
||||
git checkout -- $patch >/dev/null
|
||||
git reset HEAD "$patch" >/dev/null
|
||||
git checkout -- "$patch" >/dev/null
|
||||
fi
|
||||
done
|
||||
}
|
||||
function pushRepo {
|
||||
if [ "$(git config minecraft.push-${FORK_NAME})" == "1" ]; then
|
||||
echo "Pushing - $1 ($3) to $2"
|
||||
(
|
||||
cd "$1"
|
||||
git remote rm emc-push > /dev/null 2>&1
|
||||
git remote add emc-push $2 >/dev/null 2>&1
|
||||
git push emc-push $3 -f
|
||||
)
|
||||
fi
|
||||
function basedir() {
|
||||
cd "$basedir" || exit
|
||||
}
|
||||
function basedir {
|
||||
cd "$basedir"
|
||||
}
|
||||
function gethead {
|
||||
function gethead() {
|
||||
(
|
||||
cd "$1"
|
||||
cd "$1" || exit
|
||||
git log -1 --oneline
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
(
|
||||
set -e
|
||||
basedir="$(cd "$1" && pwd -P)"
|
||||
workdir="$basedir/Paper/work"
|
||||
mcver=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
|
||||
mcver=$(< "$workdir/BuildData/info.json" grep minecraftVersion | cut -d '"' -f 4)
|
||||
purpurjar="$basedir/Purpur-Server/target/purpur-$mcver.jar"
|
||||
vanillajar="$workdir/Minecraft/$mcver/$mcver.jar"
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# get base dir regardless of execution location
|
||||
SOURCE="${BASH_SOURCE[0]}"
|
||||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||
SOURCE="$(readlink "$SOURCE")"
|
||||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
. $(dirname $SOURCE)/init.sh
|
||||
|
||||
minecraftversion=$(cat $basedir/Paper/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4)
|
||||
|
||||
basedir
|
||||
pushRepo ${FORK_NAME}-API $API_REPO master:$minecraftversion
|
||||
pushRepo ${FORK_NAME}-Server $SERVER_REPO master:$minecraftversion
|
||||
@@ -6,39 +6,36 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
|
||||
SOURCE="$(readlink "$SOURCE")"
|
||||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
. $(dirname $SOURCE)/init.sh
|
||||
. "$(dirname "$SOURCE")/init.sh"
|
||||
|
||||
PS1="$"
|
||||
echo "Rebuilding patch files from current fork state..."
|
||||
function savePatches {
|
||||
function savePatches() {
|
||||
what=$1
|
||||
cd $basedir/$what/
|
||||
cd "$basedir"/"$what"/ || exit
|
||||
|
||||
mkdir -p $basedir/patches/$2
|
||||
mkdir -p "$basedir"/patches/"$2"
|
||||
if [ -d ".git/rebase-apply" ]; then
|
||||
# in middle of a rebase, be smarter
|
||||
echo "REBASE DETECTED - PARTIAL SAVE"
|
||||
last=$(cat ".git/rebase-apply/last")
|
||||
next=$(cat ".git/rebase-apply/next")
|
||||
declare -a files=("$basedir/patches/$2/"*.patch)
|
||||
for i in $(seq -f "%04g" 1 1 $last)
|
||||
do
|
||||
if [ $i -lt $next ]; then
|
||||
rm "${files[`expr $i - 1`]}"
|
||||
for i in $(seq -f "%04g" 1 1 "$last"); do
|
||||
if [ "$i" -lt "$next" ]; then
|
||||
rm "${files[$(("$i" - 1))]}"
|
||||
fi
|
||||
done
|
||||
else
|
||||
rm $basedir/patches/$2/*.patch
|
||||
rm "$basedir"/patches/"$2"/*.patch
|
||||
fi
|
||||
|
||||
git format-patch --quiet -N -o $basedir/patches/$2 upstream/upstream
|
||||
cd $basedir
|
||||
git add -A $basedir/patches/$2
|
||||
cleanupPatches $basedir/patches/$2/
|
||||
git format-patch --quiet -N -o "$basedir"/patches/"$2" upstream/upstream
|
||||
cd "$basedir" || exit
|
||||
git add -A "$basedir"/patches/"$2"
|
||||
cleanupPatches "$basedir"/patches/"$2"/
|
||||
echo " Patches saved for $what to patches/$2"
|
||||
}
|
||||
|
||||
savePatches ${FORK_NAME}-API api
|
||||
savePatches ${FORK_NAME}-Server server
|
||||
|
||||
$basedir/scripts/push.sh
|
||||
savePatches Purpur-API api
|
||||
savePatches Purpur-Server server
|
||||
|
||||
@@ -6,11 +6,11 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
|
||||
SOURCE="$(readlink "$SOURCE")"
|
||||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
. $(dirname $SOURCE)/init.sh
|
||||
. "$(dirname "$SOURCE")/init.sh"
|
||||
|
||||
if [[ "$1" == up* ]]; then
|
||||
(
|
||||
cd "$basedir/Paper/"
|
||||
cd "$basedir/Paper/" || exit
|
||||
git fetch && git reset --hard origin/master
|
||||
cd ../
|
||||
git add Paper
|
||||
@@ -18,28 +18,28 @@ if [[ "$1" == up* ]]; then
|
||||
fi
|
||||
|
||||
paperVer=$(gethead Paper)
|
||||
cd "$basedir/Paper/"
|
||||
cd "$basedir/Paper/" || exit
|
||||
|
||||
./paper patch
|
||||
|
||||
cd "Paper-Server"
|
||||
cd "Paper-Server" || exit
|
||||
mcVer=$(mvn -o org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=minecraft_version | sed -n -e '/^\[.*\]/ !{ /^[0-9]/ { p; q } }')
|
||||
|
||||
basedir
|
||||
. $basedir/scripts/importmcdev.sh
|
||||
. "$basedir"/scripts/importmcdev.sh
|
||||
|
||||
minecraftversion=$(cat $basedir/Paper/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4)
|
||||
minecraftversion=$(< "$basedir"/Paper/work/BuildData/info.json grep minecraftVersion | cut -d '"' -f 4)
|
||||
version=$(echo -e "Paper: $paperVer\nmc-dev:$importedmcdev")
|
||||
tag="${minecraftversion}-${mcVer}-$(echo -e $version | shasum | awk '{print $1}')"
|
||||
echo "$tag" > $basedir/current-paper
|
||||
tag="${minecraftversion}-${mcVer}-$(echo -e "$version" | shasum | awk '{print $1}')"
|
||||
echo "$tag" >"$basedir"/current-paper
|
||||
|
||||
$basedir/scripts/generatesources.sh
|
||||
"$basedir"/scripts/generatesources.sh
|
||||
|
||||
cd Paper/
|
||||
cd Paper/ || exit
|
||||
|
||||
function tag {
|
||||
function tag() {
|
||||
(
|
||||
cd $1
|
||||
cd "$1" || exit
|
||||
if [ "$2" == "1" ]; then
|
||||
git tag -d "$tag" 2>/dev/null
|
||||
fi
|
||||
@@ -50,13 +50,9 @@ echo "Tagging as $tag"
|
||||
echo -e "$version"
|
||||
|
||||
forcetag=0
|
||||
if [ "$(cat $basedir/current-paper)" != "$tag" ]; then
|
||||
if [ "$(cat "$basedir"/current-paper)" != "$tag" ]; then
|
||||
forcetag=1
|
||||
fi
|
||||
|
||||
tag Paper-API $forcetag
|
||||
tag Paper-Server $forcetag
|
||||
|
||||
pushRepo Paper-API $PAPER_API_REPO $tag
|
||||
pushRepo Paper-Server $PAPER_SERVER_REPO $tag
|
||||
|
||||
|
||||
@@ -4,24 +4,24 @@ set -e
|
||||
PS1="$"
|
||||
|
||||
function changelog() {
|
||||
base=$(git ls-tree HEAD $1 | cut -d' ' -f3 | cut -f1)
|
||||
cd $1 && git log --oneline ${base}...HEAD
|
||||
base=$(git ls-tree HEAD "$1" | cut -d' ' -f3 | cut -f1)
|
||||
cd "$1" && git log --oneline "${base}"...HEAD
|
||||
}
|
||||
paper=$(changelog Paper)
|
||||
|
||||
updated=""
|
||||
logsuffix=""
|
||||
if [ ! -z "$paper" ]; then
|
||||
if [ -n "$paper" ]; then
|
||||
logsuffix="$logsuffix\n\nPaper Changes:\n$paper"
|
||||
if [ -z "$updated" ]; then updated="Paper"; else updated="$updated/Paper"; fi
|
||||
fi
|
||||
disclaimer="Upstream has released updates that appears to apply and compile correctly"
|
||||
|
||||
if [ ! -z "$1" ]; then
|
||||
disclaimer="$@"
|
||||
if [ -n "$1" ]; then
|
||||
disclaimer=( "$@" )
|
||||
fi
|
||||
|
||||
log="${UP_LOG_PREFIX}Updated Upstream ($updated)\n\n${disclaimer}${logsuffix}"
|
||||
log="${UP_LOG_PREFIX}Updated Upstream ($updated)\n\n${disclaimer[*]}${logsuffix}"
|
||||
|
||||
echo -e "$log" | git commit -F -
|
||||
|
||||
|
||||
Reference in New Issue
Block a user