summaryrefslogtreecommitdiff
path: root/manualPorts/fpc/lastVersion.sh
blob: 1bc4a951a33389c17eff3ef223ca1635cf0bdacf (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 -x '[0-9.]\+' | \
  sort -Vr | \
  while read -r ver; do
    curl -Ss "ftp://ftp.freepascal.org/pub/fpc/dist/${ver}/source/" | \
      awk '{print $9}' | \
      grep -m1 -xF "fpcbuild-${ver}.tar.gz" && \
      break
  done | \
  sed '
    s/^fpcbuild-//
    s/\.tar\.gz$//
  '