summaryrefslogtreecommitdiff
path: root/manualPorts/hugin/lastVersion.sh
blob: 842f8380201815799fd22fade84f57230f6f3f6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

for s in $(
  curl "https://sourceforge.net/projects/hugin/files/hugin/" 2> /dev/null | \
    tr '"' '\n' | \
    grep "^/projects/hugin/files/hugin/.*/\$"
)
do
  inhalt="$(
    curl "https://sourceforge.net${s}" 2> /dev/null | \
      tr '"' '\n' | \
      grep "^https://sourceforge.net${s}hugin-[0-9.-]*\.tar\.bz2/download\$" | \
      sed "s|^https://sourceforge.net${s}hugin-\([0-9.-]*\)\.tar\.bz2/download\$|\1|" | \
      head -n1
  )"
  if [ -n "${inhalt}" ]
  then
    if [[ "${inhalt}" = *.*.* ]]; then
      echo "${inhalt}"
    else
      echo "${inhalt}.0"
    fi
    break
  fi
done