#!/bin/bash [ -s "$PORTAGE_TMPDIR" ] && exec -c /bin/bash -l -c $0 EMERGEEXTRAOPTS=$(portageq envvar EMERGEEXTRAOPTS) UPDATESTATEDIR=$(portageq envvar UPDATESTATEDIR) updates="${UPDATESTATEDIR:-/tmp}/`hostname`_updates.txt" errors="${UPDATESTATEDIR:-/tmp}/`hostname`_update_errors.txt" tmp="/tmp/$$.updates" tmperr="/tmp/$$.errors" emerge -uDNpvq --with-bdeps=y ${EMERGEEXTRAOPTS} @world @system > ${tmp} 2> ${tmperr} mv ${tmp} ${updates} mv ${tmperr} ${errors} cat ${errors}