Skip to content

Commit

Permalink
Merge branch '1st' into new-master-backup
Browse files Browse the repository at this point in the history
  • Loading branch information
zen0bit committed Dec 23, 2023
2 parents cd3a5b7 + c1c77de commit 3a821b1
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 40 deletions.
5 changes: 4 additions & 1 deletion quickemu
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,10 @@ if [ -n "${VM}" ] && [ -e "${VM}" ]; then
VMPATH=$(realpath "$(dirname "${VM}")")
VM_MONITOR_SOCKETPATH="${VMDIR}/${VMNAME}-monitor.socket"
VM_SERIAL_SOCKETPATH="${VMDIR}/${VMNAME}-serial.socket"

if [ ! -f "${disk_img}" ]; then
cd "${VMPATH}"
fi

# Backwards compatibility for ${driver_iso}
if [ -n "${driver_iso}" ] && [ -z "${fixed_iso}" ]; then
fixed_iso="${driver_iso}"
Expand Down
89 changes: 50 additions & 39 deletions quickget
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export LC_ALL=C
#
# 1. Update os_support() - add new OS, all lowercase
# 2. Update pretty_name() - add a pretty name for new OS *only if the catch all is not suitable*
# 3. Update os_homepages() - add a homepage for new OS
# 3. Update os_homepage() - add a homepage for new OS
# 4. Create a releases_newos() generator (required) outputs the current supported release versions
# 5. Create a editions_newos() generator (optional) outputs the editions if new OS has multiple flavours/editions
# 6. Update make_vm_config() - add any *required* new OS tweaks
Expand Down Expand Up @@ -51,6 +51,15 @@ elif [ "${1}" == '--open-distro-homepage' ] || [ "${1}" == '-o' ]; then
elif [ "${1}" == '--show-distro-homepage' ] || [ "${1}" == '-s' ]; then
show_distro_homepage="on"
set -- "$2"
elif [ "${1}" == '--download-iso' ] || [ "${1}" == '-d' ]; then
download_iso="on"
if [ -n "$4" ]; then
set -- "$2" "$3" "$4"
elif [ -n "$3" ]; then
set -- "$2" "$3"
else
set -- "$2"
fi
fi

