#!/usr/bin/env bash . /etc/portage/make.conf if [[ $(pgrep -f -c $(basename $0)) -gt 1 ]] ; then echo other instance still running exit 1 fi for atom in $(emerge -uDN --pretend --quiet world | grep ^'\[ebuild' | sed -e 's/.* \b\([a-z0-9\-]\+\/[\_A-Za-z\.0-9\-]\+\)\b.*/\1/g'); do PACKAGE_FILE="$PKGDIR/$atom.tbz2" if [[ ! -f "$PACKAGE_FILE" ]] then #build one by one. This takes more time, however it builds all possible packages. # echo "building $atom " emerge --quiet --keep-going -B "=${atom}" &> /dev/null if [[ -f "$PACKAGE_FILE" ]] then SUCCESS="$SUCCESS $atom" else FAILURE="$atom $FAILURE" fi fi done if [[ -n "${SUCCESS}" ]] then echo "Successfully build: ${SUCCESS}" fi if [[ -n "${FAILURE}" ]] then echo "Build Failures: ${FAILURE}" fi