Skip to content

Commit

Permalink
Merge branch 'qf-e-distros' Add E distributions (except easyos issue #9)
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrown645 committed Feb 12, 2024
2 parents 7ab781a + 7a2d2c8 commit 55ca8e6
Show file tree
Hide file tree
Showing 5 changed files with 435 additions and 6 deletions.
28 changes: 22 additions & 6 deletions quickget
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ function main() {
if editions_required; then
release_editions
else
printf "%-15s | %s\n" "Releases" "$(releases)"
printf "%-15s |" "Releases"
for item in $(releases); do
printf " %s" "${item}"
done
printf "\n"
fi
usage
else
Expand Down Expand Up @@ -156,8 +160,12 @@ function main() {
if editions_required; then
release_editions
else
printf "\t- Releases: %s\n" "$(releases)"
fi
printf "%-15s |" "Releases"
for item in $(releases); do
printf " %s" "${item}"
done
printf "\n"
fi
usage
fi
fi
Expand Down Expand Up @@ -200,8 +208,14 @@ function check_hash() {
40) hash_algo=sha1sum;;
64) hash_algo=sha256sum;;
128) hash_algo=sha512sum;;
None) warning "Hash not provided , not checking ${OS} hash";;
*) warning "Can't guess hash algorithm, not checking ${OS} hash";;
None)
warning "Hash not provided , not checking ${OS} hash"
return 0
;;
*)
warning "Can't guess hash algorithm, not checking ${OS} hash"
return 0
;;
esac

printf "Checking %s with %s... " "${DISTRO_INFO['iso']}" "${hash_algo}"
Expand Down Expand Up @@ -267,9 +281,11 @@ function edition_valid() {
function release_valid() {
# This function validates that the supplied release is one of the
# valid releases
#
for value in $(releases); do
[[ "${RELEASE}" == "${value}" ]] && return 0
[[ "${RELEASE}" == "${value,,}" ]] && return 0
done

return 1
}

Expand Down
119 changes: 119 additions & 0 deletions quickget_plugins/edubuntu.plug
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
#!/usr/bin/bash
#
# This template identifies the functions required to supported by each OS

#function create_vm() {
# # 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 an associative array with keys "url", "iso", and "hash"
# Change this function for your distro
function get_distro_info() {
declare -A distro_info
local url_base="https://cdimage.ubuntu.com/edubuntu"
local hash_url
local data

case "${RELEASE}" in
daily-live)
distro_info['url']="${url_base}/${RELEASE}/current"
hash_url="${url_base}/${RELEASE}/current"
;;
*) distro_info['url']="https://cdimage.ubuntu.com/edubuntu/releases/${RELEASE}/release"
hash_url="https://cdimage.ubuntu.com/edubuntu/releases/${RELEASE}/release"
;;
esac

