summaryrefslogtreecommitdiff
path: root/uselessPorts/gegl/lastVersion.sh
blob: d3f3fd15477eca2749f381ef7b056ffdf4daa953 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

latestVersion="$(\
  curl "https://download.gimp.org/pub/gegl/" 2> /dev/null | \
    tr "\"" "\n" | \
    grep "^\([[:digit:]]\+\.\)*[[:digit:]]\+/\$" | \
    sed "s|/\$||" | \
    sort -V | \
    tail -n1)"

curl "https://download.gimp.org/pub/gegl/${latestVersion}/" 2> /dev/null | \
  tr "\"" "\n" | \
  grep "^gegl-\([[:digit:]]\+\.\)*[[:digit:]]\+\.tar\.bz2\$" | \
  sed "s/^gegl-\(\([[:digit:]]\+\.\)*[[:digit:]]\+\)\.tar\.bz2\$/\1/" | \
  sort -V | \
  tail -n1