Only apply permissions to ccache, confcache, and distcc dirs when they are created...
authorZac Medico <zmedico@gentoo.org>
Sun, 8 Apr 2007 19:36:54 +0000 (19:36 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 8 Apr 2007 19:36:54 +0000 (19:36 -0000)
svn path=/main/trunk/; revision=6354

pym/portage/__init__.py

index 3e09e99929567c1d3b7a9c365b5c5948f76e3f38..072262a31e9215fd11d7fd2b4e62a454f042be07 100644 (file)
@@ -3219,12 +3219,12 @@ def prepare_build_dirs(myroot, mysettings, cleanup):
                "confcache":{
                        "basedir_var":"CONFCACHE_DIR",
                        "default_dir":os.path.join(mysettings["PORTAGE_TMPDIR"], "confcache"),
-                       "always_recurse":True},
+                       "always_recurse":False},
                "distcc":{
                        "basedir_var":"DISTCC_DIR",
                        "default_dir":os.path.join(mysettings["BUILD_PREFIX"], ".distcc"),
                        "subdirs":("lock", "state"),
-                       "always_recurse":True}
+                       "always_recurse":False}
        }
        dirmode  = 02070
        filemode =   060
@@ -3241,11 +3241,10 @@ def prepare_build_dirs(myroot, mysettings, cleanup):
                                        for subdir in kwargs["subdirs"]:
                                                mydirs.append(os.path.join(basedir, subdir))
                                for mydir in mydirs:
-                                       modified = portage.util.ensure_dirs(mydir,
-                                               gid=portage_gid, mode=dirmode, mask=modemask)
-                                       # To avoid excessive recursive stat calls, we trigger
-                                       # recursion when the top level directory does not initially
-                                       # match our permission requirements.
+                                       modified = portage.util.ensure_dirs(mydir)
+                                       # Generally, we only want to apply permissions for
+                                       # initial creation.  Otherwise, we don't know exactly what
+                                       # permissions the user wants, so should leave them as-is.
                                        if modified or kwargs["always_recurse"]:
                                                if modified:
                                                        writemsg("Adjusting permissions recursively: '%s'\n" % mydir,