Just in case others are interested I ended out with this script: =============================================== #/bin/bash for arg in $@; do if [[ "${arg}" =~ "^\-" ]]; then EMERGE_ARGS="${EMERGE_ARGS} ${arg}" else BINARIES="${BINARIES} ${arg}" fi done PKG_LIST=`which ${BINARIES} | xargs -r ldd | awk '$2~/^=>$/{print $3}' | \ sort -u | xargs -r equery belongs | sort -u | while read pkg; do grep -q \ splitdebug /var/db/pkg/"$pkg"/FEATURES || echo ="$pkg"; done | xargs` if [[ -n "${PKG_LIST}" ]]; then emerge --verbose --oneshot ${EMERGE_ARGS} ${PKG_LIST} fi =============================================== This allows me to run it with -a or --ask to avoid having to wait for equery and emerge twice. Thanks Richard. :) -- Bo Andresen