From 2a0d1ac64838c70a34fb4bb40b40c442831eb8f8 Mon Sep 17 00:00:00 2001 From: Fincer Date: Sat, 12 Nov 2016 00:49:10 +0200 Subject: [PATCH] Add hotfix support --- data/linux/openra-installscript.sh | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/data/linux/openra-installscript.sh b/data/linux/openra-installscript.sh index f7aa5ae..1515ce7 100755 --- a/data/linux/openra-installscript.sh +++ b/data/linux/openra-installscript.sh @@ -154,6 +154,24 @@ if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then fi read -r -p "Please type 1 or 2 (Default: 2): " number sleep 1 + + if [[ ! $(find $WORKING_DIR/data/hotfixes/linux/ -type f -iname *.patch | wc -l) -eq 0 ]]; then + echo -e "\nHotfixes -- Question\n" + echo -e "Use custom hotfixes if added by the user (Default: No)?\nNOTE: If you choose YES (y), be aware that your OpenRA/RA2 version will likely not be compatible with the other players unless they've applied exactly same hotfixes in their game versions, too!" + echo -e "\nAvailable hotfixes are:\n" + echo -e $green_in$(find $WORKING_DIR/data/hotfixes/linux/ -type f -iname *.patch | sed -e 's/.*\///' -e 's/\.[^\.]*$//')$out + echo -e "" + read -r -p "Use these hotfixes? (y/N) " hotfixes + + if [[ $hotfixes =~ ^([yY][eE][sS]|[yY])$ ]]; then + echo -e "\nHotfixes applied. Continuing." + sleep 2 + else + echo -e "\nHotfixes ignored and skipped. Continuing." + sleep 2 + fi + fi + if [[ $number -eq 1 ]]; then METHOD='' echo -e "\nSelected installation method:$bold_in Manual$out" @@ -167,6 +185,16 @@ if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then fi fi + if [[ $(find $WORKING_DIR/data/hotfixes/linux/ -type f -iname *.patch | wc -l) -eq 0 ]]; then + echo -e "Available hotfixes:$bold_in None$out" + else + if [[ $hotfixes =~ ^([yY][eE][sS]|[yY])$ ]]; then + echo -e "Use hotfixes:$bold_in Yes$out" + else + echo -e "Use hotfixes:$bold_in No$out" + fi + fi + if [ $SUDO_CHECK -eq 0 ]; then if [[ -z $METHOD ]]; then echo -e "\nOpenRA compilation requires that you install some packages first. Your permission for installation is asked (yes/no) everytime it's needed. This script asks for a required root password now, so you don't have to type it multiple times later on while the script is running.\n\nPlease type sudo/root password now.\n" @@ -245,6 +273,10 @@ if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then cp ./data/patches/linux/*.patch $HOME/openra-master/ + if [[ $hotfixes =~ ^([yY][eE][sS]|[yY])$ ]]; then + cp ./data/hotfixes/linux/*.patch $HOME/openra-master/ + fi + #********************************************************************************************************* ## PART 3/7 #