Gentoo Archives: gentoo-user

From: Alexander Kapshuk <alexander.kapshuk@×××××.com>
To: Gentoo mailing list <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] suppressing the 'would you like to add --pretend' prompt when using emerge --ask
Date: Sun, 17 Apr 2016 18:55:12
Message-Id: CAJ1xhMVznmniM=qz=M-sqEbxJyH4SyESijhHKXA3byh3EZd3gg@mail.gmail.com
In Reply to: [gentoo-user] suppressing the 'would you like to add --pretend' prompt when using emerge --ask by "»Q«"
1 On Sun, Apr 17, 2016 at 8:57 PM, »Q« <boxcars@×××.net> wrote:
2 > I too often forget to use sudo along with emerge --ask, which gets me
3 > a prompt to add --pretend to the options, e.g.
4 >
5 > $ emerge -a firefox
6 > This action requires superuser access...
7 > Would you like to add --pretend to options? [Yes/No] n
8 > $ doh
9 > Password:
10 >
11 > These are the packages that would be merged, in order:
12 >
13 > Calculating dependencies /... done!
14 >
15 > ( 'doh' is an alias for 'sudo $(history -p \!\!)' )
16 >
17 > I never want to add --pretend to the options; if I've used --ask,
18 > I also meant to use sudo. I've looked through the documentation and
19 > couldn't find a way to stop emerge from prompting me about --pretend,
20 > so now I'm asking you if I've overlooked a way.
21 >
22 >
23
24 Yes, the 'Would you like to add --pretend to options?' query does seem
25 to be hard-coded. See below.
26 portage-2.2.26/pym/_emerge/actions.py:2976,3004
27 # check if root user is the current user for the actions where emerge needs this
28 ...
29 uq = UserQuery(emerge_config.opts)
30 if uq.query("Would you like to add --pretend to options?",
31 "--ask-enter-invalid" in emerge_config.opts) == "No":
32 ...
33
34 I wonder if running the command line in the debug mode, 'emerge -ad
35 firefox', would reveal anything of interest.

Replies