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

curl -s 'https://sourceforge.net/projects/pidgin/files/Pidgin/' \
| sed '
  s@^.* href="/projects/pidgin/files/Pidgin/\([0-9.]\+\)/".*$@\1@
  t
  d
' \
| sort -Vr \
| while read -r v; do
  if curl -s 'https://sourceforge.net/projects/pidgin/files/Pidgin/'"${v}"'/' \
  | grep -qF ' href="https://sourceforge.net/projects/pidgin/files/Pidgin/'"${v}"'/pidgin-'"${v}"'.tar.gz/download"'; then
    printf '%s\n' "${v}"
    break
  fi
done