Allow sync for unpriviledges users if they have write access to $PORTDIR (bug #182786...
authorZac Medico <zmedico@gentoo.org>
Sun, 24 Jun 2007 09:44:08 +0000 (09:44 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 24 Jun 2007 09:44:08 +0000 (09:44 -0000)
svn path=/main/branches/2.1.2/; revision=6991

bin/emerge

index 3d6e9e245ebf30c0e8ce040fa90a008b4420d2b0..2502387d254215ea9325b0f7ba6adc7ab0e1277d 100755 (executable)
@@ -5472,12 +5472,12 @@ def emerge_main():
        # 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 "--pretend" not in myopts and myaction not in ("search","info"):
                        need_superuser = not \
                                ("--fetchonly" in myopts or \
                                "--fetch-all-uri" in myopts or \
-                               myaction in ("metadata", "regen"))
+                               myaction in ("metadata", "regen") or \
+                               (myaction == "sync" and os.access(settings["PORTDIR"], os.W_OK))
                        if portage.secpass < 1 or \
                                need_superuser:
                                if need_superuser: