summaryrefslogtreecommitdiff
path: root/portage-update.sh
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2017-12-27 10:59:17 +0000
committerLuke Bratch <luke@bratch.co.uk>2017-12-27 10:59:17 +0000
commitcdecf74889ded7832e1e36f523f3b383f49ecf7d (patch)
treec7241fae2ef2a0ae4751037e7807ea8b9f266126 /portage-update.sh
parent7d4944c402f7472ed85407d2da3428fcb5baa94e (diff)
Implement checking for new news items, plus the ability to skip the check
Diffstat (limited to 'portage-update.sh')
-rwxr-xr-xportage-update.sh9
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'