From cdecf74889ded7832e1e36f523f3b383f49ecf7d Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Wed, 27 Dec 2017 10:59:17 +0000 Subject: Implement checking for new news items, plus the ability to skip the check --- portage-update.sh | 9 +++++++++ 1 file changed, 9 insertions(+) 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' -- cgit v1.2.3