commit:     8a9f865ae433d8b7609bd1754e0328d88d2a2bda
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 20 20:04:28 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 21 23:21:14 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8a9f865a

emerge --read-news: prompt only if --ask

This fixes any conditional logic that applies to --ask so that it
also applies to --read-news. For example, emerge will bail out
automatically if --ask is enabled and stdin is not a tty.

X-Gentoo-Bug: 517310
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=517310

---
 man/emerge.1           | 5 +++--
 pym/_emerge/actions.py | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/man/emerge.1 b/man/emerge.1
index 9873ba9..12e8b45 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -716,8 +716,9 @@ Disable the warning message that's shown prior to
 to be set in the \fBmake.conf\fR(5)
 \fBEMERGE_DEFAULT_OPTS\fR variable.
 .TP
-.BR "\-\-read-news [ y | n ]"
-Offer to read news via eselect if there are unread news.
+.BR "\-\-read\-news [ y | n ]"
+Offer to read news via eselect if there are unread news. This option
+has no effect unless \fB\-\-ask\fR is enabled.
 .TP
 .BR "\-\-rebuild\-if\-new\-slot [ y | n ]"
 Automatically rebuild or reinstall packages when slot/sub\-slot :=

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 4e8b83b..ee57cec 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -4064,6 +4064,7 @@ def run_action(emerge_config):
                        uq = UserQuery(emerge_config.opts)
                        if 
display_news_notification(emerge_config.target_config,
                                                                
emerge_config.opts) \
+                               and "--ask" in emerge_config.opts \
                                and "--read-news" in emerge_config.opts \
                                and uq.query("Would you like to read the news 
items while " \
                                                "calculating dependencies?",

Reply via email to