Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 163274 - Let emerge fall back from --ask to --pretend for non-root
Summary: Let emerge fall back from --ask to --pretend for non-root
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 147007
  Show dependency tree
 
Reported: 2007-01-22 18:09 UTC by Peter Gantner (a.k.a. nephros)
Modified: 2007-01-22 18:55 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Gantner (a.k.a. nephros) 2007-01-22 18:09:56 UTC
Users of --ask (or the shorthand) will likely include that option when calling emerge as non-root as well.
Emerge might just as well replace it with --pretend for actions which require root access, giving those users the more expected output for e.g. -av, -auN or -af.
Current behaviour of bailing out is less useful.

Patch below does this. I am not at all fluent in python so I'm not sure if code is correct in the big picture, but you get the idea.


Reproducible: Always

Steps to Reproduce:




--- emerge.orig 2007-01-22 18:46:37.000000000 +0100
+++ emerge      2007-01-22 18:55:38.000000000 +0100
@@ -3962,8 +3962,13 @@
                                if "--fetchonly" not in myopts and \
                                "--fetch-all-uri" not in myopts and \
                                myaction not in ("metadata", "regen"):
-                                       print "emerge: root access required."
-                                       sys.exit(1)
+                                       if "--ask" in myopts:
+                                               print "emerge: root access required. Falling back to --pretend."
+                                               myopts.remove("--ask")
+                                               myopts.append("--pretend")
+                                       else:
+                                               print "emerge: root access required."
+                                               sys.exit(1)
                        else:
                                print "emerge: root access required."
                                sys.exit(1)
Comment 1 Zac Medico gentoo-dev 2007-01-22 18:55:19 UTC
2.1.2 already has this feature.