From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-commits+bounces-361862-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1QgIJs-00025C-Gl
	for garchives@archives.gentoo.org; Mon, 11 Jul 2011 15:22:50 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 8043921C0F8;
	Mon, 11 Jul 2011 15:22:40 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id 497CB21C0F8
	for <gentoo-commits@lists.gentoo.org>; Mon, 11 Jul 2011 15:22:40 +0000 (UTC)
Received: from pelican.gentoo.org (unknown [66.219.59.40])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id C6F051B4014
	for <gentoo-commits@lists.gentoo.org>; Mon, 11 Jul 2011 15:22:39 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by pelican.gentoo.org (Postfix) with ESMTP id 026D18003D
	for <gentoo-commits@lists.gentoo.org>; Mon, 11 Jul 2011 15:22:39 +0000 (UTC)
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" <zmedico@gentoo.org>
Message-ID: <2c60ee5faad6f39162556820a4a67d2909e1a83d.zmedico@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/
X-VCS-Repository: proj/portage
X-VCS-Files: pym/portage/package/ebuild/prepare_build_dirs.py
X-VCS-Directories: pym/portage/package/ebuild/
X-VCS-Committer: zmedico
X-VCS-Committer-Name: Zac Medico
X-VCS-Revision: 2c60ee5faad6f39162556820a4a67d2909e1a83d
Date: Mon, 11 Jul 2011 15:22:39 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 
X-Archives-Hash: 27685e6cedf43afbbf0589da39e9e027

commit:     2c60ee5faad6f39162556820a4a67d2909e1a83d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 11 15:22:11 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jul 11 15:22:11 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a=
=3Dcommit;h=3D2c60ee5f

prepare_build_dirs: warn for logdir permission

If there is insufficient permission to use PORT_LOGDIR or the required
subdirectory, warn instead of raising an exception. Also, fall back to
using $T/build.log as a last resort.

---
 pym/portage/package/ebuild/prepare_build_dirs.py |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/pym/portage/package/ebuild/prepare_build_dirs.py b/pym/porta=
ge/package/ebuild/prepare_build_dirs.py
index 259bedf..5153190 100644
--- a/pym/portage/package/ebuild/prepare_build_dirs.py
+++ b/pym/portage/package/ebuild/prepare_build_dirs.py
@@ -300,6 +300,7 @@ def _prepare_workdir(mysettings):
 	if 'compress-build-logs' in mysettings.features:
 		compress_log_ext =3D '.gz'
=20
+	logdir_subdir_ok =3D False
 	if "PORT_LOGDIR" in mysettings and \
 		os.access(mysettings["PORT_LOGDIR"], os.W_OK):
 		logid_path =3D os.path.join(mysettings["PORTAGE_BUILDDIR"], ".logid")
@@ -320,9 +321,19 @@ def _prepare_workdir(mysettings):
 				(mysettings["CATEGORY"], mysettings["PF"], logid_time,
 				compress_log_ext))
=20
-		ensure_dirs(os.path.dirname(mysettings["PORTAGE_LOG_FILE"]))
+		log_subdir =3D os.path.dirname(mysettings["PORTAGE_LOG_FILE"])
+		try:
+			ensure_dirs(log_subdir)
+		except PortageException as e:
+			writemsg(_unicode_decode("!!! %s\n") % (e,), noiselevel=3D-1)
+		else:
+			if os.access(log_subdir, os.W_OK):
+				logdir_subdir_ok =3D True
+			else:
+				writemsg(_unicode_decode("!!! %s: %s\n") %
+					(_("Permission Denied"), log_subdir), noiselevel=3D-1)
=20
-	else:
+	if not logdir_subdir_ok:
 		# NOTE: When sesandbox is enabled, the local SELinux security policies
 		# may not allow output to be piped out of the sesandbox domain. The
 		# current policy will allow it to work when a pty is available, but