diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-03-30 10:09:00 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-03-30 10:09:00 +0000 |
commit | 53f45dd603af86f7d0fa4b9c9a1a1785460b352b (patch) | |
tree | 1a4ff86aa2b15170f7c03fd9ecfb7f48d3a08b52 | |
parent | 71cfafbd5fb34d125cdfba7b68a5401e30218c9b (diff) | |
download | portage-53f45dd603af86f7d0fa4b9c9a1a1785460b352b.tar.gz portage-53f45dd603af86f7d0fa4b9c9a1a1785460b352b.tar.bz2 portage-53f45dd603af86f7d0fa4b9c9a1a1785460b352b.zip |
Use ensure_dirs for CCACHE_DIR, CONFCACHE_DIR, and DISTCC_DIR.
svn path=/main/trunk/; revision=3041
-rw-r--r-- | pym/portage.py | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/pym/portage.py b/pym/portage.py index 9ce918114..abbe58eff 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -2514,26 +2514,13 @@ def prepare_build_dirs(myroot, mysettings, cleanup): for subdir in kwargs["subdirs"]: mydirs.append(os.path.join(basedir, subdir)) for mydir in mydirs: - if not makedirs(mydir): - raise portage_exception.DirectoryNotFound( - "Failed to create directory.") - try: - initial_stat = os.stat(mydir) - apply_secpass_permissions(mydir, - gid=portage_gid, mode=dirmode, mask=modemask, stat_cached=initial_stat) - result_stat = os.stat(mydir) - except OSError, oe: - if errno.EPERM == oe.errno: - writemsg("!!! %s\n" % oe) - raise portage_exception.OperationNotPermitted("stat('%s')" % mydir) - raise + 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. - if kwargs["always_recurse"] or \ - result_stat.st_gid != initial_stat.st_gid or \ - result_stat.st_mode & 07777 != initial_stat.st_mode & 07777: - if not kwargs["always_recurse"]: + if modified or kwargs["always_recurse"]: + if modified: writemsg("Adjusting permissions recursively: '%s'" % mydir) def onerror(e): raise # The feature is disabled if a single error |