mirror of
https://github.com/oSoWoSo/DistroHopper.git
synced 2024-08-14 22:46:53 +00:00
Refactor Ubuntu support
Use release and project labels found on cdimage.
This commit is contained in:
parent
eaae0f72e8
commit
368b24936e
1 changed files with 21 additions and 36 deletions
57
quickget
57
quickget
|
@ -196,9 +196,9 @@ function os_support() {
|
||||||
tails \
|
tails \
|
||||||
ubuntu \
|
ubuntu \
|
||||||
ubuntu-budgie \
|
ubuntu-budgie \
|
||||||
ubuntu-kylin \
|
ubuntukylin \
|
||||||
ubuntu-mate \
|
ubuntu-mate \
|
||||||
ubuntu-studio \
|
ubuntustudio \
|
||||||
void \
|
void \
|
||||||
windows \
|
windows \
|
||||||
xubuntu \
|
xubuntu \
|
||||||
|
@ -503,11 +503,7 @@ function releases_tails() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function releases_ubuntu() {
|
function releases_ubuntu() {
|
||||||
echo 18.04 \
|
echo 18.04 20.04 21.10 daily-live daily-canary
|
||||||
20.04 \
|
|
||||||
21.10 \
|
|
||||||
devel \
|
|
||||||
canary
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function releases_void() {
|
function releases_void() {
|
||||||
|
@ -1386,45 +1382,34 @@ function get_tails() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_ubuntu() {
|
function get_ubuntu() {
|
||||||
local DEVEL="daily-live"
|
|
||||||
local ISO=""
|
local ISO=""
|
||||||
local HASH=""
|
local HASH=""
|
||||||
local PROJECT=""
|
|
||||||
local URL=""
|
local URL=""
|
||||||
|
|
||||||
case ${OS} in
|
if [[ "${RELEASE}" == *"daily"* ]] && [ "${OS}" == "ubuntustudio" ]; then
|
||||||
kubuntu|lubuntu|ubuntu|ubuntu-budgie|ubuntu-mate|xubuntu)
|
# Ubuntu Studio daily-live images are in the dvd directory
|
||||||
PROJECT="${OS}";;
|
RELEASE="dvd"
|
||||||
ubuntu-kylin)
|
elif [ "${RELEASE}" == "daily-canary" ] && [ "${OS}" != "ubuntu" ]; then
|
||||||
PROJECT="ubuntukylin";;
|
# daily-canary is only available for Ubuntu, switch flavours to daily-live
|
||||||
ubuntu-studio)
|
RELEASE="daily-live"
|
||||||
PROJECT="ubuntustudio"
|
|
||||||
DEVEL="dvd";;
|
|
||||||
*) echo "ERROR! ${OS} is not a recognised Ubuntu flavour."
|
|
||||||
exit 1;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ "${RELEASE}" == "canary" ] && [ "${OS}" != "ubuntu" ]; then
|
|
||||||
echo "ERROR! Canary is currently only available for Ubuntu."
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${RELEASE}" == "canary" ]; then
|
if [[ "${RELEASE}" == *"daily"* ]] || [ "${RELEASE}" == "dvd" ]; then
|
||||||
DEVEL="daily-canary"
|
URL="http://cdimage.ubuntu.com/${OS}/${RELEASE}/current"
|
||||||
URL="http://cdimage.ubuntu.com/${PROJECT}/${DEVEL}/current"
|
VM_PATH="${OS}-devel"
|
||||||
elif [ "${RELEASE}" == "devel" ]; then
|
elif [ "${OS}" == "ubuntu" ]; then
|
||||||
URL="http://cdimage.ubuntu.com/${PROJECT}/${DEVEL}/current"
|
|
||||||
elif [ "${PROJECT}" == "ubuntu" ]; then
|
|
||||||
URL="http://releases.ubuntu.com/${RELEASE}"
|
URL="http://releases.ubuntu.com/${RELEASE}"
|
||||||
else
|
else
|
||||||
URL="http://cdimage.ubuntu.com/${PROJECT}/releases/${RELEASE}/release"
|
URL="http://cdimage.ubuntu.com/${OS}/releases/${RELEASE}/release"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
HASH=$(wget -q -O- "${URL}/SHA256SUMS" | cut -d' ' -f1)
|
ISO=$(wget -q -O- "${URL}/SHA256SUMS" | grep 'desktop\|dvd' | grep amd64 | cut -d'*' -f2)
|
||||||
ISO=$(wget -q -O- "${URL}/SHA256SUMS" | grep 'desktop\|dvd' | grep amd64 | cut -d' ' -f2 | sed 's|*||g')
|
HASH=$(wget -q -O- "${URL}/SHA256SUMS" | grep 'desktop\|dvd' | grep amd64 | cut -d' ' -f1)
|
||||||
if [ "${RELEASE}" == "canary" ] || [ "${RELEASE}" == "devel" ]; then
|
#echo "${URL}/${ISO} ${HASH}"
|
||||||
zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-${RELEASE}.iso"
|
|
||||||
make_vm_config "${OS}-${RELEASE}.iso"
|
if [[ "${RELEASE}" == *"daily"* ]] || [ "${RELEASE}" == "dvd" ]; then
|
||||||
|
zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-devel.iso"
|
||||||
|
make_vm_config "${OS}-devel.iso"
|
||||||
else
|
else
|
||||||
web_get "${URL}/${ISO}" "${VM_PATH}"
|
web_get "${URL}/${ISO}" "${VM_PATH}"
|
||||||
check_hash "${ISO}" "${HASH}"
|
check_hash "${ISO}" "${HASH}"
|
||||||
|
|
Loading…
Reference in a new issue