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

curl -Ss "ftp://ftp.freepascal.org/pub/fpc/dist/" | \
  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