From 63b41a4633956a4f19e9cfa02dcd7abf9e608e52 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 13 Mar 2006 21:24:48 +0000 Subject: [PATCH] Simplify emerge's secpass logic. svn path=/main/trunk/; revision=2867 --- bin/emerge | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/bin/emerge b/bin/emerge index 9bc19cdab..c562fd1c1 100755 --- a/bin/emerge +++ b/bin/emerge @@ -591,30 +591,22 @@ def help(): # Move all the help stuff out of this file. emergehelp.help(myaction,myopts,havecolor) -# check if root user is the current user for the actions where emerge needs this -if ("--pretend" in myopts) or ("--fetchonly" in myopts or "--fetch-all-uri" in myopts) or (myaction=="search"): - if not portage.secpass: - if portage.wheelgid==portage.portage_gid: - print "emerge: wheel group membership required for \"--pretend\" and search." - print "emerge: wheel group use is being deprecated. Please update group and passwd to" - print " include the portage user as noted above, and then use group portage." - else: - print "emerge: portage group membership required for \"--pretend\" and search." - sys.exit(1) -elif "--version" in myopts: +if "--version" in myopts: print getportageversion() sys.exit(0) elif "--help" in myopts: help() sys.exit(0) -elif portage.secpass!=2: - if myaction in ["search", "info", "regen", "metadata"]: - pass - elif not myaction and not myfiles and "--resume" not in myopts: - pass - elif ("--pretend" in myopts) and (myaction in ["world","system","clean","prune","unmerge"]): - pass - else: + +if portage.wheelgid == portage.portage_gid: + print "emerge: wheel group use is being deprecated. Please update group and passwd to" + print " include the portage user as noted above, and then use group portage." + +# check if root user is the current user for the actions where emerge needs this +if portage.secpass < 2: + # We've already allowed "--version" and "--help" above. + if "--pretend" not in myopts and \ + myaction not in ("search","info"): if "--debug" in myopts: print "myaction",myaction print "myopts",myopts -- 2.26.2