#!/bin/bash
TMPD=`mktemp -d`
wget -q -O ${TMPD}/rss.xml http://eggs.call-cc.org/rss-5.xml
ALLEGGS=`chicken-status | sed -e 's/^\([^ ]*\) .*version: \(.*\)$/\1::\2/'`
for i in ${ALLEGGS} ; do
e=${i%::*}
v=${i#*::}
nv="`grep "^
${e} ${v} .*$" ${TMPD}/rss.xml`"
if [ -z "${nv}" ] ; then
gv="`grep "${e} .*$" ${TMPD}/rss.xml | sed -e "s/^${e} \([^ ]*\) .*$/\1/"`"
echo "chicken-update-all: getting version ${gv} for egg ${e}..."
chicken-install ${e}:${gv}
echo "chicken-update-all: finished egg ${e}."
else
echo "chicken-update-all: egg ${e} already at most recent version ${v}"
fi
done
echo -n "chicken-update-all: cleaning up ..."
rm -r ${TMPD}
echo "done."
echo "chicken-update-all: finished processing all eggs"