#!/bin/bash # Sourceforge.net download and up-to-date support if [ -z `echo $url | grep "http://${pkgname}.sourceforge.net/*"` ]; then sfid=`wget --passive-ftp -O - -q http://sourceforge.net/projects/${pkgname} | grep 'VALUE=.* NAME="group_id"' | sed 's/.*VALUE="\([0-9]\+\)".*/\1/'` site=`lynx -dump http://sourceforge.net/project/showfiles.php?group_id=${sfid}` if [ -n "`echo ${site} | grep 'tar.bz2'`" ]; then extension=tar.bz2 elif [ -n "`echo ${site} | grep 'tar.gz'`" ]; then extension=tar.gz fi if [ -n ${extension} ]; then [ -z $up2date ] && up2date=`echo ${site} | tr ' ' '\n' | grep ${extension} | sed -n "s/.*${pkgname}-\(.*\).${extension}.*/\1/; 1 p"` [ -z $source ] && source=(http://download.sourceforge.net/${pkgname}/${pkgname}-${up2date}.${extension}) fi unset sfid site extension fi