mirror of
https://github.com/quickemu-project/quickemu.git
synced 2024-06-02 13:05:28 +02:00
Compare commits
21 Commits
9e2a0c78d2
...
3b8e6e6127
Author | SHA1 | Date | |
---|---|---|---|
|
3b8e6e6127 | ||
|
54c81be9ec | ||
|
6de3af7712 | ||
|
e2aaacb3a7 | ||
|
2f3eb67b6e | ||
|
f0026dfe9b | ||
|
61f068004b | ||
|
bc5bb20509 | ||
|
e6cf96e186 | ||
|
5e9dfe758e | ||
|
f86dfcb399 | ||
|
35baebe009 | ||
|
9b4513111c | ||
|
4f0d270fc0 | ||
|
dde4475b1f | ||
|
f4cec8b800 | ||
|
ee9284293d | ||
|
04b37ccf02 | ||
|
2e1b556b93 | ||
|
c693dc9ba7 | ||
|
50817d2dba |
49
.github/workflows/test-quickget.yml
vendored
49
.github/workflows/test-quickget.yml
vendored
|
@ -16,15 +16,15 @@ concurrency:
|
|||
|
||||
jobs:
|
||||
list-all-supported:
|
||||
name: List all supported OS 📝
|
||||
name: Supported OS 📝
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: List all supported OS variants
|
||||
- name: Supported OS variants
|
||||
run: |
|
||||
mkdir -p results
|
||||
./quickget --list | tee -a results/supported.txt
|
||||
echo -e "\nAll supported OS variants: $(wc -l results/supported.txt)"
|
||||
echo -e "\nSupported OS variants: $(wc -l results/supported.txt)"
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: supported
|
||||
|
@ -32,7 +32,7 @@ jobs:
|
|||
retention-days: 1
|
||||
|
||||
list-all-info:
|
||||
name: List all OS info ℹ️
|
||||
name: OS info ℹ️
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
@ -40,12 +40,11 @@ jobs:
|
|||
run: |
|
||||
export TERM=xterm
|
||||
mkdir -p results
|
||||
distros=$(./quickget | sed '/^$/q' | tail -n +3)
|
||||
for os in ${distros}; do
|
||||
echo -e "\n\n ${os}"
|
||||
for os in $(./quickget | sed '/^$/q' | tail -n +3); do
|
||||
./quickget -12345 "${os}" | tee -a results/infos.txt
|
||||
done
|
||||
echo -e "\nOS info: $(grep -c "http" results/infos.txt)"
|
||||
echo -e "\nResults:"
|
||||
echo -e "- OS Info URLs: $(grep -c http results/infos.txt)"
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: infos
|
||||
|
@ -54,7 +53,7 @@ jobs:
|
|||
|
||||
list-all-urls:
|
||||
needs: [list-all-supported]
|
||||
name: List all URLs 🔗
|
||||
name: URLs 🔗
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
@ -68,7 +67,7 @@ jobs:
|
|||
with:
|
||||
path: results
|
||||
merge-multiple: true
|
||||
- name: results
|
||||
- name: Differences ⚖️
|
||||
run: |
|
||||
ls -R results/
|
||||
FOUND=$(grep -c 'http' < results/urls.txt)
|
||||
|
@ -80,7 +79,7 @@ jobs:
|
|||
path: results/urls.txt
|
||||
|
||||
check-all-urls:
|
||||
name: Check all image URLs 💿️
|
||||
name: Check URLs 💿️
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
@ -88,21 +87,17 @@ jobs:
|
|||
run: |
|
||||
export TERM=xterm
|
||||
mkdir -p results
|
||||
./quickget --check | tee -a check.txt
|
||||
cat check.txt | sort > results/checks.txt
|
||||
GOOD=$(grep -c 'http' results/checks.txt)
|
||||
WINDOWS=$(grep -c 'windows' results/checks.txt)
|
||||
ALL=$((GOOD + WINDOWS))
|
||||
FAILED=$(grep -c 'FAIL:' results/checks.txt)
|
||||
SKIPPED=$(grep -c 'SKIP:' results/checks.txt)
|
||||
PASSED=$(grep -c 'PASS:' results/checks.txt)
|
||||
./quickget --check | tee results/checks.txt
|
||||
WINDOWS=$(grep -c "windows-" results/checks.txt)
|
||||
FAILED=$(grep -c ^FAIL results/checks.txt)
|
||||
SKIPPED=$(grep -c ^SKIP results/checks.txt)
|
||||
PASSED=$(grep -c ^PASS results/checks.txt)
|
||||
CHECKED=$((FAILED + SKIPPED + PASSED))
|
||||
FAIL=$(grep 'FAIL:' results/checks.txt | tee -a results/failed.txt)
|
||||
echo -e "\nFAILED: $FAILED"
|
||||
echo "SKIPPED: $SKIPPED"
|
||||
echo "PASSED: $PASSED"
|
||||
echo "$CHECKED/$ALL with skipped Windows"
|
||||
echo -e "Failed:\n$FAIL"
|
||||
echo -e "\nResults:"
|
||||
echo -e "- PASSED:\t${PASSED}"
|
||||
echo -e "- SKIPPED:\t${SKIPPED}\t(of which ${WINDOWS} are Windows)"
|
||||
echo -e "- FAILED:\t${FAILED}\n"
|
||||
grep ^FAIL results/checks.txt | tee results/failed.txt
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: checks
|
||||
|
@ -114,14 +109,14 @@ jobs:
|
|||
|
||||
upload-artifacts:
|
||||
needs: [list-all-info, list-all-urls, check-all-urls]
|
||||
name: Uploading artifacts
|
||||
name: Uploading
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: results
|
||||
merge-multiple: true
|
||||
- name: results
|
||||
- name: Results
|
||||
run: |
|
||||
ls -R results/
|
||||
- uses: actions/upload-artifact@v4
|
||||
|
|
128
quickget
128
quickget
|
@ -1,6 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
export LC_ALL=C
|
||||
# shellcheck disable=SC2317
|
||||
|
||||
# Here the quick 'n dirty guide to adding a new OS to quickget
|
||||
#
|
||||
|
@ -24,7 +23,6 @@ export LC_ALL=C
|
|||
# echo "${URL}/${ISO} ${HASH}"
|
||||
#}
|
||||
|
||||
# shellcheck disable=SC2317
|
||||
function cleanup() {
|
||||
if [ -n "$(jobs -p)" ]; then
|
||||
kill "$(jobs -p)" 2>/dev/null
|
||||
|
@ -144,11 +142,10 @@ function os_info() {
|
|||
echo "${INFO}"
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
function show_os_info() {
|
||||
while getopts ":12345" opt; do
|
||||
case $opt in
|
||||
1|2|3|4|5) os_info "${2}" | cut -d'|' -f"${opt}";;
|
||||
1|2|3|4|5) os_info "${2}" | cut -d'|' -f${opt};;
|
||||
*) error_not_supported_argument;;
|
||||
esac
|
||||
done
|
||||
|
@ -156,10 +153,9 @@ function show_os_info() {
|
|||
|
||||
PRETTY_NAME=$(show_os_info -1 "${OS}")
|
||||
|
||||
# Just in case quickget want use it in future
|
||||
# shellcheck disable=SC2005,SC2317
|
||||
# Just in case quickget want use it
|
||||
function os_homepage(){
|
||||
echo "$(show_os_info -4 "${1}")"
|
||||
echo $(show_os_info -4 "${1}")
|
||||
}
|
||||
|
||||
function error_specify_os() {
|
||||
|
@ -410,7 +406,7 @@ function list_supported() {
|
|||
exit 0
|
||||
}
|
||||
|
||||
function test_result() {
|
||||
function check_result() {
|
||||
local OS="${1}"
|
||||
local RELEASE="${2}"
|
||||
local EDITION="${3:-}"
|
||||
|
@ -432,7 +428,7 @@ function test_result() {
|
|||
fi
|
||||
}
|
||||
|
||||
function test_all() {
|
||||
function check_all() {
|
||||
OS="${1}"
|
||||
os_supported
|
||||
|
||||
|
@ -449,10 +445,10 @@ function test_all() {
|
|||
validate_release releases_"${OS}"
|
||||
URL=$(get_"${OS}" | cut_1 | head -1)
|
||||
if [ "${OPERATION}" == "show" ]; then
|
||||
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}"
|
||||
elif [ "${OPERATION}" == "test" ]; then
|
||||
check_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}"
|
||||
elif [ "${OPERATION}" == "check" ]; then
|
||||
CHECK=$(web_check "${URL}" && echo 'PASS' || echo 'FAIL')
|
||||
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "${CHECK}"
|
||||
check_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "${CHECK}"
|
||||
fi
|
||||
done
|
||||
elif [[ "${OS}" == "windows"* ]]; then
|
||||
|
@ -460,9 +456,9 @@ function test_all() {
|
|||
for LANG in "${LANGS[@]}"; do
|
||||
validate_release releases_"${OS}"
|
||||
if [ "${OPERATION}" == "show" ]; then
|
||||
test_result "${OS}" "${RELEASE}" "${LANG}" ""
|
||||
elif [ "${OPERATION}" == "test" ]; then
|
||||
test_result "${OS}" "${RELEASE}" "${LANG}" "${URL}" "SKIP"
|
||||
check_result "${OS}" "${RELEASE}" "${LANG}" ""
|
||||
elif [ "${OPERATION}" == "check" ]; then
|
||||
check_result "${OS}" "${RELEASE}" "${LANG}" "${URL}" "SKIP"
|
||||
fi
|
||||
done
|
||||
elif [[ "${OS}" == "macos" ]]; then
|
||||
|
@ -478,10 +474,10 @@ function test_all() {
|
|||
validate_release releases_"${OS}"
|
||||
URL=$(get_"${OS}" | cut_1 | head -1)
|
||||
if [ "${OPERATION}" == "show" ]; then
|
||||
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}"
|
||||
elif [ "${OPERATION}" == "test" ]; then
|
||||
check_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}"
|
||||
elif [ "${OPERATION}" == "check" ]; then
|
||||
CHECK=$(web_check "${URL}" && echo 'PASS' || echo 'FAIL')
|
||||
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "${CHECK}"
|
||||
check_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "${CHECK}"
|
||||
fi
|
||||
fi
|
||||
done &
|
||||
|
@ -719,7 +715,7 @@ function releases_debian() {
|
|||
local OLD=""
|
||||
NEW=$(web_pipe "https://cdimage.debian.org/debian-cd/" | grep '\.[0-9]/' | cut -d'>' -f 9 | cut -d'/' -f 1)
|
||||
OLD=$(web_pipe "https://cdimage.debian.org/cdimage/archive/" | grep -e '>[1-9][0-9]\.' | grep -v 'live' | grep -v NEVER | cut -d'>' -f 9 | cut -d'/' -f 1 | tac | head -20)
|
||||
echo "${NEW}" "${OLD}"
|
||||
echo ${NEW} ${OLD}
|
||||
}
|
||||
|
||||
function editions_debian() {
|
||||
|
@ -1095,8 +1091,8 @@ function releases_tuxedo-os() {
|
|||
|
||||
function releases_ubuntu() {
|
||||
local VERSION_DATA="$(IFS=$'\n' web_pipe https://api.launchpad.net/devel/ubuntu/series | jq -r '.entries[]')"
|
||||
local SUPPORTED_VERSIONS=($(IFS=$'\n' jq -r 'select(.status=="Supported" or .status=="Current Stable Release") | .version' <<<"${VERSION_DATA}" | sort))
|
||||
local EOL_VERSIONS=($(IFS=$'\n' jq -r 'select(.status=="Obsolete") | .version' <<<"${VERSION_DATA}" | sort))
|
||||
local SUPPORTED_VERSIONS=($(IFS=$'\n' jq -r 'select(.status=="Supported" or .status=="Current Stable Release") | .version' <<<${VERSION_DATA} | sort))
|
||||
local EOL_VERSIONS=($(IFS=$'\n' jq -r 'select(.status=="Obsolete") | .version' <<<${VERSION_DATA} | sort))
|
||||
case "${OS}" in
|
||||
ubuntu)
|
||||
echo "${SUPPORTED_VERSIONS[@]}" daily-live "${EOL_VERSIONS[@]/#/eol-}";;
|
||||
|
@ -1234,11 +1230,11 @@ function web_get() {
|
|||
|
||||
# Test mode for ISO
|
||||
if [ "${OPERATION}" == "show" ]; then
|
||||
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}"
|
||||
check_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}"
|
||||
exit 0
|
||||
elif [ "${OPERATION}" == "test" ]; then
|
||||
elif [ "${OPERATION}" == "check" ]; then
|
||||
CHECK=$(web_check "${URL}" && echo 'PASS' || echo 'FAIL')
|
||||
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "${CHECK}"
|
||||
check_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "${CHECK}"
|
||||
exit 0
|
||||
elif [ "${OPERATION}" == "download" ]; then
|
||||
DIR="$(pwd)"
|
||||
|
@ -1250,7 +1246,7 @@ function web_get() {
|
|||
fi
|
||||
|
||||
if [[ ${OS} != windows && ${OS} != macos && ${OS} != windows-server ]]; then
|
||||
echo Downloading "${PRETTY_NAME}" "${RELEASE}" "${EDITION:+ $EDITION}"
|
||||
echo Downloading ${PRETTY_NAME} ${RELEASE} ${EDITION:+ $EDITION}
|
||||
echo "- URL: ${URL}"
|
||||
fi
|
||||
|
||||
|
@ -1300,11 +1296,9 @@ function zsync_get() {
|
|||
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}"
|
||||
exit 0
|
||||
elif [ "${OPERATION}" == "test" ]; then
|
||||
if ! web_check "${URL}"; then
|
||||
CHECK=$(web_check "${URL}" && echo 'PASS' || echo 'FAIL')
|
||||
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "${CHECK}"
|
||||
exit 0
|
||||
fi
|
||||
CHECK=$(web_check "${URL}" && echo 'PASS' || echo 'FAIL')
|
||||
test_result "${OS}" "${RELEASE}" "${EDITION}" "${URL}" "${CHECK}"
|
||||
exit 0
|
||||
elif command -v zsync &>/dev/null; then
|
||||
if [ -n "${3}" ]; then
|
||||
OUT="${3}"
|
||||
|
@ -1316,7 +1310,7 @@ function zsync_get() {
|
|||
echo "ERROR! Unable to create directory ${DIR}"
|
||||
exit 1
|
||||
fi
|
||||
echo -e Downloading "${PRETTY_NAME} ${RELEASE} ${EDITION+ ${EDITION}} from ${URL}\n"
|
||||
echo -e Downloading ${PRETTY_NAME} ${RELEASE} ${EDITION+ ${EDITION}} from ${URL}'\n'
|
||||
# Only force http for zsync - not earlier because we might fall through here
|
||||
if ! zsync "${URL/https/http}.zsync" -i "${DIR}/${OUT}" -o "${DIR}/${OUT}" 2>/dev/null; then
|
||||
echo "ERROR! Failed to download ${URL/https/http}.zsync"
|
||||
|
@ -1513,7 +1507,7 @@ EOF
|
|||
fi
|
||||
fi
|
||||
echo -e "\nTo start your ${PRETTY_NAME} virtual machine run:"
|
||||
if [ "${OS}" == "slint" ]; then
|
||||
if [ ${OS} == "slint" ]; then
|
||||
echo -e " quickemu --vm ${CONF_FILE}\nTo start Slint with braille support run:\n quickemu --vm --braille --display sdl ${CONF_FILE}"
|
||||
else
|
||||
echo " quickemu --vm ${CONF_FILE}"
|
||||
|
@ -1831,7 +1825,7 @@ function get_fedora() {
|
|||
Server|Kinoite|Onyx|Silverblue|Sericea|Workstation) VARIANT="${EDITION}";;
|
||||
*) VARIANT="Spins";;
|
||||
esac
|
||||
JSON=$(web_pipe "https://getfedora.org/releases.json" | jq '.[] | select(.variant=="'"${VARIANT}"'" and .subvariant=="'"${EDITION}"'" and .arch=="x86_64" and .version=="'"${RELEASE}"'")')
|
||||
JSON=$(web_pipe "https://getfedora.org/releases.json" | jq '.[] | select(.variant=="'${VARIANT}'" and .subvariant=="'"${EDITION}"'" and .arch=="x86_64" and .version=="'"${RELEASE}"'")')
|
||||
URL=$(echo "${JSON}" | jq -r '.link' | head -n1)
|
||||
HASH=$(echo "${JSON}" | jq -r '.sha256' | head -n1)
|
||||
echo "${URL} ${HASH}"
|
||||
|
@ -2066,11 +2060,11 @@ function get_macos() {
|
|||
local chunkListSession=$(echo "$info" | grep 'expires' | grep 'chunklist')
|
||||
|
||||
if [ "${OPERATION}" == "show" ]; then
|
||||
test_result "${OS}" "${RELEASE}" "" "${downloadLink}"
|
||||
check_result "${OS}" "${RELEASE}" "" "${downloadLink}"
|
||||
exit 0
|
||||
elif [ "${OPERATION}" == "test" ]; then
|
||||
elif [ "${OPERATION}" == "check" ]; then
|
||||
local CHECK=$(web_check "${downloadLink}" --header "Host: oscdn.apple.com" --header "Connection: close" --header "User-Agent: InternetRecovery/1.0" --header "Cookie: AssetToken=${downloadSession}" && echo 'PASS' || echo 'FAIL')
|
||||
test_result "${OS}" "${RELEASE}" "" "${downloadLink}" "${CHECK}"
|
||||
check_result "${OS}" "${RELEASE}" "" "${downloadLink}" "${CHECK}"
|
||||
exit 0
|
||||
elif [ "${OPERATION}" == "download" ]; then
|
||||
echo "Downloading macOS ${RELEASE} from ${downloadLink}"
|
||||
|
@ -2131,9 +2125,9 @@ function get_manjaro() {
|
|||
[[ ${RELEASE} != "sway" ]] && MANIFEST="$(web_pipe https://gitlab.manjaro.org/web/iso-info/-/raw/master/file-info.json)"
|
||||
[[ ${EDITION} == "minimal" && ${TYPE} != "sway" ]] && EDITION=".minimal" || EDITION=""
|
||||
if [[ ${RELEASE} != "sway" ]]; then
|
||||
URL="$(echo "${MANIFEST}" | jq -r "${TYPE}"."${RELEASE}""${EDITION}".image)"
|
||||
URL="$(echo ${MANIFEST} | jq -r .${TYPE}.${RELEASE}${EDITION}.image)"
|
||||
else
|
||||
URL=$(echo "${MANIFEST}" | jq -r '.[] | select(.name|test("^manjaro-sway-.*[.]iso$")) | select(.name|contains("unstable")|not) | .url')
|
||||
URL=$(echo ${MANIFEST} | jq -r '.[] | select(.name|test("^manjaro-sway-.*[.]iso$")) | select(.name|contains("unstable")|not) | .url')
|
||||
fi
|
||||
HASH=$(web_pipe "${URL}.sha512" | cut_1)
|
||||
echo "${URL} ${HASH}"
|
||||
|
@ -2477,7 +2471,7 @@ function get_truenas-scale() {
|
|||
local ISO=""
|
||||
local URL=""
|
||||
local DLINFO="https://www.truenas.com/download-truenas-scale/"
|
||||
URL=$(web_pipe "${DLINFO}" | grep -o "\"https://.*${RELEASE}.*\.iso\"" | cut -d'"' -f 2)
|
||||
URL=$(web_pipe ${DLINFO} | grep -o "\"https://.*${RELEASE}.*\.iso\"" | cut -d'"' -f 2)
|
||||
HASH=$(web_pipe "${URL}.sha256" | cut_1)
|
||||
echo "${URL} ${HASH}"
|
||||
}
|
||||
|
@ -2486,7 +2480,7 @@ function get_truenas-core() {
|
|||
local ISO=""
|
||||
local URL=""
|
||||
local DLINFO="https://www.truenas.com/download-truenas-core/"
|
||||
URL=$(web_pipe "${DLINFO}" | grep -o "\"https://.*${RELEASE}.*\.iso\"" | cut -d'"' -f 2)
|
||||
URL=$(web_pipe ${DLINFO} | grep -o "\"https://.*${RELEASE}.*\.iso\"" | cut -d'"' -f 2)
|
||||
HASH=$(web_pipe "${URL}".sha256 | cut_1)
|
||||
echo "${URL} ${HASH}"
|
||||
}
|
||||
|
@ -2519,12 +2513,12 @@ function get_ubuntu-server() {
|
|||
|
||||
if web_check "${URL}/SHA256SUMS"; then
|
||||
DATA=$(web_pipe "${URL}/SHA256SUMS" | grep "${NAME}" | grep amd64 | grep iso)
|
||||
ISO=$(cut -d'*' -f2 <<<"${DATA}")
|
||||
HASH=$(cut_1 <<<"${DATA}")
|
||||
ISO=$(cut -d'*' -f2 <<<${DATA})
|
||||
HASH=$(cut_1 <<<${DATA})
|
||||
else
|
||||
DATA=$(web_pipe "${URL}/MD5SUMS" | grep "${NAME}" | grep amd64 | grep iso)
|
||||
ISO=$(cut -d' ' -f3 <<<"${DATA}")
|
||||
HASH=$(cut_1 <<<"${DATA}")
|
||||
ISO=$(cut -d' ' -f3 <<<${DATA})
|
||||
HASH=$(cut_1 <<<${DATA})
|
||||
fi
|
||||
if [[ "${RELEASE}" == "daily"* ]] || [ "${RELEASE}" == "dvd" ]; then
|
||||
zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-devel.iso"
|
||||
|
@ -2565,14 +2559,14 @@ function get_ubuntu() {
|
|||
fi
|
||||
if web_check "${URL}/SHA256SUMS"; then
|
||||
DATA=$(web_pipe "${URL}/SHA256SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | grep -v "+mac")
|
||||
ISO=$(cut -d'*' -f2 <<<"${DATA}" | sed '1q;d')
|
||||
HASH=$(cut_1 <<<"${DATA}" | sed '1q;d')
|
||||
ISO=$(cut -d'*' -f2 <<<${DATA} | sed '1q;d')
|
||||
HASH=$(cut_1 <<<${DATA} | sed '1q;d')
|
||||
else
|
||||
DATA=$(web_pipe "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | grep -v "+mac")
|
||||
ISO=$(cut -d'*' -f2 <<<"${DATA}")
|
||||
HASH=$(cut_1 <<<"${DATA}")
|
||||
ISO=$(cut -d'*' -f2 <<<${DATA})
|
||||
HASH=$(cut_1 <<<${DATA})
|
||||
fi
|
||||
if [ -z "$ISO" ] || [ -z "$HASH" ]; then
|
||||
if [ -z $ISO ] || [ -z $HASH ]; then
|
||||
echo "${PRETTY_NAME} ${RELEASE} is currently unavailable. Please select other OS/Release combination"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -3289,7 +3283,7 @@ function open_homepage() {
|
|||
error_specify_os
|
||||
else
|
||||
URL="$(os_info "${1}" | cut -d'|' -f4)"
|
||||
xdg-open "$URL" || sensible-browser "$URL" || x-www-browser "$URL" || gnome-open "$URL"
|
||||
xdg-open $URL || sensible-browser $URL || x-www-browser $URL || gnome-open $URL
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
@ -3308,32 +3302,32 @@ function create_vm() {
|
|||
check_hash "${ISO}" "${HASH}"
|
||||
fi
|
||||
|
||||
if [ "${OS}" == "freedos" ] && [[ $ISO =~ ".zip" ]]; then
|
||||
unzip "${VM_PATH}/${ISO}" -d "${VM_PATH}"
|
||||
ISO=$(ls "${VM_PATH}" | grep -i '.iso')
|
||||
if [ ${OS} == "freedos" ] && [[ $ISO =~ ".zip" ]]; then
|
||||
unzip ${VM_PATH}/${ISO} -d ${VM_PATH}
|
||||
ISO=$(ls ${VM_PATH} | grep -i '.iso')
|
||||
fi
|
||||
#if [ "${OS}" == "guix" ] && [[ $ISO =~ ".qcow2" ]]; then
|
||||
#if [ ${OS} == "guix" ] && [[ $ISO =~ ".qcow2" ]]; then
|
||||
#cp ${VM_PATH}/${ISO} ${VM_PATH}/disc.qcow2
|
||||
#fi
|
||||
if [[ "${OS}" == "batocera" ]] && [[ ${ISO} =~ ".gz" ]]; then
|
||||
if [[ ${OS} == "batocera" ]] && [[ ${ISO} =~ ".gz" ]]; then
|
||||
gzip -d "${VM_PATH}/${ISO}"
|
||||
ISO="${ISO/.gz/}"
|
||||
fi
|
||||
# Could be other OS iso files compressed with bzip2 or gzip
|
||||
# but for now we'll keep this to know cases
|
||||
if [[ "${OS}" == "dragonflybsd" ]] && [[ ${ISO} =~ ".bz2" ]]; then
|
||||
if [[ ${OS} == "dragonflybsd" ]] && [[ ${ISO} =~ ".bz2" ]]; then
|
||||
bzip2 -d "${VM_PATH}/${ISO}"
|
||||
ISO="${ISO/.bz2/}"
|
||||
fi
|
||||
|
||||
if [[ "${OS}" == "easyos" ]] && [[ ${ISO} =~ ".img" ]]; then
|
||||
if [[ ${OS} == "easyos" ]] && [[ ${ISO} =~ ".img" ]]; then
|
||||
qemu-img convert -f raw -O qcow2 "${VM_PATH}/${ISO}" "${VM_PATH}/disk.qcow2"
|
||||
ISO="${ISO/.img/}"
|
||||
fi
|
||||
|
||||
if [ "${OS}" == "reactos" ] && [[ $ISO =~ ".zip" ]]; then
|
||||
unzip "${VM_PATH}/${ISO}" -d "${VM_PATH}"
|
||||
ISO=$(ls "${VM_PATH}" | grep -i '.iso' | grep -v '.zip')
|
||||
if [ ${OS} == "reactos" ] && [[ $ISO =~ ".zip" ]]; then
|
||||
unzip ${VM_PATH}/${ISO} -d ${VM_PATH}
|
||||
ISO=$(ls ${VM_PATH} | grep -i '.iso' | grep -v '.zip')
|
||||
fi
|
||||
make_vm_config "${ISO}"
|
||||
}
|
||||
|
@ -3427,27 +3421,25 @@ case "${1}" in
|
|||
shift
|
||||
if [ -z "${1}" ]; then
|
||||
for OS in $(os_support); do
|
||||
(test_all "${OS}") &
|
||||
(check_all "${OS}") &
|
||||
done
|
||||
wait
|
||||
exit 0
|
||||
elif [ -z "${2}" ]; then
|
||||
test_all "${1}"
|
||||
exit 0
|
||||
check_all "${1}"
|
||||
fi
|
||||
;;
|
||||
'--check'|'-c')
|
||||
OPERATION="test"
|
||||
OPERATION="check"
|
||||
shift
|
||||
if [ -z "${1}" ]; then
|
||||
for OS in $(os_support); do
|
||||
(test_all "${OS}") &
|
||||
(check_all "${OS}") &
|
||||
done
|
||||
wait
|
||||
exit 0
|
||||
elif [ -z "${2}" ]; then
|
||||
test_all "${1}"
|
||||
exit 0
|
||||
check_all "${1}"
|
||||
fi
|
||||
;;
|
||||
#TODO: Argument without dashes should be DEPRECATED!
|
||||
|
@ -3481,7 +3473,7 @@ if [ -n "${2}" ]; then
|
|||
# If the OS has an editions_() function, use it.
|
||||
if [[ $(type -t "editions_${OS}") == function ]]; then
|
||||
validate_release "releases_${OS}"
|
||||
EDITIONS=($("editions_${OS}"))
|
||||
EDITIONS=($(editions_${OS}))
|
||||
EDITION=${EDITIONS[0]}
|
||||
if [ -n "${3}" ]; then
|
||||
EDITION="${3}"
|
||||
|
|
Loading…
Reference in New Issue
Block a user