#!/bin/sh

[ -f 'downloads' ] &&  rm 'downloads'
wget https://bitbucket.org/rivanvx/beamer/downloads >/dev/null 2>/dev/null
if [ $? = 0 ]; then
	[ -f unfetchable ] && rm unfetchable
	grep '</span> Tags' < downloads | md5sum > new-sum
	touch sum
	if [ "$(cat sum)" = "$(cat new-sum)" ]; then
		rm new-sum
	else
		mv new-sum sum
		echo 'latex-beamer'
	fi
	rm downloads
elif [ ! -f unfetchable ]; then
	touch unfetchable
	echo 'latex-beamer (unfetchable)'
fi