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

lastDir="$(
  curl "https://sourceforge.net/projects/lazarus/files/Lazarus%20Zip%20_%20GZip/" 2> /dev/null | \
    tr "\"" "\n" | \
    grep "^/projects/lazarus/files/Lazarus%20Zip%20_%20GZip/Lazarus%20[0-9.-]*/\$" | \
    sed "s|^/projects/lazarus/files/Lazarus%20Zip%20_%20GZip/Lazarus%20\(.*\)/\$|\1|" | \
    sort -V | \
    tail -n1
  )"

curl "https://sourceforge.net/projects/lazarus/files/Lazarus%20Zip%20_%20GZip/Lazarus%20${lastDir}/" 2> /dev/null | \
  tr "\"" "\n" | \
  grep "^lazarus-[0-9.-]*\.tar\.gz\$" | \
  sed "s|^lazarus-\([0-9.]*\)\(-[0-9.-]*\)\?\.tar\.gz\$|\1|" | \
  sort -V | \
  tail -n1