summaryrefslogtreecommitdiff
blob: 6152e107b935afd0a1fda5343bb249d702238ac2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

# Strip cat, we only need the pkg name
pearpkg="`echo ${1} | sed -e "s|^.*/||g"`"

# Take care of some strange package naming
pearpkg="${pearpkg/PEAR-/}"

# Take care of outputting the version number
pwd="`pwd`"
if ! test -d "${pwd}/${pearpkg}-tmp" ; then
	mkdir "${pwd}/${pearpkg}-tmp"
fi
cd "${pwd}/${pearpkg}-tmp"
wget --quiet --tries=1 --timeout=3 "http://pear.php.net/feeds/pkg_${pearpkg}.rss"
grep -i title pkg_${pearpkg}.rss | sed -e "s|<title>||g" | sed -e "s|</title>||g" | head -n 2 | tail -n 1 | awk '{print $NF}'
rm -Rf "${pwd}/${pearpkg}-tmp"