#!/bin/bash declare -a atoms if [[ x$1 == x ]] ; then atoms=( '@world' ) else atoms=( "$@" ) fi emerge_result=$( emerge --ignore-default-opts -epqD --backtrack=999 --with-bdeps=y "${atoms[@]}" 2>/dev/null ) trouble=$? echo "${emerge_result}" |grep -v ^.uninstall | grep -v ^.blocks | sed 's/^.[^]]*] /=/;s/ \[[^]]*].*$//' if [[ ${trouble} != 0 ]] ; then echo "WARNING: results not reliable due to portage failure." >&2 echo "since portage stderr is ignored by this script, this" >&2 echo "could mean anything, perhaps depsolving trouble?" >&2 exit ${trouble} fi exit 0