summaryrefslogtreecommitdiff
path: root/manualPorts/boinc-client/lastVersion.sh
blob: cd54219ca1bc1785aa69b5c2c9c24085eb6a8d7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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}"