chicken-update-all script, slightly more verbose for others to be happy with added by elflng on Wed Jan 11 23:40:04 2023

#!/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 "^<title>${e} ${v} .*$" ${TMPD}/rss.xml`"
    if [ -z "${nv}" ] ; then
        gv="`grep "<title>${e} .*$" ${TMPD}/rss.xml | sed -e "s/^<title>${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"