From 2884c41158a7297398386811cd6703c2171b66a1 Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 15 Apr 2009 12:33:30 +0100 Subject: Enabled getpatch to specify outfile --- includes/patch-includes.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/patch-includes.sh b/includes/patch-includes.sh index 0f76409..c09cb81 100644 --- a/includes/patch-includes.sh +++ b/includes/patch-includes.sh @@ -7,7 +7,11 @@ function getpatch { url=$1 - filename=$(basename $url) + if [ $# -gt 1 ]; then + filename="$2" + else + filename=$(basename $url) + fi if [ -f "$PATCHDIR/$filename" ]; then cp "$PATCHDIR/$filename" $TMPDIR || die -- cgit v1.2.3 From be2066c426699d84ce2b40749df6d218ee90f81f Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 15 Apr 2009 15:35:59 +0100 Subject: Added license notice to all files --- includes/autoinstall-includes.sh | 15 +++++++++++++++ includes/cd-includes.sh | 15 +++++++++++++++ includes/generic-includes.sh | 15 +++++++++++++++ includes/patch-includes.sh | 15 +++++++++++++++ 4 files changed, 60 insertions(+) (limited to 'includes') diff --git a/includes/autoinstall-includes.sh b/includes/autoinstall-includes.sh index a3bfa52..05465ba 100644 --- a/includes/autoinstall-includes.sh +++ b/includes/autoinstall-includes.sh @@ -1,3 +1,18 @@ +# Copyright 2009 Nick White +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# See for a copy of the GNU General +# Public License. + ### variables ### [ -z "$FULLINSTALL" ] && export FULLINSTALL=1 diff --git a/includes/cd-includes.sh b/includes/cd-includes.sh index e3d00fd..b9c3a3c 100644 --- a/includes/cd-includes.sh +++ b/includes/cd-includes.sh @@ -1,3 +1,18 @@ +# Copyright 2009 Nick White +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# See for a copy of the GNU General +# Public License. + ### default variables ### [ -z "$CDMOUNT" ] && export CDMOUNT="/media/cdrom" diff --git a/includes/generic-includes.sh b/includes/generic-includes.sh index e14138f..c441f55 100644 --- a/includes/generic-includes.sh +++ b/includes/generic-includes.sh @@ -1,3 +1,18 @@ +# Copyright 2009 Nick White +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# See for a copy of the GNU General +# Public License. + ### default variables ### [ -z "$TMPDIR" ] && export TMPDIR="/tmp/iepatch" diff --git a/includes/patch-includes.sh b/includes/patch-includes.sh index c09cb81..8c06f8f 100644 --- a/includes/patch-includes.sh +++ b/includes/patch-includes.sh @@ -1,3 +1,18 @@ +# Copyright 2009 Nick White +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# See for a copy of the GNU General +# Public License. + ### default variables ### [ -z "$PATCHDIR" ] && export PATCHDIR="$PWD" -- cgit v1.2.3 From 4a9b84dea70ece6354f3cde80a084dc2009e65c6 Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 16 Apr 2009 09:36:12 +0100 Subject: Removed obselete FULLGAMENAME refs --- includes/generic-includes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/generic-includes.sh b/includes/generic-includes.sh index c441f55..bd0176f 100644 --- a/includes/generic-includes.sh +++ b/includes/generic-includes.sh @@ -30,7 +30,7 @@ function die echo "" echo "The install failed; sorry." - echo "Please make sure you have the correct CDs for $FULLGAMENAME" + echo "Please make sure you have the correct CDs for the game" echo "and enough free disk space, and try again." exit 1 -- cgit v1.2.3 From c983586e82ad6dc583da41e688e92e5ee2a16183 Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 16 Apr 2009 09:37:03 +0100 Subject: Enable removal of failed install --- includes/generic-includes.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'includes') diff --git a/includes/generic-includes.sh b/includes/generic-includes.sh index bd0176f..4537501 100644 --- a/includes/generic-includes.sh +++ b/includes/generic-includes.sh @@ -25,8 +25,8 @@ function die { - #echo "Install can not continue, cleaning up partial install" - #rm -rf "$TARGETDIR" + echo "Install can not continue, cleaning up partial install" + rm -rf "$TARGETDIR" echo "" echo "The install failed; sorry." -- cgit v1.2.3 From eb9593d8616995cb9e88e9192acdaa9582d332fd Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 16 Apr 2009 11:31:39 +0100 Subject: Added autoinstaller menu to choose game manually --- includes/autoinstall-includes.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'includes') diff --git a/includes/autoinstall-includes.sh b/includes/autoinstall-includes.sh index 05465ba..fada3d3 100644 --- a/includes/autoinstall-includes.sh +++ b/includes/autoinstall-includes.sh @@ -37,6 +37,35 @@ function query { done } +function choosegame +{ + while true; do + choice=0 + echo "Choose the game to install from the list:" + echo "1 | Baldur's Gate 1 (5CD International version)" + echo "2 | Baldurs Gate & Tales of the Sword Coast (3CD US version)" + echo "3 | Tales of the Sword Coast (1CD UK version)" + echo "4 | Planescape: Torment (4CD version)" + echo "5 | Planescape: Torment (2CD version)" + + read -n 1 choice + echo + + case $choice in + 1 ) export CDMD5="138528155dfeb695bd63f90eacee7dc0" + return 0 ;; + 2 ) export CDMD5="1a6828b97a27967e8c4acc25e1ef48d2" + return 0 ;; + 3 ) export CDMD5="e27d259ddc0171ff945dbba136e60309" + return 0 ;; + 4 ) export CDMD5="5e8c2075163aca124de4a467fb33063d" + return 0 ;; + 5 ) export CDMD5="640b61443cc86c434f1b6826e63c0e33" + return 0 ;; + esac + done +} + function recommendcfg { # usage: recommendcfg [numofcds] -- cgit v1.2.3 From 3f6d4345d73a4ff238417a3be9176659fcf311e1 Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 16 Apr 2009 11:37:48 +0100 Subject: Normalised function style --- includes/autoinstall-includes.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/autoinstall-includes.sh b/includes/autoinstall-includes.sh index fada3d3..7ee3024 100644 --- a/includes/autoinstall-includes.sh +++ b/includes/autoinstall-includes.sh @@ -22,7 +22,8 @@ # a simplified version of query() from sorcery # $1 = question # $2 = default boolean answer [yYnN] -function query { +function query +{ while true; do RESPONSE="" echo -e -n "$1 [$2] " -- cgit v1.2.3 From 9d977397941833ab810eb41cd4c8895b40d929fc Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 16 Apr 2009 11:39:42 +0100 Subject: Removed obselete copycdextras function --- includes/cd-includes.sh | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'includes') diff --git a/includes/cd-includes.sh b/includes/cd-includes.sh index b9c3a3c..e234c9b 100644 --- a/includes/cd-includes.sh +++ b/includes/cd-includes.sh @@ -53,15 +53,3 @@ function getcd return 0 } - -function copycdextras -{ - # usage: copycdextras cdnum - # essentially a case insensitive cp -R cd#/* - CDNUMBER=$1 - - for filename in $(find $CDMOUNT/[cC][dD]$CDNUMBER/ -type f || die); do - relativepath=$(echo $filename|gawk -F "$CDMOUNT/[cC][dD]$CDNUMBER" '{print $2}'|tr A-Z a-z) - cp $filename "$TARGETDIR"/$relativepath || die - done -} -- cgit v1.2.3 From ae8f80f7ef3900af963ae1aa55ee066a907e7e3b Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 16 Apr 2009 11:43:19 +0100 Subject: Comment housekeeping --- includes/generic-includes.sh | 6 ++++-- includes/patch-includes.sh | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'includes') diff --git a/includes/generic-includes.sh b/includes/generic-includes.sh index 4537501..3cc65de 100644 --- a/includes/generic-includes.sh +++ b/includes/generic-includes.sh @@ -74,7 +74,7 @@ function checkforbin function setperms { - # usage setperms targetdir + # usage: setperms targetdir if ! [ -d "$1" ]; then return 1 @@ -109,6 +109,8 @@ function usage function parseargs { + # usage: parseargs args... + while getopts ":i:p:c:l:" options; do case $options in i ) export TARGETDIR="$OPTARG";; @@ -125,7 +127,7 @@ function parseargs function copylower { - #usage: copylower source destination + # usage: copylower source destination if [ -d "$1" ]; then for filename in $(find "$1" -type f); do lowerpath="$(echo $filename|gawk -F "$1" '{print $2}'|tr A-Z a-z)" diff --git a/includes/patch-includes.sh b/includes/patch-includes.sh index 8c06f8f..7081e9d 100644 --- a/includes/patch-includes.sh +++ b/includes/patch-includes.sh @@ -21,6 +21,8 @@ function getpatch { + # usage: getpatch url [filename] + url=$1 if [ $# -gt 1 ]; then filename="$2" -- cgit v1.2.3 From 1c9428ba23149f6d07556f658270db45ddcd9ff6 Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 16 Apr 2009 11:49:13 +0100 Subject: Make patch failure non-critical --- includes/patch-includes.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'includes') diff --git a/includes/patch-includes.sh b/includes/patch-includes.sh index 7081e9d..c9bbd30 100644 --- a/includes/patch-includes.sh +++ b/includes/patch-includes.sh @@ -36,3 +36,13 @@ function getpatch wget $url -O $TMPDIR/$filename || die fi } + +function die +{ + # override main die for patches so they won't wipe out + # a whole install + + echo " ! The patch install failed; sorry." 1>&2 + + exit 1 +} -- cgit v1.2.3 From 3603dfcb5d12e19b75dccbc2a621adb83fd7adea Mon Sep 17 00:00:00 2001 From: Nick White Date: Fri, 17 Apr 2009 17:10:07 +0100 Subject: Move overridden die for patch to new general function: diesoftly --- includes/generic-includes.sh | 9 +++++++++ includes/patch-includes.sh | 10 ---------- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'includes') diff --git a/includes/generic-includes.sh b/includes/generic-includes.sh index 3cc65de..d3db9bf 100644 --- a/includes/generic-includes.sh +++ b/includes/generic-includes.sh @@ -36,6 +36,15 @@ function die exit 1 } +function diesoftly +{ + # a non-destructive die + + echo " ! The install failed; sorry." 1>&2 + + exit 1 +} + function diequietly { exit 1 diff --git a/includes/patch-includes.sh b/includes/patch-includes.sh index c9bbd30..7081e9d 100644 --- a/includes/patch-includes.sh +++ b/includes/patch-includes.sh @@ -36,13 +36,3 @@ function getpatch wget $url -O $TMPDIR/$filename || die fi } - -function die -{ - # override main die for patches so they won't wipe out - # a whole install - - echo " ! The patch install failed; sorry." 1>&2 - - exit 1 -} -- cgit v1.2.3 From a6055bfb9b9847021ab93cddfdc31357b2c7fc38 Mon Sep 17 00:00:00 2001 From: Nick White Date: Fri, 1 May 2009 09:40:15 +0100 Subject: Fixed targetdir setting (thanks Nick Daly) Fixed a problem with setting targetdir which could result in the current directory being deleted. --- includes/generic-includes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/generic-includes.sh b/includes/generic-includes.sh index d3db9bf..983853a 100644 --- a/includes/generic-includes.sh +++ b/includes/generic-includes.sh @@ -17,7 +17,7 @@ [ -z "$TMPDIR" ] && export TMPDIR="/tmp/iepatch" -[ -z "$TARGETDIR" ] && export TARGETDIR="$PWD/$SHORTGAMENAME" +[ -z "$TARGETDIR" ] && [ -e "$SHORTGAMENAME" ] && export TARGETDIR="$PWD/$SHORTGAMENAME" [ -z "$LANGUAGE" ] && export LANGUAGE="English" -- cgit v1.2.3 From ebdd12a60dfdb8db6976762653764f6b2533d9c9 Mon Sep 17 00:00:00 2001 From: Nick White Date: Fri, 1 May 2009 10:11:25 +0100 Subject: Add a few more anti-clobbering protections --- includes/generic-includes.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'includes') diff --git a/includes/generic-includes.sh b/includes/generic-includes.sh index 983853a..43474af 100644 --- a/includes/generic-includes.sh +++ b/includes/generic-includes.sh @@ -25,8 +25,12 @@ function die { - echo "Install can not continue, cleaning up partial install" - rm -rf "$TARGETDIR" + echo "Install can not continue" + + if [ "$alwaysdiesafely" != "1" ]; then + echo "Cleaning up partial install" + rm -rf "$TARGETDIR" + fi echo "" echo "The install failed; sorry." -- cgit v1.2.3