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

curl "ftp://ftp.freepascal.org/pub/fpc/dist/" 2> /dev/null | \
  awk '{print $9}' | \
  grep "^[0-9.-]*\$" | \
  sort -rV | \
  while read -r version
  do
    if curl "ftp://ftp.freepascal.org/pub/fpc/dist/${version}/source/" 2> /dev/null | \
      sed 's|^.* ||' | \
      grep -q "^fpcbuild-${version}\.tar\.gz\$"
    then
      echo "${version}"
      break
    fi
  done