diff options
author | Nick Daly <myownlittlworld@hotmail.com> | 2009-06-07 13:54:16 -0500 |
---|---|---|
committer | Nick Daly <myownlittlworld@hotmail.com> | 2009-06-07 13:54:16 -0500 |
commit | 8340056fb51fb3539bbc63b14b551c6574309420 (patch) | |
tree | bc7495b11d2fc3161c76baf364369ee80d71f77e | |
parent | 84a273cfaed391a8008396e595cc1fa347aa2a5c (diff) | |
download | gemrb-gameinstallers-8340056fb51fb3539bbc63b14b551c6574309420.tar.bz2 gemrb-gameinstallers-8340056fb51fb3539bbc63b14b551c6574309420.zip |
Fixing previous bad commit. Made copylower safer.
-rwxr-xr-x | auto-installer.sh | 82 | ||||
-rw-r--r-- | includes/generic-includes.sh | 6 |
2 files changed, 45 insertions, 43 deletions
diff --git a/auto-installer.sh b/auto-installer.sh index 475fc09..f87e0ee 100755 --- a/auto-installer.sh +++ b/auto-installer.sh @@ -44,51 +44,51 @@ get_game [ -d "$TARGETDIR" ] && export alwaysdiesafely=1 echo "$FULLGAMENAME detected, installing" -# "${scriptdir}/${MINSCRIPT}" -i "$TARGETDIR" -c "$CDMOUNT" 1>/dev/null || diequietly +"${scriptdir}/${MINSCRIPT}" -i "$TARGETDIR" -c "$CDMOUNT" 1>/dev/null || diequietly -# if [ -n "$EXTRASCRIPT" ]; then -# if query "Do you want to do a full install, so the CDs will not be needed again?" y; then -# FULLINSTALL=1 -# "${scriptdir}/${EXTRASCRIPT}" -i "$TARGETDIR" -c "$CDMOUNT" 1>/dev/null || diequietly -# else -# FULLINSTALL=0 -# fi -# fi +if [ -n "$EXTRASCRIPT" ]; then + if query "Do you want to do a full install, so the CDs will not be needed again?" y; then + FULLINSTALL=1 + "${scriptdir}/${EXTRASCRIPT}" -i "$TARGETDIR" -c "$CDMOUNT" 1>/dev/null || diequietly + else + FULLINSTALL=0 + fi +fi -# if [ "$FULLINSTALL" -eq 0 ]; then -# if [ -n "$EXPANSIONSCRIPT" ]; then -# if query "Do you want to install the files needed by the $EXPANSIONNAME expansion?" y; then -# EXPANSIONINSTALL=1 -# "${scriptdir}/${EXPANSIONSCRIPT}" -i "$TARGETDIR" -c "$CDMOUNT" "1>/dev/null" # || diequietly -# else -# EXPANSIONINSTALL=0 -# fi -# fi -# fi +if [ "$FULLINSTALL" -eq 0 ]; then + if [ -n "$EXPANSIONSCRIPT" ]; then + if query "Do you want to install the files needed by the $EXPANSIONNAME expansion?" y; then + EXPANSIONINSTALL=1 + "${scriptdir}/${EXPANSIONSCRIPT}" -i "$TARGETDIR" -c "$CDMOUNT" 1>/dev/null || diequietly + else + EXPANSIONINSTALL=0 + fi + fi +fi -# if [ -n "$PATCHES" ]; then -# for patch in "$PATCHES"; do -# patch="$scriptdir/$patch" -# # grab 17th line from scripts (description line; after license) -# patchtitle=$(sed -n 17p "$patch"|cut -d ' ' -f 2-) -# if query "Do you want to install $patchtitle" y; then -# "$patch" \ -# -i "$TARGETDIR" \ -# -p "$PATCHDIR" \ -# -l "$LANGUAGE" \ -# -c "$CDMOUNT" \ -# 1>/dev/null -# fi -# done -# fi +if [ -n "$PATCHES" ]; then + for patch in "$PATCHES"; do + patch="$scriptdir/$patch" + # grab 17th line from scripts (description line; after license) + patchtitle=$(sed -n 17p "$patch"|cut -d ' ' -f 2-) + if query "Do you want to install $patchtitle" y; then + "$patch" \ + -i "$TARGETDIR" \ + -p "$PATCHDIR" \ + -l "$LANGUAGE" \ + -c "$CDMOUNT" \ + 1>/dev/null + fi + done +fi -# if [ -n "$WINDOWSFILES" ]; then -# if query "Do you want to remove unneeded windows files?" n; then -# for badfile in "$WINDOWSFILES"; do -# rm -rf "${TARGETDIR}/${badfile}" -# done -# fi -# fi +if [ -n "$WINDOWSFILES" ]; then + if query "Do you want to remove unneeded windows files?" n; then + for badfile in "$WINDOWSFILES"; do + rm -rf "${TARGETDIR}/${badfile}" + done + fi +fi echo echo "$FULLGAMENAME installed successfully" diff --git a/includes/generic-includes.sh b/includes/generic-includes.sh index 3e3ef36..b58177b 100644 --- a/includes/generic-includes.sh +++ b/includes/generic-includes.sh @@ -141,14 +141,16 @@ function parseargs function copylower { # usage: copylower source destination + mkdir -p "$2" + 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)" - cp -f "$filename" "$2/$lowerpath" || die + cp -f "$filename" "${2}/${lowerpath}" || die done elif [ -f "$1" ]; then lowername="$(basename $1|tr A-Z a-z)" - cp -f "$1" "$2"/$lowername + cp -f "$1" "${2}/${lowername}" fi } |