Merge pull request #1 from philclifford/takov-phil-work

Possible fix for ubuntus link checking
This commit is contained in:
takov751 2022-02-27 14:27:12 +00:00 committed by GitHub
commit 918d8cab1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,23 +156,46 @@ function list_csv() {
exit 0 exit 0
} }
function check_links() { function check_links() {
local OSORUBUNTU
local CHECK_LINKS=true
for OS in $(os_support); do for OS in $(os_support); do
if [[ "${OS}" == *"ubuntu"* ]] || [[ "${OS}" == *"windows"* ]] || [[ "${OS}" == *"macos"* ]]; then if \
[[ "${OS}" == *"windows"* ]] || \
[[ "${OS}" == *"macos"* ]] || \
[[ ! "${OS}" == *"${1:${OS}}"* ]]; then
continue continue
else else
FUNC="${OS}" FUNC="${OS}"
if [[ "${OS}" == *"ubuntu"* ]]; then
OSORUBUNTU="ubuntu"
else
OSORUBUNTU="${OS}"
fi
fi fi
for RELEASE in $("releases_${FUNC}"); do for RELEASE in $("releases_${OSORUBUNTU}"); do
if [[ $(type -t "editions_${FUNC}") == function ]]; then if [[ ${RELEASE} == "eol-"* ]]; then
for EDITY in $("editions_${FUNC}"); do continue
URL=$(get_"${FUNC}" | cut -d " " -f1)
CHECK=$(curl -o /dev/null --silent --head -L --write-out '%{http_code}\t%{content_type}' "${URL}")
echo "$FUNC $RELEASE $EDITY ${CHECK} $URL"
done
else else
URL=$(get_"${FUNC}" | cut -d " " -f1) if [[ $(type -t "editions_${FUNC}") == function ]]; then
CHECK=$(curl -o /dev/null --silent --head -L --write-out '%{http_code}\t%{content_type}' "${URL}") for EDITY in $("editions_${FUNC}"); do
echo "$FUNC $RELEASE ${CHECK} $URL" URL=$(get_"${FUNC}" | cut -d " " -f1)
CHECK=$(curl -o /dev/null --silent --head -L --write-out '%{http_code}\t%{content_type}' "${URL}")
if [[ -n "${ZCHECK}" ]] ; then
ZCHECK=$(curl -o /dev/null --silent --head -L --write-out '%{http_code}\t%{content_type}' "${URL}.zsync")
echo "$FUNC $RELEASE $EDITY ${ZCHECK} ${URL}.zsync"
fi
echo "$FUNC $RELEASE $EDITY ${CHECK} $URL"
done
else
URL=$(get_"${OSORUBUNTU}" | cut -d " " -f1)
CHECK=$(curl -o /dev/null --silent --head -L --write-out '%{http_code}\t%{content_type}' "${URL}")
if [[ -n "${ZCHECK}" ]] ; then
ZCHECK=$(curl -o /dev/null --silent --head -L --write-out '%{http_code}\t%{content_type}' "${URL}.zsync")
echo "$FUNC $RELEASE $EDITY ${ZCHECK} ${URL}.zsync"
fi
echo "$FUNC $RELEASE ${CHECK} $URL"
fi
fi fi
done done
done done
@ -332,7 +355,6 @@ function editions_garuda() {
mate \ mate \
qtile \ qtile \
sway \ sway \
wayfire \
xfce xfce
} }
@ -469,10 +491,19 @@ function releases_tails() {
} }
function releases_ubuntu() { function releases_ubuntu() {
echo 14.04 \ local LTS_SUPPORT="14.04 16.04 18.04 20.04"
16.04 \ case "${OS}" in
18.04 \ kubuntu|lubuntu|ubuntukylin|\
20.04 \ ubuntu-mate|ubuntustudio|xubuntu)
## after 14.04
LTS_SUPPORT="${LTS_SUPPORT/14.04 /}"
;;
ubuntu-budgie)
#after 16.04
LTS_SUPPORT="${LTS_SUPPORT/14.04 16.04 /}"
;;
esac
echo ${LTS_SUPPORT} \
21.10 \ 21.10 \
daily-live \ daily-live \
daily-canary \ daily-canary \
@ -594,7 +625,7 @@ function check_hash() {
echo -n "Checking ${iso} with ${hash_algo}... " echo -n "Checking ${iso} with ${hash_algo}... "
if ! echo "${hash} ${iso}" | ${hash_algo} --check --status; then if ! echo "${hash} ${iso}" | ${hash_algo} --check --status; then
echo "ERROR!" echo "ERROR! Checking ISO"
echo "${iso} doesn't match ${hash}. Try running 'quickget' again." echo "${iso} doesn't match ${hash}. Try running 'quickget' again."
exit 1 exit 1
else else
@ -945,7 +976,11 @@ function get_garuda() {
cinnamon|mate) URL="http://mirrors.fossho.st/garuda/iso/community/${EDITION}/${RELEASE}";; cinnamon|mate) URL="http://mirrors.fossho.st/garuda/iso/community/${EDITION}/${RELEASE}";;
*) URL="http://mirrors.fossho.st/garuda/iso/garuda/${EDITION}/${RELEASE}";; *) URL="http://mirrors.fossho.st/garuda/iso/garuda/${EDITION}/${RELEASE}";;
esac esac
ISO="garuda-${EDITION}-linux-zen-${RELEASE}.iso" case ${EDITION} in
xfce|kde-barebones) ISO="garuda-${EDITION}-linux-lts-${RELEASE}.iso";;
*) ISO="garuda-${EDITION}-linux-zen-${RELEASE}.iso";;
esac
HASH="$(wget -q -O- "${URL}/${ISO}.sha256" | cut -d' ' -f1)" HASH="$(wget -q -O- "${URL}/${ISO}.sha256" | cut -d' ' -f1)"
echo "${URL}/${ISO} ${HASH}" echo "${URL}/${ISO} ${HASH}"
} }
@ -1289,15 +1324,19 @@ function get_ubuntu() {
ISO=$(wget -q -O- "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | cut -d' ' -f3) ISO=$(wget -q -O- "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | cut -d' ' -f3)
HASH=$(wget -q -O- "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | cut -d' ' -f1) HASH=$(wget -q -O- "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | cut -d' ' -f1)
fi fi
#echo "${URL}/${ISO} ${HASH}"
if [[ "${RELEASE}" == *"daily"* ]] || [ "${RELEASE}" == "dvd" ]; then if [[ -n "${CHECK_LINKS}" ]] ; then
zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-devel.iso" echo "${URL}/${ISO} ${HASH}"
make_vm_config "${OS}-devel.iso"
else else
web_get "${URL}/${ISO}" "${VM_PATH}"
check_hash "${ISO}" "${HASH}" if [[ "${RELEASE}" == *"daily"* ]] || [ "${RELEASE}" == "dvd" ]; then
make_vm_config "${ISO}" zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-devel.iso"
make_vm_config "${OS}-devel.iso"
else
web_get "${URL}/${ISO}" "${VM_PATH}"
check_hash "${ISO}" "${HASH}"
make_vm_config "${ISO}"
fi
fi fi
} }
@ -1752,7 +1791,7 @@ if [ -n "${1}" ]; then
elif [ "${OS}" == "list_json" ]; then elif [ "${OS}" == "list_json" ]; then
list_json list_json
elif [ "${OS}" == "check_links" ]; then elif [ "${OS}" == "check_links" ]; then
check_links check_links "${2:-}"
elif [ "${OS}" == "--version" ] || [ "${OS}" == "-version" ] || [ "${OS}" == "version" ]; then elif [ "${OS}" == "--version" ] || [ "${OS}" == "-version" ] || [ "${OS}" == "version" ]; then
WHERE=$(dirname "${BASH_SOURCE[0]}") WHERE=$(dirname "${BASH_SOURCE[0]}")
"${WHERE}/quickemu" --version "${WHERE}/quickemu" --version