fixup image and rom detection (really now)

This commit is contained in:
Christopher Roy Bratusek 2016-08-06 21:08:16 +02:00
parent 8ee2af1489
commit b9b1a7942b

View File

@ -220,18 +220,23 @@ check_input_image () {
x=0 x=0
if [[ ! ${IMAGE} ]]; then if [[ ! ${IMAGE} ]]; then
if test -f "${WBFS_MASK}".wbfs; then WBFS0=$(find . -maxdepth 1 -name "${WBFS_MASK}".wbfs)
WBFS1=$(find "${PATCHIMAGE_WBFS_DIR}" -name "${WBFS_MASK}".wbfs)
ISO0=$(find . -maxdepth 1 -name "${WBFS_MASK}".iso)
ISO1=$(find "${PATCHIMAGE_WBFS_DIR}" -name "${WBFS_MASK}".iso)
if [[ -f ${WBFS0} ]]; then
x=1 x=1
IMAGE="${WBFS_MASK}".wbfs IMAGE=${WBFS0}
elif test -f "${WBFS_MASK}".iso; then elif [[ -f ${ISO0} ]]; then
x=2 x=2
IMAGE="${WBFS_MASK}".iso IMAGE=${ISO0}
elif test -f "${PATCHIMAGE_WBFS_DIR}"/"${WBFS_MASK}".iso; then elif [[ -f ${WBFS1} ]]; then
x=3 x=3
IMAGE="${PATCHIMAGE_WBFS_DIR}"/"${WBFS_MASK}".iso IMAGE=${WBFS1}
elif test -f "${PATCHIMAGE_WBFS_DIR}"/"${WBFS_MASK}".wbfs; then elif [[ -f ${ISO1} ]]; then
x=4 x=4
IMAGE="${PATCHIMAGE_WBFS_DIR}"/"${WBFS_MASK}".wbfs IMAGE=${ISO1}
else else
echo -e "please specify image to use with --iso=<path>" echo -e "please specify image to use with --iso=<path>"
exit 15 exit 15
@ -239,30 +244,33 @@ check_input_image () {
fi fi
echo "*** >> status: ${x}" echo "*** >> status: ${x}"
IMAGE=$(readlink -m "${IMAGE}")
} }
check_input_rom () { check_input_rom () {
x=5 x=5
if [[ ! ${ROM} ]]; then if [[ ! ${ROM} ]]; then
ROM=$(find . -name "${ROM_MASK}" | sed -e 's,./,,') ROM0=$(find . -maxdepth 1 -name "${ROM_MASK}")
if [[ -f ${ROM} ]]; then ROM1=$(find "${PATCHIMAGE_3DS_DIR}" -name "${ROM_MASK}")
if [[ -f ${ROM0} ]]; then
x=6 x=6
ROM="${ROM}" ROM=${ROM0}
elif [[ -f ${ROM1} ]]; then
x=7
ROM=${ROM1}
else else
ROM=$(find "${PATCHIMAGE_3DS_DIR}" -name "${ROM_MASK}") if [[ ! ${HANS_MULTI_SOURCE} ]]; then
if [[ -f ${ROM} ]]; then echo -e "error: could not find suitable ROM, specify using --rom"
x=7 exit 15
ROM="${ROM}"
else
if [[ ! ${HANS_MULTI_SOURCE} ]]; then
echo -e "error: could not find suitable ROM, specify using --rom"
exit 15
fi
fi fi
fi fi
fi fi
echo "*** >> status: ${x}" echo "*** >> status: ${x}"
ROM=$(readlink -m "${ROM}")
} }
show_nsmb_db () { show_nsmb_db () {