From 7425033c9da717ef2c48e7435bcce248531f9df6 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 3 Jun 2011 16:03:40 -0700 Subject: [PATCH] --ask: prompt for --pretend mode when necessary --- pym/_emerge/main.py | 8 ++++++-- 1 file 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: -- 2.26.2