#!/bin/bash GOOD=$'\e[32;01m' NORMAL=$'\e[0m' currentpackage=1 packages='x11-wm/compiz x11-libs/compiz-bcop x11-plugins/compiz-fusion-plugins-main x11-plugins/compiz-fusion-plugins-extra x11-plugins/compiz-fusion-plugins-unsupported x11-plugins/compiz-fusion-plugins-wallpaper x11-plugins/compiz-fusion-plugins-gears x11-plugins/compiz-fusion-plugins-threed x11-wm/emerald x11-themes/emerald-themes x11-libs/libcompizconfig dev-python/compizconfig-python x11-apps/ccsm x11-wm/compiz-fusion x11-apps/fusion-icon' total=0 for p in $packages; do total=`echo "$total+1" | bc` done for x in $packages; do buildcount=0 echo -e " ${GOOD}\0452${NORMAL} (${currentpackage} of ${total}) Building ${x}" emerge -v1 ${x} && buildcount=1 if [ "$buildcount" == "0" ] then echo -e " ${GOOD}\0452${NORMAL} (${currentpackage} of ${total}) Trying to build ${x} again" emerge -v1 ${x} && buildcount=1 fi if [ "$buildcount" == "0" ] then echo "Couldn't successfully build ${x}" broken="${broken}\n ${GOOD}\0452${NORMAL}${x}" fi currentpackage=`echo "$currentpackage+1" | bc` done if [ -n "${broken}" ] then echo -e "These are the packages that are broken:${broken}" | less else echo -e "All packages built correctly." fi