summaryrefslogtreecommitdiff
path: root/manualPorts/fpc-src/lastVersion.sh
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-05-27 10:13:52 +0200
committerErich Eckner <git@eckner.net>2018-05-27 10:13:52 +0200
commit14a8f5d3c7889f2046a008b1b1dc29f485ebb359 (patch)
tree644ebb60f7155dd5c139d233857684fbcd8546e6 /manualPorts/fpc-src/lastVersion.sh
downloadcrux-ports-14a8f5d3c7889f2046a008b1b1dc29f485ebb359.tar.xz
initial commit
Diffstat (limited to 'manualPorts/fpc-src/lastVersion.sh')
-rwxr-xr-xmanualPorts/fpc-src/lastVersion.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/manualPorts/fpc-src/lastVersion.sh b/manualPorts/fpc-src/lastVersion.sh
new file mode 100755
index 0000000..3e81eb0
--- /dev/null
+++ b/manualPorts/fpc-src/lastVersion.sh
@@ -0,0 +1,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