summaryrefslogtreecommitdiff
path: root/uselessPorts/gimp/lastVersion.sh
blob: 3d1a0ed57f53664110b4731fe120560b02a231c2 (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/gimp/" 2> /dev/null | \
    tr "\"/" "\n\n" | \
    grep "^v[[:digit:]]\+\.[[:digit:]]\+\$" | \
    sed "s/^v//" | \
    sort -V | \
    tail -n1)"

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