diff --git a/buildUpgradePackages.sh b/buildUpgradePackages.sh index 4661872..ebfad8c 100755 --- a/buildUpgradePackages.sh +++ b/buildUpgradePackages.sh @@ -2,11 +2,20 @@ . /etc/portage/make.conf +script="$0" + +function mylog() { + logger -t "$script" "${*}" +} + +mylog "testing if other instances are running" + if [[ $(pgrep -f -c $(basename $0)) -gt 1 ]] ; then -# echo other instance still running + mylog "other instance still running" exit 1 fi +mylog "start building packages" 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" @@ -27,9 +36,11 @@ done if [[ -n "${SUCCESS}" ]] then echo "Successfully build: ${SUCCESS}" + mylog "Successfully build: ${SUCCESS}" fi if [[ -n "${FAILURE}" ]] then echo "Build Failures: ${FAILURE}" + mylog "Build Failures: ${FAILURE}" fi