Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Custom URL parsing #129

Merged
merged 5 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
11 changes: 6 additions & 5 deletions src/define.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ PLATFORM="ARM64"

parseVersion() {

VERSION="${VERSION/\//}"

if [[ "${VERSION}" == \"*\" || "${VERSION}" == \'*\' ]]; then
VERSION="${VERSION:1:-1}"
fi
Expand Down Expand Up @@ -216,7 +214,10 @@ getLanguage() {

parseLanguage() {

LANGUAGE="${LANGUAGE/_/-/}"
REGION="${REGION//_/-/}"
KEYBOARD="${KEYBOARD//_/-/}"
LANGUAGE="${LANGUAGE//_/-/}"

[ -z "$LANGUAGE" ] && LANGUAGE="en"

case "${LANGUAGE,,}" in
Expand Down Expand Up @@ -312,7 +313,7 @@ fromFile() {
local file="${1,,}"
local arch="${PLATFORM,,}"

case "${file/ /_}" in
case "${file// /_}" in
*"_x64_"* | *"_x64."*)
arch="x64"
;;
Expand All @@ -324,7 +325,7 @@ fromFile() {
;;
esac

case "${file/ /_}" in
case "${file// /_}" in
"win10"*| "win_10"* | *"windows10"* | *"windows_10"* )
id="win10${arch}"
;;
Expand Down
1 change: 0 additions & 1 deletion src/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ startInstall() {

if [ -z "$CUSTOM" ]; then

local file="${VERSION/\//}.iso"
local file="${VERSION//\//}.iso"

if [[ "${VERSION,,}" == "http"* ]]; then

Expand All @@ -80,7 +80,7 @@ startInstall() {
language="${language%%-*}"

if [ -n "$language" ] && [[ "${language,,}" != "en" ]]; then
file="${VERSION/\//}_${language,,}.iso"
file="${VERSION//\//}_${language,,}.iso"
fi

fi
Expand Down Expand Up @@ -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
Expand Down