From a23932968578c571be0a3e12c0fff6eb153cc2dd Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Tue, 11 Oct 2022 11:44:53 +0000 Subject: [PATCH 1/5] tools/update-scan: handle api calls to get version --- tools/update-scan | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/tools/update-scan b/tools/update-scan index 0357a4a9e2..55de81ddd3 100755 --- a/tools/update-scan +++ b/tools/update-scan @@ -112,7 +112,9 @@ check_for_update() { fi # print version output line - if [ "${PKG_VERSION}" != "${upstream_version}" ]; then + if [ ! -z "${API}" ]; then + printf "%s %s %s" "${PKG_NAME}" "${PKG_VERSION}" "${upstream_version}"; printf '\n' + elif [ "${PKG_VERSION}" != "${upstream_version}" ]; then printf "%-35s | %-40s | %-20s" "${PKG_NAME}" "${PKG_VERSION}" "${upstream_version}"; printf '\n' else PACKAGES_CURRENT+="${PKG_NAME} " @@ -136,25 +138,31 @@ else )" fi -# test github api availability -test_github_api +if [ -z "${API}" ]; then + # test github api availability + test_github_api -# output -echo -e "\nUpdates found:\n" -printf "%-35s | %-40s | %-20s" "Package" "LE git master" "upstream location"; printf '\n' -echo -e ''$_{1..140}'\b-' + # output + echo -e "\nUpdates found:\n" + printf "%-35s | %-40s | %-20s" "Package" "LE git master" "upstream location"; printf '\n' + echo -e ''$_{1..140}'\b-' -for check_version in ${PACKAGE_LIST}; do - check_for_update "${check_version}" -done + for check_version in ${PACKAGE_LIST}; do + check_for_update "${check_version}" + done -echo "" -if [ -n "${PACKAGES_CURRENT}" ]; then - echo -e "\nCurrent $(echo ${PACKAGES_CURRENT} | wc -w):\n${PACKAGES_CURRENT}\n" -fi -if [ -n "${PACKAGES_IGNORED}" ]; then - echo -e "\nIgnored $(echo ${PACKAGES_IGNORED} | wc -w):\n${PACKAGES_IGNORED}" -fi -if [ -n "${PACKAGES_NOT_REGISTERED}" ]; then - echo -e "\nPackages not known at tracker $(echo ${PACKAGES_NOT_REGISTERED} | wc -w):\n${PACKAGES_NOT_REGISTERED}\n" + echo "" + if [ -n "${PACKAGES_CURRENT}" ]; then + echo -e "\nCurrent $(echo ${PACKAGES_CURRENT} | wc -w):\n${PACKAGES_CURRENT}\n" + fi + if [ -n "${PACKAGES_IGNORED}" ]; then + echo -e "\nIgnored $(echo ${PACKAGES_IGNORED} | wc -w):\n${PACKAGES_IGNORED}" + fi + if [ -n "${PACKAGES_NOT_REGISTERED}" ]; then + echo -e "\nPackages not known at tracker $(echo ${PACKAGES_NOT_REGISTERED} | wc -w):\n${PACKAGES_NOT_REGISTERED}\n" + fi +else + for check_version in ${PACKAGE_LIST}; do + check_for_update "${check_version}" + done fi From 013261ccab3b3e60002ca183b0be74c1f6d6d89e Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Wed, 19 Jul 2023 11:48:05 +0000 Subject: [PATCH 2/5] tools/update-scan: set API timeout to 5 seconds --- tools/update-scan | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/update-scan b/tools/update-scan index 55de81ddd3..59d2284b20 100755 --- a/tools/update-scan +++ b/tools/update-scan @@ -23,7 +23,7 @@ test_github_api() { if [[ -n "${github_token}" || -n "${github_user}" ]]; then github_api_token="-u ${github_user}:${github_token}" # check if token works - if curl -sL -I "${github_api_token}" https://api.github.com/user | grep -q -e "^[Ss]tatus: 200" -e "^HTTP/2 200"; then + if curl -m 5 -sL -I "${github_api_token}" https://api.github.com/user | grep -q -e "^[Ss]tatus: 200" -e "^HTTP/2 200"; then echo "Github api usage activated" github_api="yes" else @@ -58,7 +58,7 @@ check_for_update() { fi # check if package exists at tracker - RMO_API_RESPONSE=$(curl -sL "https://release-monitoring.org/api/project/LibreELEC/${PKG_NAME}" || true) + RMO_API_RESPONSE=$(curl -m 5 -sL "https://release-monitoring.org/api/project/LibreELEC/${PKG_NAME}" || true) upstream_version=$(echo "${RMO_API_RESPONSE}" | jq -r '.version' || true) # special handling based on release-monitoring formatting @@ -77,14 +77,14 @@ check_for_update() { [[ "${github_api}" = "yes" ]]; then github_repos=$(echo "${PKG_URL}" | grep -oP '(?<=https:\/\/github.com\/)?[0-9A-Za-z._-]+\/[0-9A-Za-z._-]+(?=/archive|/tags|/releases)') - le_master_version_date="Commit date: $(curl -sL ${github_api_token} https://api.github.com/repos/${github_repos}/git/commits/${PKG_VERSION} | jq -r '.committer.date')" - upstream_default_branch=$(curl -sL "${github_api_token}" "https://api.github.com/repos/${github_repos}" | jq -r '.default_branch') - upstream_latest_commit=$(curl -sL "${github_api_token}" "https://api.github.com/repos/${github_repos}/git/refs/heads/${upstream_default_branch}" | jq -r '.object.url') - upstream_latest_commit_date=$(curl -sL "${github_api_token}" "${upstream_latest_commit}" | jq -r '.committer.date') - GH_API_TAG=$(curl -sL "${github_api_token}" "https://api.github.com/repos/${github_repos}/tags") + le_master_version_date="Commit date: $(curl -m 5 -sL ${github_api_token} https://api.github.com/repos/${github_repos}/git/commits/${PKG_VERSION} | jq -r '.committer.date')" + upstream_default_branch=$(curl -m 5 -sL "${github_api_token}" "https://api.github.com/repos/${github_repos}" | jq -r '.default_branch') + upstream_latest_commit=$(curl -m 5 -sL "${github_api_token}" "https://api.github.com/repos/${github_repos}/git/refs/heads/${upstream_default_branch}" | jq -r '.object.url') + upstream_latest_commit_date=$(curl -m 5 -sL "${github_api_token}" "${upstream_latest_commit}" | jq -r '.committer.date') + GH_API_TAG=$(curl -m 5 -sL "${github_api_token}" "https://api.github.com/repos/${github_repos}/tags") upstream_latest_tag=$(echo "${GH_API_TAG}" | jq -r '.[0].name') upstream_latest_tag_url=$(echo "${GH_API_TAG}" | jq -r '.[0].commit.url') - upstream_latest_tag_date=$(curl -sL "${github_api_token}" "${upstream_latest_tag_url}" | jq -r '.commit.committer.date') + upstream_latest_tag_date=$(curl -m 5 -sL "${github_api_token}" "${upstream_latest_tag_url}" | jq -r '.commit.committer.date') # compare upstream with local version if [ "${PKG_VERSION}" != "${upstream_latest_commit##*/}" ]; then From dbb762a46a1c8a63ff3009fbc16374a0377aeab0 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Fri, 1 Sep 2023 23:00:46 +0000 Subject: [PATCH 3/5] tools/update-scan: custom handler for aspnet as release monitoring does handle major release versioning --- tools/update-scan | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/tools/update-scan b/tools/update-scan index 59d2284b20..17db5fcf5c 100755 --- a/tools/update-scan +++ b/tools/update-scan @@ -57,19 +57,34 @@ check_for_update() { return fi - # check if package exists at tracker - RMO_API_RESPONSE=$(curl -m 5 -sL "https://release-monitoring.org/api/project/LibreELEC/${PKG_NAME}" || true) - upstream_version=$(echo "${RMO_API_RESPONSE}" | jq -r '.version' || true) + upstream_version="" - # special handling based on release-monitoring formatting - case ${PKG_NAME} in - icu) - upstream_version=${upstream_version/-/.} - ;; - lm_sensors) - upstream_version=${upstream_version//-/.} - ;; - esac + if [[ "${github_api}" = "yes" ]]; then + case ${PKG_NAME} in + aspnet6-runtime) + upstream_version="$(curl -m 5 -sL ${github_api_token} https://api.github.com/repos/dotnet/runtime/releases | jq -r '[.[] | select(.prerelease==false) | select(.tag_name | match("v6.0")) | .tag_name][0] | sub("v";"")')" + ;; + aspnet8-runtime) + upstream_version="$(curl -m 5 -sL ${github_api_token} https://api.github.com/repos/dotnet/runtime/releases | jq -r '[.[] | select(.tag_name | match("v8.0")) | .tag_name][0] | sub("v";"")')" + ;; + esac + fi + + if [ -z "${upstream_version}" ]; then + # check if package exists at tracker + RMO_API_RESPONSE=$(curl -m 5 -sL "https://release-monitoring.org/api/project/LibreELEC/${PKG_NAME}" || true) + upstream_version=$(echo "${RMO_API_RESPONSE}" | jq -r '.version' || true) + + # special handling based on release-monitoring formatting + case ${PKG_NAME} in + icu) + upstream_version=${upstream_version/-/.} + ;; + lm_sensors) + upstream_version=${upstream_version//-/.} + ;; + esac + fi # if pkg_version is a githash on github and github api available - always check against latest if [[ ${PKG_VERSION} =~ ^[a-z0-9]{40} ]] && From 2414f891a051794eb08ddaf5c30838bb381dbc11 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Sun, 15 Oct 2023 03:15:30 +0000 Subject: [PATCH 4/5] tools/update-scan: drop special handling for icu --- tools/update-scan | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/update-scan b/tools/update-scan index 17db5fcf5c..64fbeeea30 100755 --- a/tools/update-scan +++ b/tools/update-scan @@ -77,9 +77,6 @@ check_for_update() { # special handling based on release-monitoring formatting case ${PKG_NAME} in - icu) - upstream_version=${upstream_version/-/.} - ;; lm_sensors) upstream_version=${upstream_version//-/.} ;; From 9ce75c4d9d178a739c6798ccfcdc168184a97bca Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Sun, 15 Oct 2023 03:17:38 +0000 Subject: [PATCH 5/5] icu: update version number format to match github releases --- packages/addons/addon-depends/icu/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/addons/addon-depends/icu/package.mk b/packages/addons/addon-depends/icu/package.mk index d7bc48c91d..b5692ecc54 100644 --- a/packages/addons/addon-depends/icu/package.mk +++ b/packages/addons/addon-depends/icu/package.mk @@ -2,11 +2,11 @@ # Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv) PKG_NAME="icu" -PKG_VERSION="73.2" +PKG_VERSION="73-2" PKG_SHA256="c15f704e83c221c0680640a995d9db641f5b82098fb4b258a94b7d0561493c88" PKG_LICENSE="Custom" PKG_SITE="https://icu.unicode.org" -PKG_URL="https://github.com/unicode-org/icu/archive/release-${PKG_VERSION//./-}.tar.gz" +PKG_URL="https://github.com/unicode-org/icu/archive/release-${PKG_VERSION}.tar.gz" PKG_DEPENDS_HOST="toolchain:host" PKG_DEPENDS_TARGET="toolchain icu:host" PKG_LONGDESC="International Components for Unicode library."