From b345573aa1eba95a8d8c40c7c5797ca5cd5633d1 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 29 Oct 2024 08:56:16 -0400 Subject: [PATCH] forgejo: chose highest version when dealing with multiple downstream_versions --- .forgejo/bin/check_ver.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/bin/check_ver.sh b/.forgejo/bin/check_ver.sh index e4b7fd7..7a1f534 100755 --- a/.forgejo/bin/check_ver.sh +++ b/.forgejo/bin/check_ver.sh @@ -15,7 +15,7 @@ rm -f out_of_date not_in_anitya for pkg in $owned_by_you; do upstream_version=$(curl --fail -X GET -sS -H 'Content-Type: application/json' "https://release-monitoring.org/api/v2/packages/?name=$pkg&distribution=Alpine" | jq -r '.items.[].stable_version') - downstream_version=$(sed -n "/^P:$pkg$/,/^$/p" APKINDEX | awk -F ':' '{if($1=="V"){print $2}}') + downstream_version=$(sed -n "/^P:$pkg$/,/^$/p" APKINDEX | awk -F ':' '{if($1=="V"){print $2}}' | sort -V | tail -n 1) downstream_version=${downstream_version/-*} if [ -z "$upstream_version" ]; then