mirror of
https://gitlab.com/Nanolx/patchimage.git
synced 2024-11-28 03:54:22 +01:00
move nsmbw version-detection into a function (no duplicated code)
This commit is contained in:
parent
2f225e71d7
commit
80d8f23068
@ -48,25 +48,7 @@ check_input_image_special () {
|
|||||||
detect_game_version () {
|
detect_game_version () {
|
||||||
|
|
||||||
|
|
||||||
if [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232911 ]]; then
|
nsmbw_version
|
||||||
VERSION=EURv1
|
|
||||||
REG_LETTER=P
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_152101 ]]; then
|
|
||||||
VERSION=EURv2
|
|
||||||
REG_LETTER=P
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232303 ]]; then
|
|
||||||
VERSION=USAv1
|
|
||||||
REG_LETTER=E
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_143554 ]]; then
|
|
||||||
VERSION=USAv2
|
|
||||||
REG_LETTER=E
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_231655 ]]; then
|
|
||||||
VERSION=JPNv1
|
|
||||||
REG_LETTER=J
|
|
||||||
elif [[ ! ${VERSION} ]]; then
|
|
||||||
echo -e "please specify your games version using --version={EURv1,USAv1,USAv2}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
GAMEID=SMN${REG_LETTER}05
|
GAMEID=SMN${REG_LETTER}05
|
||||||
CUSTOM_BANNER=http://dl.dropboxusercontent.com/u/101209384/${GAMEID}.bnr
|
CUSTOM_BANNER=http://dl.dropboxusercontent.com/u/101209384/${GAMEID}.bnr
|
||||||
|
@ -46,26 +46,7 @@ check_input_image_special () {
|
|||||||
|
|
||||||
detect_game_version () {
|
detect_game_version () {
|
||||||
|
|
||||||
|
nsmbw_version
|
||||||
if [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232911 ]]; then
|
|
||||||
VERSION=EURv1
|
|
||||||
REG_LETTER=P
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_152101 ]]; then
|
|
||||||
VERSION=EURv2
|
|
||||||
REG_LETTER=P
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232303 ]]; then
|
|
||||||
VERSION=USAv1
|
|
||||||
REG_LETTER=E
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_143554 ]]; then
|
|
||||||
VERSION=USAv2
|
|
||||||
REG_LETTER=E
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_231655 ]]; then
|
|
||||||
VERSION=JPNv1
|
|
||||||
REG_LETTER=J
|
|
||||||
elif [[ ! ${VERSION} ]]; then
|
|
||||||
echo -e "please specify your games version using --version={EURv1,EURv2,USAv1,USAv2,JPNv1}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
GAMEID=SMN${REG_LETTER}04
|
GAMEID=SMN${REG_LETTER}04
|
||||||
CUSTOM_BANNER=http://dl.dropboxusercontent.com/u/101209384/${GAMEID}.bnr
|
CUSTOM_BANNER=http://dl.dropboxusercontent.com/u/101209384/${GAMEID}.bnr
|
||||||
|
@ -76,6 +76,30 @@ download_banner () {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsmbw_version () {
|
||||||
|
|
||||||
|
if [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232911 ]]; then
|
||||||
|
VERSION=EURv1
|
||||||
|
REG_LETTER=P
|
||||||
|
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_152101 ]]; then
|
||||||
|
VERSION=EURv2
|
||||||
|
REG_LETTER=P
|
||||||
|
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232303 ]]; then
|
||||||
|
VERSION=USAv1
|
||||||
|
REG_LETTER=E
|
||||||
|
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_143554 ]]; then
|
||||||
|
VERSION=USAv2
|
||||||
|
REG_LETTER=E
|
||||||
|
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_231655 ]]; then
|
||||||
|
VERSION=JPNv1
|
||||||
|
REG_LETTER=J
|
||||||
|
elif [[ ! ${VERSION} ]]; then
|
||||||
|
echo -e "please specify your games version using --version={EURv1,EURv2,USAv1,USAv2,JPNv1}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
apply_banner () {
|
apply_banner () {
|
||||||
|
|
||||||
if [[ ${BANNER} != "" ]]; then
|
if [[ ${BANNER} != "" ]]; then
|
||||||
|
@ -43,26 +43,7 @@ check_input_image_special () {
|
|||||||
|
|
||||||
detect_game_version () {
|
detect_game_version () {
|
||||||
|
|
||||||
|
nsmbw_version
|
||||||
if [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232911 ]]; then
|
|
||||||
VERSION=EURv1
|
|
||||||
REG_LETTER=P
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_152101 ]]; then
|
|
||||||
VERSION=EURv2
|
|
||||||
REG_LETTER=P
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232303 ]]; then
|
|
||||||
VERSION=USAv1
|
|
||||||
REG_LETTER=E
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_143554 ]]; then
|
|
||||||
VERSION=USAv2
|
|
||||||
REG_LETTER=E
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_231655 ]]; then
|
|
||||||
VERSION=JPNv1
|
|
||||||
REG_LETTER=J
|
|
||||||
elif [[ ! ${VERSION} ]]; then
|
|
||||||
echo -e "please specify your games version using --version={EURv1,EURv2,USAv1,USAv2,JPNv1}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
GAMEID=SMN${REG_LETTER}08
|
GAMEID=SMN${REG_LETTER}08
|
||||||
|
|
||||||
|
@ -51,26 +51,7 @@ check_input_image_special () {
|
|||||||
|
|
||||||
detect_game_version () {
|
detect_game_version () {
|
||||||
|
|
||||||
|
nsmbw_version
|
||||||
if [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232911 ]]; then
|
|
||||||
VERSION=EURv1
|
|
||||||
REG_LETTER=P
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_152101 ]]; then
|
|
||||||
VERSION=EURv2
|
|
||||||
REG_LETTER=P
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232303 ]]; then
|
|
||||||
VERSION=USAv1
|
|
||||||
REG_LETTER=E
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_143554 ]]; then
|
|
||||||
VERSION=USAv2
|
|
||||||
REG_LETTER=E
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_231655 ]]; then
|
|
||||||
VERSION=JPNv1
|
|
||||||
REG_LETTER=J
|
|
||||||
elif [[ ! ${VERSION} ]]; then
|
|
||||||
echo -e "please specify your games version using --version={EURv1,EURv2,USAv1,USAv2,JPNv1}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
GAMEID=SMN${REG_LETTER}10
|
GAMEID=SMN${REG_LETTER}10
|
||||||
|
|
||||||
|
@ -47,26 +47,7 @@ check_input_image_special () {
|
|||||||
|
|
||||||
detect_game_version () {
|
detect_game_version () {
|
||||||
|
|
||||||
|
nsmbw_version
|
||||||
if [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232911 ]]; then
|
|
||||||
VERSION=EURv1
|
|
||||||
REG_LETTER=P
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_152101 ]]; then
|
|
||||||
VERSION=EURv2
|
|
||||||
REG_LETTER=P
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232303 ]]; then
|
|
||||||
VERSION=USAv1
|
|
||||||
REG_LETTER=E
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_143554 ]]; then
|
|
||||||
VERSION=USAv2
|
|
||||||
REG_LETTER=E
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_231655 ]]; then
|
|
||||||
VERSION=JPNv1
|
|
||||||
REG_LETTER=J
|
|
||||||
elif [[ ! ${VERSION} ]]; then
|
|
||||||
echo -e "please specify your games version using --version={EURv1,EURv2,USAv1,USAv2,JPNv1}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
XML_FILE="${XML_FILE}"${REG_LETTER}.xml
|
XML_FILE="${XML_FILE}"${REG_LETTER}.xml
|
||||||
GAMEID=SMN${REG_LETTER}07
|
GAMEID=SMN${REG_LETTER}07
|
||||||
|
@ -47,25 +47,7 @@ check_input_image_special () {
|
|||||||
|
|
||||||
detect_game_version () {
|
detect_game_version () {
|
||||||
|
|
||||||
if [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232911 ]]; then
|
nsmbw_version
|
||||||
VERSION=EURv1
|
|
||||||
REG_LETTER=P
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_152101 ]]; then
|
|
||||||
VERSION=EURv2
|
|
||||||
REG_LETTER=P
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232303 ]]; then
|
|
||||||
VERSION=USAv1
|
|
||||||
REG_LETTER=E
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_143554 ]]; then
|
|
||||||
VERSION=USAv2
|
|
||||||
REG_LETTER=E
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_231655 ]]; then
|
|
||||||
VERSION=JPNv1
|
|
||||||
REG_LETTER=J
|
|
||||||
elif [[ ! ${VERSION} ]]; then
|
|
||||||
echo -e "please specify your games version using --version={EURv1,EURv2,USAv1,USAv2,JPNv1}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
GAMEID=SMN${REG_LETTER}03
|
GAMEID=SMN${REG_LETTER}03
|
||||||
CUSTOM_BANNER=http://dl.dropboxusercontent.com/u/101209384/${GAMEID}.bnr
|
CUSTOM_BANNER=http://dl.dropboxusercontent.com/u/101209384/${GAMEID}.bnr
|
||||||
|
@ -46,26 +46,7 @@ check_input_image_special () {
|
|||||||
|
|
||||||
detect_game_version () {
|
detect_game_version () {
|
||||||
|
|
||||||
|
nsmbw_version
|
||||||
if [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232911 ]]; then
|
|
||||||
VERSION=EURv1
|
|
||||||
REG_LETTER=P
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_152101 ]]; then
|
|
||||||
VERSION=EURv2
|
|
||||||
REG_LETTER=P
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232303 ]]; then
|
|
||||||
VERSION=USAv1
|
|
||||||
REG_LETTER=E
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_143554 ]]; then
|
|
||||||
VERSION=USAv2
|
|
||||||
REG_LETTER=E
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_231655 ]]; then
|
|
||||||
VERSION=JPNv1
|
|
||||||
REG_LETTER=J
|
|
||||||
elif [[ ! ${VERSION} ]]; then
|
|
||||||
echo -e "please specify your games version using --version={EURv1,EURv2,USAv1,USAv2,JPNv1}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
GAMEID=SMN${REG_LETTER}06
|
GAMEID=SMN${REG_LETTER}06
|
||||||
CUSTOM_BANNER=http://dl.dropboxusercontent.com/u/101209384/${GAMEID}.bnr
|
CUSTOM_BANNER=http://dl.dropboxusercontent.com/u/101209384/${GAMEID}.bnr
|
||||||
|
@ -42,26 +42,7 @@ check_input_image_special () {
|
|||||||
|
|
||||||
detect_game_version () {
|
detect_game_version () {
|
||||||
|
|
||||||
|
nsmbw_version
|
||||||
if [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232911 ]]; then
|
|
||||||
VERSION=EURv1
|
|
||||||
REG_LETTER=P
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_152101 ]]; then
|
|
||||||
VERSION=EURv2
|
|
||||||
REG_LETTER=P
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_232303 ]]; then
|
|
||||||
VERSION=USAv1
|
|
||||||
REG_LETTER=E
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2010-01-05_143554 ]]; then
|
|
||||||
VERSION=USAv2
|
|
||||||
REG_LETTER=E
|
|
||||||
elif [[ -f ${WORKDIR}/files/COPYDATE_LAST_2009-10-03_231655 ]]; then
|
|
||||||
VERSION=JPNv1
|
|
||||||
REG_LETTER=J
|
|
||||||
elif [[ ! ${VERSION} ]]; then
|
|
||||||
echo -e "please specify your games version using --version={EURv1,EURv2,USAv1,USAv2,JPNv1}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
GAMEID=SMN${REG_LETTER}11
|
GAMEID=SMN${REG_LETTER}11
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user