summaryrefslogtreecommitdiff
path: root/manualPorts/gexiv2/lastVersion.sh
blob: bdbcd78212cb3b8584d9be22031a32853c074bd2 (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
#!/bin/bash

for mainVer in $(
  curl -Ss 'https://download.gnome.org/sources/gexiv2/' | \
    tr '"' '\n' | \
    grep '^[0-9.]\+/$' | \
    sed 's|/$||' | \
    sort -Vr
)
do
  ver="$(
    curl -Ss "https://download.gnome.org/sources/gexiv2/${mainVer}/" | \
      tr '"' '\n' | \
      grep '^gexiv2-[0-9.]\+\.tar\.xz$' | \
      sed 's|^gexiv2-\([0-9.]\+\)\.tar\.xz$|\1|' | \
      sort -V | \
      tail -n1
  )"
  if [ -n "${ver}" ]
  then
    echo "${ver}"
    break
  fi
done