if wget -q --spider "${hash_url}/SHA256SUMS"; then
data=$(wget -qO- "${hash_url}/SHA256SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | grep -v "+mac")
distro_info['iso']=$(cut -d'*' -f2 <<<${data} | sed '1q;d')
distro_info['hash']=$(cut -d' ' -f1 <<<${data} | sed '1q;d')
else
data=$(wget -qO- "${hash_url}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | grep iso | grep -v "+mac")
distro_info['iso']=$(cut -d'*' -f2 <<<${data})
distro_info['hash']=$(cut -d' ' -f1 <<<${data})
fi

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() {
local version_data="$(IFS=$'\n' wget -qO- 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 lts_support=()
local interim_support=()

for i in "${supported_versions[@]}"; do
if [[ $(expr ${i%.*} % 2) == 0 && ${i#*.} == "04" ]]; then
lts_support+=($i)
else
interim_support+=($i)
fi
done

echo "${interim_support[@]} daily-live"
}

# 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}]=""
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 1
}

# This function returns an expanded OS name for pretty printing
# Change this function for your distro
function pretty_name() {
echo "Edubuntu Linux"
}

# This function returns the OS's home page URL
# Change this function for your distro
function homepage() {
echo "https://www.edubuntu.org/"
}

# This function creates the vm_config file and can be used to
# replace the default one in the quickget
# Change this function for your distro
function make_vm_config() {
default_vm_config

# Override any default settings
#sed -i 's/^disk_size=.*/disk_size=\"80G\"/' "${VM_PATH}".conf

# Add any additional lines
# {
# printf "fixed_iso=\"%s\"\n" ${fixed_iso}
#
# } >> "${VM_PATH}.conf"
}
94 changes: 94 additions & 0 deletions quickget_plugins/elementary.plug
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#!/usr/bin/bash
#
# This template identifies the functions required to supported by each OS

#function create_vm() {
# # 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 an associative array with keys "url", "iso", and "hash"
# Change this function for your distro
function get_distro_info() {
declare -A distro_info

case ${RELEASE} in
7.0)
distro_info['iso']="MTcwNzQ1OTIyMAo=/elementaryos-7.0-stable.20230129rc.iso"
distro_info['hash']="None"
;;
7.1)
distro_info['iso']="MTcwNzQ1NzE4Mg==/elementaryos-${RELEASE}-stable.20230926rc.iso"
distro_info['hash']="5c7f6b388e5787c366587985301ea05ab16e4cc0de3be2b3d6a559ce81a2f102"
;;
esac
distro_info['url']="https://ams3.dl.elementary.io/download"

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 7.0 7.1
}

# 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}]=""
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 1
}

# This function returns an expanded OS name for pretty printing
# Change this function for your distro
function pretty_name() {
echo "elementary OS"
}

# This function returns the OS's home page URL
# Change this function for your distro
function homepage() {
echo "https://elementary.io/"
}

# This function creates the vm_config file and can be used to
# replace the default one in the quickget
# Change this function for your distro
function make_vm_config() {
default_vm_config

# Override any default settings
#sed -i 's/^disk_size=.*/disk_size=\"80G\"/' "${VM_PATH}".conf

# Add any additional lines
# {
# printf "fixed_iso=\"%s\"\n" ${fixed_iso}
#
# } >> "${VM_PATH}.conf"
}
93 changes: 93 additions & 0 deletions quickget_plugins/endeavouros.plug
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/usr/bin/bash
#
# This template identifies the functions required to supported by each OS

#function create_vm() {
# # 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 an associative array with keys "url", "iso", and "hash"
# Change this function for your distro
function get_distro_info() {
declare -A distro_info

distro_info['iso']="$( grep -i "${RELEASE}" < "${TMPDIR}"/iso )"
distro_info['url']="https://mirrors.gigenet.com/endeavouros/iso"
distro_info['hash']=$(wget -q -O- "${distro_info['url']}/${distro_info['iso']}.sha512sum" | cut -d' ' -f1)

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() {
curl -s https://mirrors.gigenet.com/endeavouros/iso/ \
| grep 'href="E' \
| cut -f 2 -d '"' \
| grep 'iso$' > "${TMPDIR}"/iso

{
sed -e 's/^.*[O|o][S|s][_-]//' -e 's/\.iso//' | sort
} < "${TMPDIR}"/iso
}

# 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}]=""
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 1
}

# This function returns an expanded OS name for pretty printing
# Change this function for your distro
function pretty_name() {
echo "EndeavourOS"
}

# This function returns the OS's home page URL
# Change this function for your distro
function homepage() {
echo "https://endeavouros.com/"
}

# This function creates the vm_config file and can be used to
# replace the default one in the quickget
# Change this function for your distro
function make_vm_config() {
default_vm_config

# Override any default settings
#sed -i 's/^disk_size=.*/disk_size=\"80G\"/' "${VM_PATH}".conf

# Add any additional lines
# {
# printf "fixed_iso=\"%s\"\n" ${fixed_iso}
#
# } >> "${VM_PATH}.conf"
}
Loading

0 comments on commit 55ca8e6

Please sign in to comment.