diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-03-18 00:36:35 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-03-18 00:36:35 +0000 |
commit | 594712beb89271a62d491c553178493a5545b029 (patch) | |
tree | 1528d1e6cd82cd25e8050e17c73ecf7692410f6e | |
parent | d1f0f21db1f63c1e357c7c2a086ff800f45f92fd (diff) | |
download | portage-594712beb89271a62d491c553178493a5545b029.tar.gz portage-594712beb89271a62d491c553178493a5545b029.tar.bz2 portage-594712beb89271a62d491c553178493a5545b029.zip |
Use apply_recursive_permissions for CONFCACHE_DIR.
svn path=/main/trunk/; revision=2926
-rw-r--r-- | pym/portage.py | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/pym/portage.py b/pym/portage.py index b5f7a68a0..11c990e92 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -2579,7 +2579,7 @@ def prepare_build_dirs(myroot, mysettings, cleanup): confcache_enabled = True if "CONFCACHE_DIR" not in mysettings: mysettings["CONFCACHE_DIR"] = os.path.join(mysettings["PORTAGE_TMPDIR"], "confcache") - confcache_dir_mode = 0775 + confcache_dir_mode = 02775 try: os.makedirs(mysettings["CONFCACHE_DIR"], mode=confcache_dir_mode) @@ -2591,27 +2591,13 @@ def prepare_build_dirs(myroot, mysettings, cleanup): confcache_enabled = False if confcache_enabled: - try: - confcache_enabled = apply_secpass_permissions( - mysettings["CONFCACHE_DIR"], - gid=portage_gid, mode=confcache_dir_mode) - except portage_exception.OperationNotPermitted, e: - writemsg("Operation Not Permitted: %s\n" % str(e)) - confcache_enabled = False + confcache_enabled = apply_recursive_permissions( + mysettings["CONFCACHE_DIR"], gid=portage_gid, + dirmode=confcache_dir_mode, dirmask=02, + filemode=0660, filemask=07002) del confcache_dir_mode - if confcache_enabled: - for x in listdir(mysettings["CONFCACHE_DIR"]): - cache_file = os.path.join(mysettings["CONFCACHE_DIR"], x) - try: - confcache_enabled = apply_secpass_permissions(cache_file, gid=portage_gid, mode=0660, mask=07000) - except portage_exception.OperationNotPermitted, e: - writemsg("Operation Not Permitted: %s\n" % str(e)) - confcache_enabled = False - except portage_exception.FileNotFound, e: - writemsg("File Not Found: %s\n" % str(e)) - if not confcache_enabled: writemsg("!!! Failed resetting perms on confcachedir %s\n" % mysettings["CONFCACHE_DIR"]) features.remove("confcache") |