diff options
-rwxr-xr-x | portage-update.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/portage-update.sh b/portage-update.sh index 1ef417f..43ff452 100755 --- a/portage-update.sh +++ b/portage-update.sh @@ -24,6 +24,8 @@ do ;; --skip-preserved-rebuild) export SKIP_PRESERVED_REBUILD="true" # In case we don't want to do an "emerge @preserved-rebuild" ;; + --skip-news) export SKIP_NEWS="true" # In case we don't to read new news before continuing + ;; --*) echo "bad argument '$1'" ; exit 1 ;; *) echo "unexpected argument '$1'" ; exit 1 @@ -36,6 +38,13 @@ done echo 'emerge --sync' emerge --sync || exit 1 +# Check to see if there's any news, unless skipped +if [ -z ${SKIP_NEWS+x} ] && [ $(eselect news count new) -ne "0" ]; then + echo "IMPORTANT: at least 1 news item needs reading" + echo "Use eselect news read to view new items" + exit 1 +fi + # Do a @world update, unless skipped if [ -z ${SKIP_UPDATE+x} ]; then echo 'emerge --keep-going -av --update --newuse --deep --with-bdeps=y @world' |