summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-06-03 16:03:40 -0700
committerZac Medico <zmedico@gentoo.org>2011-06-03 16:03:40 -0700
commit7425033c9da717ef2c48e7435bcce248531f9df6 (patch)
tree90aab09aae8e8db98fd3d53d87ac1fbcb99bcf79
parentd21811eec723ffc6acb1daf0e2d7b19bf3af6978 (diff)
downloadportage-7425033c9da717ef2c48e7435bcce248531f9df6.tar.gz
portage-7425033c9da717ef2c48e7435bcce248531f9df6.tar.bz2
portage-7425033c9da717ef2c48e7435bcce248531f9df6.zip
--ask: prompt for --pretend mode when necessary
-rw-r--r--pym/_emerge/main.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 11d8ca1cc..ea3282a1d 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -45,6 +45,7 @@ from _emerge.emergelog import emergelog
from _emerge._flush_elog_mod_echo import _flush_elog_mod_echo
from _emerge.is_valid_package_atom import is_valid_package_atom
from _emerge.stdout_spinner import stdout_spinner
+from _emerge.userquery import userquery
if sys.hexversion >= 0x3000000:
long = int
@@ -1729,10 +1730,13 @@ def emerge_main(args=None):
# access is required but the user is not in the portage group.
from portage.data import portage_group_warning
if "--ask" in myopts:
+ writemsg_stdout("This action requires %s access...\n" % \
+ (access_desc,), noiselevel=-1)
+ if userquery("Would you like to add --pretend to options?",
+ "--ask-enter-invalid" in myopts) == "No":
+ return 1
myopts["--pretend"] = True
del myopts["--ask"]
- print(("%s access is required... " + \
- "adding --pretend to options\n") % access_desc)
if portage.secpass < 1 and not need_superuser:
portage_group_warning()
else: