From 5b9a4ff79a25177c1be9567d60be3c5951568ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Hohwiller?= Date: Fri, 7 Oct 2022 09:15:49 +0200 Subject: [PATCH] devonfw/ide#826: centralize filtering and sorting --- docker/versions-url-op | 2 +- dotnet/versions-url-op | 1 - eclipse/versions-url-op | 2 +- get-versions | 8 ++++---- gh/versions-url-op | 1 - graalvm/versions-url-op | 2 +- gradle/versions-url-op | 2 +- jenkins/versions-url-op | 2 +- lazydocker/versions-url-op | 2 +- maven/versions-url-op | 2 +- npm/versions-url-op | 2 +- oc/versions-url-op | 2 +- pip/versions-url-op | 2 +- python/versions-url-op | 2 +- rancher/versions-url-op | 1 - terraform/versions-url-op | 1 - 16 files changed, 15 insertions(+), 19 deletions(-) delete mode 100755 dotnet/versions-url-op delete mode 100755 gh/versions-url-op delete mode 100755 rancher/versions-url-op delete mode 100755 terraform/versions-url-op diff --git a/docker/versions-url-op b/docker/versions-url-op index 4f94b47..b93f756 100755 --- a/docker/versions-url-op +++ b/docker/versions-url-op @@ -1 +1 @@ -awk -F '\\-desktop\\-[0-9]*\">Docker Desktop ' '{print $2}' | awk NF | sed 's/<\/h2>//' | sort -V -r | head -n 1 +awk -F '\\-desktop\\-[0-9]*\">Docker Desktop ' '{print $2}' | awk NF | sed 's/<\/h2>//' | sort -Vru | head -n 1 diff --git a/dotnet/versions-url-op b/dotnet/versions-url-op deleted file mode 100755 index ab11472..0000000 --- a/dotnet/versions-url-op +++ /dev/null @@ -1 +0,0 @@ -awk -F "git/refs/tags/" ' {print $2}' | awk -F "\"" '{print $1}' | awk NF | sed 's/v//' | grep -i -Ev "cr|rc|beta|alpha|pre|preview|de|servicing|rtm" | sort -V -r diff --git a/eclipse/versions-url-op b/eclipse/versions-url-op index a017023..cbb29dc 100755 --- a/eclipse/versions-url-op +++ b/eclipse/versions-url-op @@ -1 +1 @@ -awk -F 'downloads\\/packages\\/release\\/[0-9]*-[0-9]*">' '{print $2}' | awk NF | sed -e "s/<\/a><\/li>//" | sort -r -u +awk -F 'downloads\\/packages\\/release\\/[0-9]*-[0-9]*">' '{print $2}' | awk NF | sed -e "s/<\/a><\/li>//" diff --git a/get-versions b/get-versions index 9a02b5c..4396cfb 100755 --- a/get-versions +++ b/get-versions @@ -7,13 +7,13 @@ function doCurlVersions() { # range of major versions for Java versions_url="${versions_url//\$\{major\}/[8-20]}" - if [ ! -f "${1}/versions-url-op" ] + local versions_url_op="awk -F 'git/refs/tags/' ' {print $2}' | awk -F '\"' '{print $1}' | awk NF" | sed 's/v//' + if [ -f "${1}/versions-url-op" ] then - curl -s "${versions_url}" | awk -F "git/refs/tags/" ' {print $2}' | awk -F "\"" '{print $1}' | awk NF | grep -i -Ev "cr|rc|beta|alpha|pre|preview|list|dev|unstable|test" | sort -V -r >> "./${2}/available-versions.tmp" - else local versions_url_op=$(cat "${1}/versions-url-op") - eval "curl -s "${versions_url}" | "${versions_url_op}"" >> "./${2}/available-versions.tmp" fi + versions_url_op="${versions_url_op} | grep -i -Ev "alpha|beta|cr|dev|ec|list|next|pre|rc|rtm|servicing|test|unstable" | sort -Vru" + eval "curl -s "${versions_url}" | "${versions_url_op}"" >> "./${2}/available-versions.tmp" } for software in */; diff --git a/gh/versions-url-op b/gh/versions-url-op deleted file mode 100755 index 6502cb9..0000000 --- a/gh/versions-url-op +++ /dev/null @@ -1 +0,0 @@ -awk -F "git/refs/tags/" ' {print $2}' | awk -F "\"" '{print $1}' | awk NF | grep -i -Ev "test|pre" | sed 's/v//' | sort -V -r diff --git a/graalvm/versions-url-op b/graalvm/versions-url-op index aa1361f..5073aaa 100755 --- a/graalvm/versions-url-op +++ b/graalvm/versions-url-op @@ -1 +1 @@ -awk -F "git/refs/tags/" ' {print $2}' | awk -F "\"" '{print $1}' | awk NF | sed 's/m//' | sed 's/v-//' | grep -i -Ev "cr|rc|beta|alpha|pre|preview|ce" | sort -V -r +awk -F "git/refs/tags/" ' {print $2}' | awk -F "\"" '{print $1}' | awk NF | sed 's/m//' | sed 's/v-//' diff --git a/gradle/versions-url-op b/gradle/versions-url-op index 4e57605..c0e1971 100755 --- a/gradle/versions-url-op +++ b/gradle/versions-url-op @@ -1 +1 @@ -awk -F "data-version=" '{print $2}' | awk NF | cut -d " " -f 1 | tr -d "\"" | sort -V -r -u +awk -F "data-version=" '{print $2}' | awk NF | cut -d " " -f 1 | tr -d "\"" diff --git a/jenkins/versions-url-op b/jenkins/versions-url-op index 2b52325..8530b9f 100755 --- a/jenkins/versions-url-op +++ b/jenkins/versions-url-op @@ -1 +1 @@ -awk -F '|\\/<' '{print $1}' | sed -n -e 's/^//p' | sort -V -r +awk -F '|\\/<' '{print $1}' | sed -n -e 's/^//p' diff --git a/lazydocker/versions-url-op b/lazydocker/versions-url-op index e6df9a6..0c974e5 100755 --- a/lazydocker/versions-url-op +++ b/lazydocker/versions-url-op @@ -1 +1 @@ -awk -F "\"" '/tag_name/ {print $4}' | sed 's/v//' | sort -V -r | sed -n '/0\.7\.4/q;p' +awk -F "\"" '/tag_name/ {print $4}' | sed 's/v//' | sed -n '/0\.7\.4/q;p' diff --git a/maven/versions-url-op b/maven/versions-url-op index 53c37a9..f65f2c2 100755 --- a/maven/versions-url-op +++ b/maven/versions-url-op @@ -1 +1 @@ -awk -F '.*|\\/<' '{print $1}' | sed -n -e 's/^.*href="[0-9.]*\/">//p' | sort -V -r +awk -F '.*|\\/<' '{print $1}' | sed -n -e 's/^.*href="[0-9.]*\/">//p' diff --git a/npm/versions-url-op b/npm/versions-url-op index 948daff..42c597e 100755 --- a/npm/versions-url-op +++ b/npm/versions-url-op @@ -1 +1 @@ -sed 's/}/\n/g' | grep '"name":"npm"' | sed 's/.*"version":"//' | cut -f1 -d"\"" | sed '/{/d;/-pre.*/d;/-rc.*/d;/-beta.*/d;/-next.*/d;/-alpha.*/d' | sort -V -r +sed 's/}/\n/g' | grep '"name":"npm"' | sed 's/.*"version":"//' | cut -f1 -d"\"" diff --git a/oc/versions-url-op b/oc/versions-url-op index 7749934..292de21 100755 --- a/oc/versions-url-op +++ b/oc/versions-url-op @@ -1 +1 @@ -awk -F "span class=\"name\">" '{print $2}' | awk -F "" '{print $1}' | awk NF | awk '/^[0-9]/' | sed '/-ec.*/d;/-rc.*/d' | sort -V -r +awk -F "span class=\"name\">" '{print $2}' | awk -F "" '{print $1}' | awk NF | awk '/^[0-9]/' diff --git a/pip/versions-url-op b/pip/versions-url-op index 53c37a9..f65f2c2 100755 --- a/pip/versions-url-op +++ b/pip/versions-url-op @@ -1 +1 @@ -awk -F '.*|\\/<' '{print $1}' | sed -n -e 's/^.*href="[0-9.]*\/">//p' | sort -V -r +awk -F '.*|\\/<' '{print $1}' | sed -n -e 's/^.*href="[0-9.]*\/">//p' diff --git a/python/versions-url-op b/python/versions-url-op index f6bdb10..6d3b20f 100755 --- a/python/versions-url-op +++ b/python/versions-url-op @@ -1 +1 @@ -awk -F '|\\/<' '{print $1}' | sed -n -e 's/^.*href="[0-9.]*\/">//p' | sort -V -r +awk -F '|\\/<' '{print $1}' | sed -n -e 's/^.*href="[0-9.]*\/">//p' diff --git a/rancher/versions-url-op b/rancher/versions-url-op deleted file mode 100755 index 4f06854..0000000 --- a/rancher/versions-url-op +++ /dev/null @@ -1 +0,0 @@ -awk -F "git/refs/tags/" ' {print $2}' | awk -F "\"" '{print $1}' | awk NF | sed 's/v//' | grep -i -Ev "cr|rc|beta|alpha|pre|preview" | sort -V -r diff --git a/terraform/versions-url-op b/terraform/versions-url-op deleted file mode 100755 index 4f06854..0000000 --- a/terraform/versions-url-op +++ /dev/null @@ -1 +0,0 @@ -awk -F "git/refs/tags/" ' {print $2}' | awk -F "\"" '{print $1}' | awk NF | sed 's/v//' | grep -i -Ev "cr|rc|beta|alpha|pre|preview" | sort -V -r