diff options
author | Nick White <git@njw.me.uk> | 2009-08-16 01:59:59 +0100 |
---|---|---|
committer | Nick White <git@njw.me.uk> | 2009-08-16 01:59:59 +0100 |
commit | 95fa96a6c1d34ba8e53f8e9badd8c0d0c94eff37 (patch) | |
tree | 8f8ed44a898998ecf0bddcb6554aee125f7185b3 | |
parent | 2cb16555751d252e3a664b56697d20f6a7f41675 (diff) | |
download | gemrb-gameinstallers-95fa96a6c1d34ba8e53f8e9badd8c0d0c94eff37.tar.bz2 gemrb-gameinstallers-95fa96a6c1d34ba8e53f8e9badd8c0d0c94eff37.zip |
Added skip cd autodetection option
-rwxr-xr-x | auto-installer.sh | 6 | ||||
-rw-r--r-- | includes/cd-list.sh | 3 | ||||
-rw-r--r-- | includes/generic-includes.sh | 10 |
3 files changed, 14 insertions, 5 deletions
diff --git a/auto-installer.sh b/auto-installer.sh index 4d84887..586d974 100755 --- a/auto-installer.sh +++ b/auto-installer.sh @@ -35,7 +35,11 @@ parseargs "$@" echo "Checking CD version" -export CDMD5=$(md5sum "${CDMOUNT}/data1.cab"|awk '{print $1}') +if [ $SKIP_DETECTION -eq 0 ]; then + export CDMD5=$(md5sum "${CDMOUNT}/data1.cab"|awk '{print $1}') +else + export CDMD5="" +fi get_game diff --git a/includes/cd-list.sh b/includes/cd-list.sh index f736093..84465b5 100644 --- a/includes/cd-list.sh +++ b/includes/cd-list.sh @@ -104,7 +104,8 @@ function get_game CDNO=2 ;; * ) - echo "Unrecognised CD - please select game from menu or change the disc in ${CDMOUNT}" + [ $SKIP_DETECTION -eq 0 ] && \ + echo "Unrecognised CD - please select game from menu or change the disc in ${CDMOUNT}" choosegame ;; esac diff --git a/includes/generic-includes.sh b/includes/generic-includes.sh index b58177b..e90199c 100644 --- a/includes/generic-includes.sh +++ b/includes/generic-includes.sh @@ -21,6 +21,8 @@ [ -z "$LANGUAGE" ] && export LANGUAGE="English" +[ -z "$SKIP_DETECTION" ] && export SKIP_DETECTION=0 + ### functions ### function die @@ -108,7 +110,7 @@ function setperms function usage { - echo "Usage:" $0 "[-i installdir] [-p patchdir] [-c cdmount] [-l language]" + echo "Usage:" $0 "[-i installdir] [-p patchdir] [-c cdmount] [-l language] [-n]" echo -e " -i installdir is the directory to install to." echo -e " default: ${TARGETDIR} (changes per game)" echo -e " -c cdmount is the mount location of the cd drive used." @@ -117,19 +119,21 @@ function usage echo -e " default: ${PATCHDIR}" echo -e " -l language can be one of English, Spanish, French, German, Italian or Language Independant" echo -e " default: ${LANGUAGE}" - # TODO: Add option to show and select all known BG1 versions + echo -e " -n skip CD autodetection" + echo -e " default: off" } function parseargs { # usage: parseargs args... - while getopts ":i:p:c:l:" options; do + while getopts ":i:p:c:l:n" options; do case $options in i ) export TARGETDIR="$OPTARG";; p ) export PATCHDIR="$OPTARG";; c ) export CDMOUNT="${OPTARG%\/}";; # ensure no trailing slash l ) export LANGUAGE="$OPTARG";; + n ) export SKIP_DETECTION=1;; \? ) usage exit 1;; h ) usage |