function pretty_name() {
Expand Down Expand Up @@ -328,7 +337,7 @@ function os_support() {
zorin
}

function os_homepages(){
function os_homepage(){
local SIMPLE_NAME=""
local HOMEPAGE=""
SIMPLE_NAME="${1}"
Expand Down Expand Up @@ -592,11 +601,11 @@ function editions_android() {
}

function releases_antix() {
echo 21 22 23
echo 21 22 23
}

function editions_antix() {
echo net-sysv core-sysv base-sysv full-sysv net-runit core-runit base-runit full-runit
echo net-sysv core-sysv base-sysv full-sysv net-runit core-runit base-runit full-runit
}

function releases_archlinux() {
Expand Down Expand Up @@ -799,7 +808,7 @@ function releases_kolibrios() {
}

function releases_linuxlite() {
echo 6.0 6.2 6.4 6.6
echo 6.0 6.2 6.4 6.6
}

function releases_linuxmint(){
Expand Down Expand Up @@ -971,11 +980,11 @@ function editions_sparkylinux() {
}

function releases_spiral() {
echo latest
echo latest
}

function editions_spiral() {
echo Plasma XFCE Mate LXQt Gnome Budgie Cinnamon Builder
echo Plasma XFCE Mate LXQt Gnome Budgie Cinnamon Builder
}

function releases_tails() {
Expand Down Expand Up @@ -1103,7 +1112,11 @@ function check_hash() {
local iso=""
local hash=""
local hash_algo=""
iso="${VM_PATH}/${1}"
if [ "${download_iso}" == "on" ]; then
iso="${1}"
else
iso="${VM_PATH}/${1}"
fi
hash="${2}"

# Guess the hash algorithm by the hash length
Expand Down Expand Up @@ -1137,16 +1150,18 @@ function web_get() {
FILE="${URL##*/}"
fi

# Test mode for ISO
if [ "${show_iso_url}" == 'on' ]; then
echo "${URL}"
exit 0
# Test mode for ISO
if [ "${show_iso_url}" == 'on' ]; then
echo "${URL}"
exit 0
elif [ "${test_iso_url}" == 'on' ]; then
wget --spider "${URL}"
exit 0
wget --spider "${URL}"
exit 0
elif [ "${download_iso}" == 'on' ]; then
DIR="$(pwd)"
fi

if ! mkdir -p "${DIR}" 2>/dev/null; then
if [ "${DIR}" != "$(pwd)" ] && ! mkdir -p "${DIR}" 2>/dev/null; then
echo "ERROR! Unable to create directory ${DIR}"
exit 1
fi
Expand All @@ -1170,13 +1185,13 @@ function zsync_get() {
local OUT=""
local URL="${1}"

# Test mode for ISO
if [ "${show_iso_url}" == 'on' ]; then
echo "${URL}"
exit 0
# Test mode for ISO
if [ "${show_iso_url}" == 'on' ]; then
echo "${URL}"
exit 0
elif [ "${test_iso_url}" == 'on' ]; then
wget --spider "${URL}"
exit 0
wget --spider "${URL}"
exit 0
elif command -v zsync &>/dev/null; then
if [ -n "${3}" ]; then
OUT="${3}"
Expand Down Expand Up @@ -1216,6 +1231,10 @@ function make_vm_config() {
local GUEST=""
local SEC_BOOT=""

if [ "${download_iso}" == "on" ]; then
exit 0
fi

IMAGE_FILE="${1}"
ISO_FILE="${2}"
case "${OS}" in
Expand Down Expand Up @@ -2614,13 +2633,13 @@ function get_sparkylinux() {
}

function get_spiral() {
local EDITION="${1:-}"
local HASH=""
local ISO="SpiralLinux_${EDITION}_12.231005_x86-64.iso"
local URL="https://sourceforge.net/projects/spirallinux/files/12.231005"
local EDITION="${1:-}"
local HASH=""
local ISO="SpiralLinux_${EDITION}_12.231005_x86-64.iso"
local URL="https://sourceforge.net/projects/spirallinux/files/12.231005"

HASH=$(wget -q -O- 'https://sourceforge.net/projects/spirallinux/rss?path=/' | grep "${ISO}" | grep 'md5' | cut -d'<' -f3 | cut -d'>' -f2)
echo "${URL}/${ISO}" "${HASH}"
HASH=$(wget -q -O- 'https://sourceforge.net/projects/spirallinux/rss?path=/' | grep "${ISO}" | grep 'md5' | cut -d'<' -f3 | cut -d'>' -f2)
echo "${URL}/${ISO}" "${HASH}"
}

function get_tails() {
Expand Down Expand Up @@ -3395,23 +3414,15 @@ if [ -n "${1}" ]; then
"${WHERE}/quickemu" --version
exit 0
fi
else
echo "ERROR! You must specify an operating system."
echo -n " - Operating Systems: "
os_support
echo "
You can also use this arguments:
Only show distro homepage link
--show-distro-homepage / -s {distro}"
exit 1
else
echo "ERROR! You must specify an operating system."
echo -n " - Operating Systems: "
os_support
echo "
You can also use these arguments
--show-iso-url / -s <distro> <release> <edition> : Show ISO download link
--show-iso-url / -u <distro> <release> <edition> : Show ISO download URL
--test-iso-url / -t <distro> <release> <edition> : Test if ISO is available
--download-iso / -d <distro> <release> <edition> : Download ISO
--open-distro-homepage / -o <distro> : Open distro homepage
--show-distro-homepage / -s <distro> : Show distro homepage link"
exit 1
Expand Down Expand Up @@ -3498,11 +3509,11 @@ if [ -n "${2}" ]; then
fi
else
if [ "${open_distro_homepage}" == 'on' ]; then
HOMEPAGE=$(os_homepages ${OS})
HOMEPAGE=$(os_homepage ${OS})
open_url "${HOMEPAGE}" && exit 0
fi
if [ "${show_distro_homepage}" == 'on' ]; then
HOMEPAGE=$(os_homepages ${OS})
HOMEPAGE=$(os_homepage ${OS})
echo "${HOMEPAGE}" && exit 0
fi
echo "ERROR! You must specify a release."
Expand Down

0 comments on commit 3a821b1

Please sign in to comment.