From ea235c233fca93ed255068d4d8472c0b7970f899 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Tue, 6 Aug 2013 22:52:36 +0200 Subject: [PATCH] revised check_riivolution_patch (should now work in all cases) --- script.d/common.sh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/script.d/common.sh b/script.d/common.sh index 333cfb2..d9fb519 100644 --- a/script.d/common.sh +++ b/script.d/common.sh @@ -139,21 +139,23 @@ check_input_image () { check_riivolution_patch () { - if [[ ${PATCHIMAGE_RIIVOLUTION_DOWNLOAD} == "TRUE" ]]; then - if [[ ${DOWNLOAD_LINK} ]]; then - if [[ ! -f "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" ]]; then - wget --no-check-certificate ${DOWNLOAD_LINK} -O "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" - tools/unp "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" >/dev/null + if [[ ! -d ${RIIVOLUTION_DIR} ]]; then + if [[ -f "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" ]]; then + tools/unp "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" >/dev/null + elif [[ ${PATCHIMAGE_RIIVOLUTION_DOWNLOAD} == "TRUE" ]]; then + if [[ ${DOWNLOAD_LINK} ]]; then + if [[ ! -f "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" ]]; then + wget --no-check-certificate ${DOWNLOAD_LINK} -O "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" + tools/unp "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" >/dev/null + fi + else + echo "no download link for ${GAMENAME} available." + exit 1 fi else - echo "no download link for ${GAMENAME} available." + echo -e "please specify zip/rar to use with --riivolution=" exit 1 fi - elif [[ -f "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" && ! -d "${RIIVOLUTION_DIR}" ]]; then - tools/unp "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" >/dev/null - elif [[ ! -d "${RIIVOLUTION_DIR}" ]]; then - echo -e "please specify zip/rar to use with --riivolution=" - exit 1 fi }