From 991f72b958795a2f9e9f960b6c631acfbdf5caa2 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sat, 6 Aug 2016 20:41:34 +0200 Subject: [PATCH] fixup image / rom detection --- scripts/common.sh | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/scripts/common.sh b/scripts/common.sh index 01c23fe..c116465 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -220,18 +220,18 @@ check_input_image () { x=0 if [[ ! ${IMAGE} ]]; then - if test -f "${WBFS_MASK}".wbfs; then + if test -f ${WBFS_MASK}.wbfs; then x=1 - IMAGE="${WBFS_MASK}".wbfs - elif test -f "${WBFS_MASK}".iso; then + IMAGE=${WBFS_MASK}.wbfs + elif test -f ${WBFS_MASK}.iso; then x=2 - IMAGE="${WBFS_MASK}".iso - elif test -f "${PATCHIMAGE_WBFS_DIR}"/"${WBFS_MASK}".iso; then + IMAGE=${WBFS_MASK}.iso + elif test -f "${PATCHIMAGE_WBFS_DIR}"/${WBFS_MASK}.iso; then x=3 - IMAGE="${PATCHIMAGE_WBFS_DIR}"/"${WBFS_MASK}".iso - elif test -f "${PATCHIMAGE_WBFS_DIR}"/"${WBFS_MASK}".wbfs; then + IMAGE="${PATCHIMAGE_WBFS_DIR}"/${WBFS_MASK}.iso + elif test -f "${PATCHIMAGE_WBFS_DIR}"/${WBFS_MASK}.wbfs; then x=4 - IMAGE="${PATCHIMAGE_WBFS_DIR}"/"${WBFS_MASK}".wbfs + IMAGE="${PATCHIMAGE_WBFS_DIR}"/${WBFS_MASK}.wbfs else echo -e "please specify image to use with --iso=" exit 15 @@ -245,21 +245,15 @@ check_input_rom () { x=5 if [[ ! ${ROM} ]]; then - ROM=$(find . -name "${ROM_MASK}" | sed -e 's,./,,') - if [[ -f ${ROM} ]]; then + if test -f ${ROM_MASK}.cxi; then x=6 - ROM="${ROM}" + ROM=${ROM_MASK}.cxi + elif test -f "${PATCHROM_3DS_DIR}"/${ROM_MASK}.iso; then + x=7 + ROM="${PATCHROM_3DS_DIR}"/${ROM_MASK}.iso else - ROM=$(find "${PATCHIMAGE_3DS_DIR}" -name "${ROM_MASK}") - if [[ -f ${ROM} ]]; then - x=7 - ROM="${ROM}" - else - if [[ ! ${HANS_MULTI_SOURCE} ]]; then - echo -e "error: could not find suitable ROM, specify using --rom" - exit 15 - fi - fi + echo -e "please specify rom to use with --rom=" + exit 15 fi fi echo "*** >> status: ${x}"