All pastes #166335 Raw Edit

rebuild-packages.sh

public shellscript v1 · immutable
·published 2006-09-10 20:17 UTC
rendered paste body
#! /bin/shpaket_datei="$1"done_datei="${paket_datei}.done"err_datei="${paket_datei}.err"if [ ! -e "$paket_datei" ]; then        echo "Error! Package file doesn't exist."        echo "Syntax: $0 FILE_WITH_PACKAGE_NAMES"        exit 1fi[ ! -e "${done_datei}" ] && touch "${done_datei}"[ ! -e "${err_datei}" ] && touch "${err_datei}"grep '^\[ebuild' "$paket_datei" | cut -c 17- | while read pkg rest ; do        grep -q "$pkg" "$done_datei" && continue        echo "`date`: Building \"$pkg\"..."        if emerge --oneshot --nodeps ="$pkg" ; then                echo "`date`: Package \"$pkg\" build successfully." | tee -a "$done_datei"        else                code="$?"                echo "`date`: Error while building package \"$pkg\". Code: \"$code\"" | tee -a "$err_datei"                exit $code        fidone