From 1c4661906a0ccab25f340983cc7f029968ff245b Mon Sep 17 00:00:00 2001 From: David A Brown Date: Wed, 7 Feb 2024 16:59:46 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20FIX:=20Issue=20#8=20bash=20synta?= =?UTF-8?q?x=20for=20older=20versions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quickget_plugins/alma.plug | 8 +++-- quickget_plugins/alpine.plug | 8 +++-- quickget_plugins/android.plug | 46 ++++++++++++++++++++++++++++- quickget_plugins/archcraft.plug | 8 +++-- quickget_plugins/archlinux.plug | 8 +++-- quickget_plugins/arcolinuxb.plug | 9 ++++-- quickget_plugins/arcolinuxd.plug | 9 ++++-- quickget_plugins/arcolinuxl.plug | 11 +++++-- quickget_plugins/arcolinuxs.plug | 11 +++++-- quickget_plugins/batocera.plug | 8 +++-- quickget_plugins/blendos.plug | 8 +++-- quickget_plugins/bodhi.plug | 8 +++-- quickget_plugins/bunsenlabs.plug | 8 +++-- quickget_plugins/cachyos.plug | 8 +++-- quickget_plugins/centos-stream.plug | 8 +++-- quickget_plugins/garuda.plug | 8 +++-- quickget_plugins/template | 14 +++++---- quickget_plugins/void.plug | 9 ++++-- 18 files changed, 156 insertions(+), 41 deletions(-) diff --git a/quickget_plugins/alma.plug b/quickget_plugins/alma.plug index afb559bd8f..deafe8a293 100644 --- a/quickget_plugins/alma.plug +++ b/quickget_plugins/alma.plug @@ -16,7 +16,9 @@ function get_distro_info() { distro_info['iso']="AlmaLinux-${RELEASE}-latest-x86_64-${EDITION}.iso" distro_info['hash']="$(wget -q -O- "${distro_info['url']}"/CHECKSUM | grep \("${distro_info['iso']}"\) | cut -d' ' -f4)" - echo "${distro_info[@]@k}" + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } # Use this function to override the standard function in quickget @@ -45,7 +47,9 @@ function editions() { editions[${release}]="boot!minimal!dvd" done - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro diff --git a/quickget_plugins/alpine.plug b/quickget_plugins/alpine.plug index 52022fa104..0a14da2fb0 100644 --- a/quickget_plugins/alpine.plug +++ b/quickget_plugins/alpine.plug @@ -22,7 +22,9 @@ function get_distro_info() { distro_info['iso']="alpine-virt-${version}-x86_64.iso" distro_info['hash']=$(wget -qO- "${distro_info['url']}/latest-releases.yaml" | awk '/"Xen"/{found=0} {if(found) print} /"Virtual"/{found=1}' | grep 'sha256:' | awk '{print $2}') - echo "${distro_info[@]@k}" + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } # Use this function to override the standard function in quickget @@ -51,7 +53,9 @@ function editions() { editions[${release}]="" done - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro diff --git a/quickget_plugins/android.plug b/quickget_plugins/android.plug index 9cebb51fc6..d22a4d54ff 100644 --- a/quickget_plugins/android.plug +++ b/quickget_plugins/android.plug @@ -28,7 +28,51 @@ function get_distro_info() { fi done - echo "${distro_info[@]@k}" + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done +} + +#function get_file() { +# # This function can be used to over rid the standard function in quickget +# # if you distribution requires something special. Windows and Mac are examples.. +#} + +# This function returns supported OS releases for the OS +# Change this function for your distro +function releases() { + echo latest +} + +# This function returns an associative array with releases as the key +# and a "!" separated string of valid editions for the specific release. +# While quite often editions are the same for all releases it is not always +# the case. +# Editions have different meanings for different OS's +# Change this function for your distro +function editions() { + declare -A editions + local release + + for release in $(releases); do + editions[${release}]="boot!minimal!dvd" + done + + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done +} + +# Change this function for your distro +# Returning 0 means editions are required and 1 not required +function editions_required() { + return 0 +} + +# This function returns an expanded OS name for pretty printing +# Change this function for your distro +function pretty_name() { + echo "Alma Linux" } # Use this function to override the standard function in quickget diff --git a/quickget_plugins/archcraft.plug b/quickget_plugins/archcraft.plug index 211d633f91..b8b274e321 100644 --- a/quickget_plugins/archcraft.plug +++ b/quickget_plugins/archcraft.plug @@ -21,7 +21,9 @@ function get_distro_info() { distro_info['iso']=${fullrul##*/} distro_info['hash']="$(wget -q -O- "${fullrul}.sha256sum" | cut -d " " -f1)" - echo "${distro_info[@]@k}" + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } # Use this function to override the standard function in quickget @@ -50,7 +52,9 @@ function editions() { editions[${release}]="" done - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro diff --git a/quickget_plugins/archlinux.plug b/quickget_plugins/archlinux.plug index 9a8f308f86..77825b1644 100644 --- a/quickget_plugins/archlinux.plug +++ b/quickget_plugins/archlinux.plug @@ -16,7 +16,9 @@ function get_distro_info() { distro_info['iso']=$(wget -q -O- "https://archlinux.org/releng/releases/json/" | jq -r '.releases[0].iso_url') distro_info['hash']=$(wget -q -O- "https://archlinux.org/releng/releases/json/" | jq -r '.releases[0].sha256_sum') - echo "${distro_info[@]@k}" + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } # Use this function to override the standard function in quickget @@ -47,7 +49,9 @@ function editions() { editions[${release}]="" done - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro diff --git a/quickget_plugins/arcolinuxb.plug b/quickget_plugins/arcolinuxb.plug index f3224956f0..3960cdaa01 100644 --- a/quickget_plugins/arcolinuxb.plug +++ b/quickget_plugins/arcolinuxb.plug @@ -15,7 +15,10 @@ function get_distro_info() { distro_info['url']="https://ant.seedhost.eu/arcolinux/iso" distro_info['iso']="${RELEASE}/arcolinuxb-${EDITION}-${RELEASE}-x86_64.iso" distro_info['hash']="$(curl -s "${distro_info['url']}/${distro_info['iso']}.sha256" | cut -d' ' -f1)" - echo "${distro_info[@]@k}" + + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } # Use this function to override the standard function in quickget @@ -57,7 +60,9 @@ function editions() { editions['v24.01.04']="hyprland!wayfire" editions['v24.02.01']="hyprland!sway!wayfire" - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro diff --git a/quickget_plugins/arcolinuxd.plug b/quickget_plugins/arcolinuxd.plug index d200a8b032..6149780944 100644 --- a/quickget_plugins/arcolinuxd.plug +++ b/quickget_plugins/arcolinuxd.plug @@ -15,7 +15,10 @@ function get_distro_info() { distro_info['url']="https://ant.seedhost.eu/arcolinux/iso" distro_info['iso']="${RELEASE}/arcolinuxd-${RELEASE}-x86_64.iso" distro_info['hash']="$(curl -s "${distro_info['url']}/${distro_info['iso']}.sha256" | cut -d' ' -f1)" - echo "${distro_info[@]@k}" + + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } # Use this function to override the standard function in quickget @@ -66,7 +69,9 @@ function editions() { editions['v24.01.04']="" editions['v24.02.01']="" - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro diff --git a/quickget_plugins/arcolinuxl.plug b/quickget_plugins/arcolinuxl.plug index 361a1c5c32..486723e9e1 100644 --- a/quickget_plugins/arcolinuxl.plug +++ b/quickget_plugins/arcolinuxl.plug @@ -15,7 +15,10 @@ function get_distro_info() { distro_info['url']="https://ant.seedhost.eu/arcolinux/iso" distro_info['iso']="${RELEASE}/arcolinuxl-${RELEASE}-x86_64.iso" distro_info['hash']="$(curl -s "${distro_info['url']}/${distro_info['iso']}.sha256" | cut -d' ' -f1)" - echo "${distro_info[@]@k}" + + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } # Use this function to override the standard function in quickget @@ -27,7 +30,7 @@ function get_distro_info() { # This function returns supported OS releases for the OS # Change this function for your distro function releases() { - echo v22.01.10 v22.03.07 v22.04.02 v22.05.02 v22.06.07 v22.07.03 v22.09.04 v22.10.02 v22.11.02 v22.12.02 v23.01.03 v23.02.02 v23.03.01 v23.04.03 v23.05.04 v23.06.02 v23.07.01 v23.09.03 v23.10.01 v23.11.03 v23.12.03 v24.01.04 v24.02.01 + echo v22.01.10 v22.03.07 v22.04.02 v22.05.02 v22.06.07 v22.07.03 v22.09.04 v22.10.02 v22.11.02 v22.12.02 v23.01.03 v23.02.02 v23.03.01 v23.04.03 v23.05.04 v23.06.02 v23.07.01 v23.09.03 v23.10.01 v23.11.03 v23.12.03 v24.01.04 } # This function returns an associative array with releases as the key @@ -66,7 +69,9 @@ function editions() { editions['v24.01.04']="" editions['v24.02.01']="" - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro diff --git a/quickget_plugins/arcolinuxs.plug b/quickget_plugins/arcolinuxs.plug index da2403502b..debab3f3ec 100644 --- a/quickget_plugins/arcolinuxs.plug +++ b/quickget_plugins/arcolinuxs.plug @@ -19,7 +19,10 @@ function get_distro_info() { distro_info['iso']="${RELEASE}/arcolinuxs-${EDITION}-${RELEASE}-x86_64.iso" fi distro_info['hash']="$(curl -s "${distro_info['url']}/${distro_info['iso']}.sha256" | cut -d' ' -f1)" - echo "${distro_info[@]@k}" + + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } # Use this function to override the standard function in quickget @@ -31,7 +34,7 @@ function get_distro_info() { # This function returns supported OS releases for the OS # Change this function for your distro function releases() { - echo v22.01.10 v22.03.07 v22.04.02 v22.05.02 v22.06.07 v22.07.03 v22.09.04 v22.10.02 v22.11.02 v22.12.02 v23.01.03 v23.02.02 v23.03.01 v23.04.03 v23.05.04 v23.06.02 v23.07.01 v23.09.03 v23.10.01 v23.11.03 v23.12.03 v24.01.04 v24.02.01 + echo v22.01.10 v22.03.07 v22.04.02 v22.05.02 v22.06.07 v22.07.03 v22.09.04 v22.10.02 v22.11.02 v22.12.02 v23.01.03 v23.02.02 v23.03.01 v23.04.03 v23.05.04 v23.06.02 v23.07.01 v23.09.03 v23.10.01 v23.11.03 v23.12.03 v24.01.04 } # This function returns an associative array with releases as the key @@ -70,7 +73,9 @@ function editions() { editions['v24.01.04']="base!lts!hardend!zen" editions['v24.02.01']="base!lts!hardend!zen" - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro diff --git a/quickget_plugins/batocera.plug b/quickget_plugins/batocera.plug index cc652eb19b..a69feb8997 100644 --- a/quickget_plugins/batocera.plug +++ b/quickget_plugins/batocera.plug @@ -18,7 +18,9 @@ function get_distro_info() { distro_info['iso']="$(curl -sl "${distro_info['url']}"/ | grep -e 'batocera.*img.gz'|cut -d\" -f2)" #set +x - echo "${distro_info[@]@k}" + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } # Use this function to override the standard function in quickget @@ -71,7 +73,9 @@ function editions() { editions[${release}]="boot!minimal!dvd" done - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro diff --git a/quickget_plugins/blendos.plug b/quickget_plugins/blendos.plug index 6e881ba465..96d213ac47 100644 --- a/quickget_plugins/blendos.plug +++ b/quickget_plugins/blendos.plug @@ -19,7 +19,9 @@ function get_distro_info() { distro_info['hash']="$(wget -q -O- "${distro_info['url']}"/"${EDITION}"/"${release}"/update.iso.sha512sum/download \ | cut -d' ' -f1)" - echo "${distro_info[@]@k}" + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } # Use this function to override the standard function in quickget @@ -65,7 +67,9 @@ function editions() { editions[${release}]=$(grep "${release}" "${TMPDIR}"/blendos.info | cut -f 2 -d " " | sort -u | tr "\n" "!" | sed "s/!$//") done - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro diff --git a/quickget_plugins/bodhi.plug b/quickget_plugins/bodhi.plug index c31cab7031..1b424e44fd 100644 --- a/quickget_plugins/bodhi.plug +++ b/quickget_plugins/bodhi.plug @@ -20,7 +20,9 @@ function get_distro_info() { esac distro_info['hash']=$(wget -q -O- "${distro_info['url']}/${distro_info['iso']}.sha256" | cut -d' ' -f1) - echo "${distro_info[@]@k}" + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } # Use this function to override the standard function in quickget @@ -49,7 +51,9 @@ function editions() { editions[${release}]="standard!hwe!s76" done - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro diff --git a/quickget_plugins/bunsenlabs.plug b/quickget_plugins/bunsenlabs.plug index 21615f3e99..5035f54a64 100644 --- a/quickget_plugins/bunsenlabs.plug +++ b/quickget_plugins/bunsenlabs.plug @@ -15,8 +15,10 @@ function get_distro_info() { distro_info['url']="https://ddl.bunsenlabs.org/ddl" distro_info['iso']="beryllium-1-amd64.hybrid.iso" distro_info['hash']="$(wget -q -O- "${distro_info['url']}/release.sha256.txt" | head -1 | cut -d' ' -f1)" - echo "${distro_info[@]@k}" + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } # Use this function to override the standard function in quickget @@ -45,7 +47,9 @@ function editions() { editions[${release}]="" done - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro diff --git a/quickget_plugins/cachyos.plug b/quickget_plugins/cachyos.plug index 0ccec6dd7a..1224226d07 100644 --- a/quickget_plugins/cachyos.plug +++ b/quickget_plugins/cachyos.plug @@ -16,7 +16,9 @@ function get_distro_info() { distro_info['iso']="cachyos-${EDITION}-linux-${RELEASE}.iso" distro_info['hash']="$(wget -q -O- "${distro_info['url']}/${distro_info['iso']}.sha256" | cut -d' ' -f1)" - echo "${distro_info[@]@k}" + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } # Use this function to override the standard function in quickget @@ -45,7 +47,9 @@ function editions() { editions[${release}]="gnome!kde" done - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro diff --git a/quickget_plugins/centos-stream.plug b/quickget_plugins/centos-stream.plug index 56b83a41eb..968f1a8968 100644 --- a/quickget_plugins/centos-stream.plug +++ b/quickget_plugins/centos-stream.plug @@ -25,7 +25,9 @@ function get_distro_info() { ;; esac - echo "${distro_info[@]@k}" + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } # Use this function to override the standard function in quickget @@ -54,7 +56,9 @@ function editions() { editions[${release}]="boot!dvd1" done - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro diff --git a/quickget_plugins/garuda.plug b/quickget_plugins/garuda.plug index 981a0ba790..537781e5c5 100644 --- a/quickget_plugins/garuda.plug +++ b/quickget_plugins/garuda.plug @@ -20,7 +20,9 @@ function get_distro_info() { distro_info['iso']="${EDITION}/latest.iso" distro_info['hash']="$(wget -q -O- "${distro_info['url']}/${distro_info['iso']}.sha256" | cut -d' ' -f1)" - echo "${distro_info[@]@k}" + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } # Use this function to override the standard function in quickget @@ -49,7 +51,9 @@ function editions() { editions[${release}]="cinnamon!dr460nized!dr460nized-gaming!gnome!i3!kde-git!kde-lite!lxqt-kwin!mate!qtile!sway!wayfire!xfce!hyprland" done - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro diff --git a/quickget_plugins/template b/quickget_plugins/template index 5eee9b8185..0abd6fbf47 100644 --- a/quickget_plugins/template +++ b/quickget_plugins/template @@ -1,5 +1,5 @@ #!/usr/bin/bash - +# # This template identifies the functions required to supported by each OS #function create_vm() { @@ -15,7 +15,9 @@ function get_distro_info() { distro_info['iso']="AlmaLinux-${RELEASE}-latest-x86_64-${EDITION}.iso" distro_info['hash']="$(wget -q -O- "${distro_info['url']}"/CHECKSUM | grep \("${distro_info['iso']}"\) | cut -d' ' -f4)" - echo "${distro_info[@]@k}" + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } #function get_file() { @@ -43,7 +45,9 @@ function editions() { editions[${release}]="boot!minimal!dvd" done - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro @@ -71,9 +75,7 @@ function make_vm_config() { default_vm_config # Override any default settings - sed -i 's/guest_os=.*/guest_os="batocera"/' "${VM_PATH}".conf - sed -i 's/^disk_size=.*/disk_size=\"80G\"/' "${VM_PATH}".conf - sed -i 's/iso=/img=/' "${VM_PATH}".conf + #sed -i 's/^disk_size=.*/disk_size=\"80G\"/' "${VM_PATH}".conf # Add any additional lines # { diff --git a/quickget_plugins/void.plug b/quickget_plugins/void.plug index 4920f7f2fb..8c89c68579 100644 --- a/quickget_plugins/void.plug +++ b/quickget_plugins/void.plug @@ -22,7 +22,10 @@ function get_distro_info() { esac distro_info['hash']=$(wget -q -O- "${distro_info['url']}/sha256sum.txt" | grep "${distro_info['iso']}" | cut -d' ' -f4) - echo "${distro_info[@]@k}" + + for key in "${!distro_info[@]}"; do + echo "${key}" "${distro_info[${key}]}" + done } # Use this function to override the standard function in quickget @@ -51,7 +54,9 @@ function editions() { editions[${release}]="glibc!musl!xfce-glibc!xfce-musl" done - echo "${editions[@]@k}" + for key in "${!editions[@]}"; do + echo "${key}" "${editions[${key}]}" + done } # Change this function for your distro