On Sun, 17 Apr 2016 21:54:16 +0300
Alexander Kapshuk <alexander.kaps...@gmail.com> wrote:

> On Sun, Apr 17, 2016 at 8:57 PM, »Q« <boxc...@gmx.net> wrote:
> > I too often forget to use sudo along with emerge --ask, which gets
> > me a prompt to add --pretend to the options, e.g.
> >
> > $ emerge -a firefox
> > This action requires superuser access...
> > Would you like to add --pretend to options? [Yes/No] n
> > $ doh
> > Password:
> >
> > These are the packages that would be merged, in order:
> >
> > Calculating dependencies /... done!
> >
> > ( 'doh' is an alias for 'sudo $(history -p \!\!)'  )
> >
> > I never want to add --pretend to the options;  if I've used --ask,
> > I also meant to use sudo.  I've looked through the documentation and
> > couldn't find a way to stop emerge from prompting me about
> > --pretend, so now I'm asking you if I've overlooked a way.  
> 
> Yes, the 'Would you like to add --pretend to options?' query does seem
> to be hard-coded. See below.
> portage-2.2.26/pym/_emerge/actions.py:2976,3004
> # check if root user is the current user for the actions where emerge
> needs this ...
> uq = UserQuery(emerge_config.opts)
> if uq.query("Would you like to add --pretend to options?",
>     "--ask-enter-invalid" in emerge_config.opts) == "No":
> ...

Thanks.  I'll keep living with the prompt and maybe eventually file an
enhancement bug to make it optional.

> I wonder if running the command line in the debug mode, 'emerge -ad
> firefox', would reveal anything of interest.

It shows my options for emerge.

$ emerge -ad firefox
myaction None
myopts {'--with-bdeps': 'y', '--load-average': 11.2, '--debug': True, '--jobs': 
8, '--ask': True, '--ask-enter-invalid': True}
This action requires superuser access...
Would you like to add --pretend to options? [Yes/No] n

Since --ask-enter-invalid appeared in that bit of code, I tried taking
it out of my options in make.conf -- as I expected, that didn't
change whether I get the prompt, just changed how I can answer it.




Reply via email to