Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: updated openrgb URLs #1059

Merged
merged 3 commits into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions 01-main/packages/openrgb
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,32 @@ ARCHS_SUPPORTED="amd64 armhf"
CODENAMES_SUPPORTED="buster bullseye bookworm focal jammy noble"
get_website "https://openrgb.org/releases.html"
if [ "${ACTION}" != "prettylist" ]; then
local codename, regex, deb
case "${UPSTREAM_CODENAME}" in
buster)
URL="https://openrgb.org/$( grep -o -E "/releases/release_[[:digit:]]+\.[[:digit:]]+/openrgb_[[:digit:]]+\.[[:digit:]]_${HOST_ARCH}_buster_[[:digit:]]+\.deb" "${CACHE_FILE}" )"
codename=buster
;;
bullseye|focal)
codename=bullseye
;;
bullseye|focal|jammy)
URL="https://openrgb.org/$( grep -o -E "/releases/release_[[:digit:]]+\.[[:digit:]]+/openrgb_[[:digit:]]+\.[[:digit:]]_${HOST_ARCH}_bullseye_[[:digit:]]+\.deb" "${CACHE_FILE}" )"
;;
*)
URL="https://openrgb.org/$( grep -o -E "/releases/release_[[:digit:]]+\.[[:digit:]]+/openrgb_[[:digit:]]+\.[[:digit:]]_${HOST_ARCH}_bookworm_[[:digit:]]+\.deb" "${CACHE_FILE}" )"
codename=bookworm
;;
esac
VERSION_PUBLISHED="$(echo "${URL}" | grep -o -E '[[:digit:]]+\.[[:digit:]]+'|sort -u)"
# allow more complex version numbers, such as 0.9.1, 0.9b, or 0.9-1:
regex="/releases/release_[^/]+/openrgb_[^_]+_${HOST_ARCH}_${codename}_[^.]+\.deb"
# can return multiple lines (since the content has no newlines):
deb=$( grep -m 1 -o -E "${regex}" "${CACHE_FILE}" )
# strip everything after the first newline:
deb="${deb/$'\n'*/}"
URL="https://openrgb.org/${deb}"
# grab the first version found in the path (in the directory name):
VERSION_PUBLISHED=$( grep -m 1 -o -E '_[^/]+/' <<<"${deb}" )
# strip the leading _:
VERSION_PUBLISHED="${VERSION_PUBLISHED/_/}"
# strip the trailing /:
VERSION_PUBLISHED="${VERSION_PUBLISHED/\//}"
fi
PRETTY_NAME="OpenRGB"
WEBSITE="https://openrgb.org/"
SUMMARY="Open source RGB lighting control that doesn't depend on manufacturer software."