prepare_build_dirs: tolerate permission issues
authorZac Medico <zmedico@gentoo.org>
Fri, 22 Oct 2010 15:16:40 +0000 (08:16 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 22 Oct 2010 15:16:40 +0000 (08:16 -0700)
pym/portage/package/ebuild/prepare_build_dirs.py

index 25e5beb6eacf213a96cccec6f763dc35a37e28c3..74cf556eab657240b2e50fb18a69d107ddc282fc 100644 (file)
@@ -72,8 +72,12 @@ def prepare_build_dirs(myroot=None, settings=None, cleanup=False):
        try:
                for mydir in mydirs:
                        ensure_dirs(mydir)
-                       apply_secpass_permissions(mydir,
-                               gid=portage_gid, uid=portage_uid, mode=0o70, mask=0)
+                       try:
+                               apply_secpass_permissions(mydir,
+                                       gid=portage_gid, uid=portage_uid, mode=0o70, mask=0)
+                       except PortageException:
+                               if not os.path.isdir(mydir):
+                                       raise
                for dir_key in ("PORTAGE_BUILDDIR", "HOME", "PKG_LOGDIR", "T"):
                        """These directories don't necessarily need to be group writable.
                        However, the setup phase is commonly run as a privileged user prior