diff --git a/check_updates.sh b/check_updates.sh index 157dd78..e2ad10c 100755 --- a/check_updates.sh +++ b/check_updates.sh @@ -5,7 +5,10 @@ PATH="$PATH:/usr/sbin:/sbin" TMP_FILE=$(mktemp) MAIL=$(mktemp) -PORTAGE_RUNING=$(pgrep emerge) +# Possible race condition: if someone runs `eix blah` at the exact same time, +# it will block the update. But that seems highly improbable. +# The mail goal is to avoid stacking updates or eix-sync/eix-updates +PORTAGE_RUNING=$(pgrep 'emerge|eix') if [ "${PORTAGE_RUNING}" ]; then echo "Error: another emerge is already running, exiting" exit 1 @@ -13,7 +16,7 @@ fi PORTAGE_QUIET='1' -eix-sync 1>/dev/null 2>${TMP_FILE} +eix-sync 1>/dev/null 2>${TMP_FILE} || eix-update 1>/dev/null 2>${TMP_FILE} emerge -v --update --newuse --deep --with-bdeps=y --quiet-build=y @security \ &>> ${TMP_FILE}