1 |
From 26e427aff7d247a730d3a6f1f573c9b048ed1c86 Mon Sep 17 00:00:00 2001 |
2 |
From: Zac Medico <zmedico@g.o> |
3 |
Date: Mon, 20 Oct 2014 13:04:28 -0700 |
4 |
Subject: [PATCH] emerge --read-news: prompt only if --ask |
5 |
|
6 |
X-Gentoo-Bug: 517310 |
7 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=517310 |
8 |
--- |
9 |
man/emerge.1 | 5 +++-- |
10 |
pym/_emerge/actions.py | 1 + |
11 |
2 files changed, 4 insertions(+), 2 deletions(-) |
12 |
|
13 |
diff --git a/man/emerge.1 b/man/emerge.1 |
14 |
index 9873ba9..12e8b45 100644 |
15 |
--- a/man/emerge.1 |
16 |
+++ b/man/emerge.1 |
17 |
@@ -716,8 +716,9 @@ Disable the warning message that's shown prior to |
18 |
to be set in the \fBmake.conf\fR(5) |
19 |
\fBEMERGE_DEFAULT_OPTS\fR variable. |
20 |
.TP |
21 |
-.BR "\-\-read-news [ y | n ]" |
22 |
-Offer to read news via eselect if there are unread news. |
23 |
+.BR "\-\-read\-news [ y | n ]" |
24 |
+Offer to read news via eselect if there are unread news. This option |
25 |
+has no effect unless \fB\-\-ask\fR is enabled. |
26 |
.TP |
27 |
.BR "\-\-rebuild\-if\-new\-slot [ y | n ]" |
28 |
Automatically rebuild or reinstall packages when slot/sub\-slot := |
29 |
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py |
30 |
index 4e8b83b..7672fe6 100644 |
31 |
--- a/pym/_emerge/actions.py |
32 |
+++ b/pym/_emerge/actions.py |
33 |
@@ -4064,6 +4064,7 @@ def run_action(emerge_config): |
34 |
uq = UserQuery(emerge_config.opts) |
35 |
if display_news_notification(emerge_config.target_config, |
36 |
emerge_config.opts) \ |
37 |
+ and "--ask" in emerge_config.opt \ |
38 |
and "--read-news" in emerge_config.opts \ |
39 |
and uq.query("Would you like to read the news items while " \ |
40 |
"calculating dependencies?", |
41 |
-- |
42 |
2.0.4 |