From 936d4f9aa445c5b36bac0d1afa3575141ccfbbca Mon Sep 17 00:00:00 2001 From: Kroese Date: Wed, 22 May 2024 00:55:52 +0200 Subject: [PATCH] fix: Custom URL parsing (#129) --- Dockerfile | 2 +- src/define.sh | 11 ++++++----- src/entry.sh | 1 - src/install.sh | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 50bc4b5..61da294 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM scratch -COPY --from=qemux/qemu-arm:2.00 / / +COPY --from=qemux/qemu-arm:2.01 / / ARG VERSION_ARG="0.0" ARG DEBCONF_NOWARNINGS="yes" diff --git a/src/define.sh b/src/define.sh index c0cf071..afa01d7 100644 --- a/src/define.sh +++ b/src/define.sh @@ -17,8 +17,6 @@ PLATFORM="ARM64" parseVersion() { - VERSION="${VERSION/\//}" - if [[ "${VERSION}" == \"*\" || "${VERSION}" == \'*\' ]]; then VERSION="${VERSION:1:-1}" fi @@ -216,7 +214,10 @@ getLanguage() { parseLanguage() { - LANGUAGE="${LANGUAGE/_/-/}" + REGION="${REGION//_/-/}" + KEYBOARD="${KEYBOARD//_/-/}" + LANGUAGE="${LANGUAGE//_/-/}" + [ -z "$LANGUAGE" ] && LANGUAGE="en" case "${LANGUAGE,,}" in @@ -312,7 +313,7 @@ fromFile() { local file="${1,,}" local arch="${PLATFORM,,}" - case "${file/ /_}" in + case "${file// /_}" in *"_x64_"* | *"_x64."*) arch="x64" ;; @@ -324,7 +325,7 @@ fromFile() { ;; esac - case "${file/ /_}" in + case "${file// /_}" in "win10"*| "win_10"* | *"windows10"* | *"windows_10"* ) id="win10${arch}" ;; diff --git a/src/entry.sh b/src/entry.sh index 014d299..bfa7498 100644 --- a/src/entry.sh +++ b/src/entry.sh @@ -24,7 +24,6 @@ cd /run trap - ERR info "Booting ${APP}${BOOT_DESC}..." -[[ "$DEBUG" == [Yy1]* ]] && echo "Arguments: $ARGS" && echo { qemu-system-aarch64 ${ARGS:+ $ARGS} >"$QEMU_OUT" 2>"$QEMU_LOG"; rc=$?; } || : (( rc != 0 )) && error "$(<"$QEMU_LOG")" && exit 15 diff --git a/src/install.sh b/src/install.sh index 5aefed4..9f3bba2 100644 --- a/src/install.sh +++ b/src/install.sh @@ -65,7 +65,7 @@ startInstall() { if [ -z "$CUSTOM" ]; then - local file="${VERSION/\//}.iso" + local file="${VERSION//\//}.iso" if [[ "${VERSION,,}" == "http"* ]]; then @@ -80,7 +80,7 @@ startInstall() { language="${language%%-*}" if [ -n "$language" ] && [[ "${language,,}" != "en" ]]; then - file="${VERSION/\//}_${language,,}.iso" + file="${VERSION//\//}_${language,,}.iso" fi fi @@ -675,8 +675,8 @@ updateImage() { local asset="$2" local language="$3" local file="autounattend.xml" - local org="${file/.xml/.org}" - local dat="${file/.xml/.dat}" + local org="${file//.xml/.org}" + local dat="${file//.xml/.dat}" local desc path src loc xml index result [[ "${DETECTED,,}" == "winxp"* ]] && return 0