In chk_updated_cfg_files(), avoid scanning for config files for
authorZac Medico <zmedico@gentoo.org>
Wed, 28 Nov 2007 08:27:28 +0000 (08:27 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 28 Nov 2007 08:27:28 +0000 (08:27 -0000)
paths that aren't writable by the current user. This prevents
Permission denied errors from being triggered later when trying
to scan subdirectories that are inaccessible.

svn path=/main/trunk/; revision=8726

pym/_emerge/__init__.py

index 0a4c0027c48404ddc8cab58f743db91b66e99b52..af0ecd323f740d6c8e30c0bb0654e91072c64b77 100644 (file)
@@ -5051,6 +5051,10 @@ def chk_updated_cfg_files(target_root, config_protect):
                procount=0
                for x in config_protect:
                        x = os.path.join(target_root, x.lstrip(os.path.sep))
+                       if not os.access(x, os.W_OK):
+                               # Avoid Permission denied errors generated
+                               # later by `find`.
+                               continue
                        try:
                                mymode = os.lstat(x).st_mode
                        except OSError: