Last active
January 25, 2016 20:48
-
-
Save Scurby/7eea8d020461c9798dcc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# lua53 - Upgrade lua to 5.3.2 (latest) | |
# | |
# Author: Scurby <[email protected]> | |
# | |
# Created: 1/22/2016 | |
logger -t options "** OPTIONS **" | |
############################################################################## | |
# Common functions and setup | |
############################################################################## | |
yorn() { | |
echo -n -e "$@ Y\b" | |
read yorn\ | |
case $yorn in | |
[Nn]* ) return 1;; | |
esac | |
return 0 | |
} | |
logmsg() { | |
echo "${tc_smso}**${tc_rmso} $*" | |
logger -t options "$*" | |
} | |
logstep() { | |
let "step=$step + 1" | |
echo ${tc_smso}$(head -c $(tput cols) < /dev/zero | tr '\0' '*')${tc_rmso} | |
echo "${tc_smso}**${tc_rmso} STEP $step >> $*" | |
logger -t options "STEP $step >> $*" | |
} | |
step=0 | |
tc_smso=$(tput smso) | |
tc_rmso=$(tput rmso) | |
############# | |
# Upgrade to LUA 5.3.2 | |
############# | |
logstep "Lua 5.3.2 upgrade" | |
logstep " This is your lua version" | |
lua -v | |
if yorn "Do you need to upgrade Lua to 5.3.2??"; then | |
logmsg "Download and install" | |
cd | |
curl -R -O http://www.lua.org/ftp/lua-5.3.2.tar.gz | |
tar zxf lua-5.3.2.tar.gz | |
cd lua-5.3.2 | |
make linux test | |
sudo make linux install | |
cd | |
logmsg "Pull patch" | |
cd ~/workspace/Core3 | |
git stash | |
git pull | |
git stash apply | |
# TODO - Remove the following line after merge to unstable | |
git fetch http://review.swgemu.com/Core3 refs/changes/98/4498/5 && git cherry-pick FETCH_HEAD | |
cd | |
logmsg "Update engine" | |
cd ~/workspace/PublicEngine | |
# Checkout lua53 branch | |
git checkout -b lua53 ## TODO -Remove this line after merge. | |
git pull origin lua53 ## TODO -Remove this line after merge. | |
# git pull ## TODO -Uncomment this line after merge. | |
# Check lua version 2 | |
logmsg "lua -v" | |
lua -v | |
############## | |
logmsg " Do config clean build.." | |
logmsg "" | |
cd | |
cd ~/workspace/MMOCoreORB | |
make config | |
make clean | |
make -k build | |
cd bin | |
./core3 runUnitTests | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Will cause the auto-lua upgrade to kick in..