summaryrefslogtreecommitdiff
path: root/manualPorts/boinc-client/lastVersion.sh
diff options
context:
space:
mode:
Diffstat (limited to 'manualPorts/boinc-client/lastVersion.sh')
-rwxr-xr-xmanualPorts/boinc-client/lastVersion.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/manualPorts/boinc-client/lastVersion.sh b/manualPorts/boinc-client/lastVersion.sh
new file mode 100755
index 0000000..cd54219
--- /dev/null
+++ b/manualPorts/boinc-client/lastVersion.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+tags="$(git ls-remote --tags https://github.com/BOINC/boinc "client_release/*.*/*.*.*" | \
+ grep -v "\^{}\$" | \
+ sed "s/^\S\+\s\+.*\/client_release\/[^/]*\/\(.*\)\$/\1/" | \
+ sort -n)"
+main="$(echo -e "${tags}" | \
+ cut -d . -f 1 | \
+ sort -n | \
+ tail -n1)"
+tags="$(echo -e "${tags}" | \
+ grep "^${main}\." | \
+ sed "s/^[^.]\+\.//")"
+sub="$(echo -e "${tags}" | \
+ cut -d . -f 1 | \
+ sort -n | \
+ tail -n1)"
+tags="$(echo -e "${tags}" | \
+ grep "^${sub}\." | \
+ sed "s/^[^.]\+\.//")"
+subsub="$(echo -e "${tags}" | \
+ sort -n | \
+ tail -n1)"
+
+echo "${main}.${sub}.${subsub}"