From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-python+bounces-373-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 61EF213881F
	for <garchives@archives.gentoo.org>; Sun,  3 Feb 2013 10:19:35 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id C7350E0486;
	Sun,  3 Feb 2013 10:19:34 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id E6880E0486
	for <gentoo-python@lists.gentoo.org>; Sun,  3 Feb 2013 10:19:33 +0000 (UTC)
Received: from pomiocik.lan (77-253-139-92.adsl.inetia.pl [77.253.139.92])
	(using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: mgorny)
	by smtp.gentoo.org (Postfix) with ESMTPSA id 1A8B033DDE0;
	Sun,  3 Feb 2013 10:19:31 +0000 (UTC)
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
To: gentoo-python@lists.gentoo.org
Cc: python@gentoo.org,
	=?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Subject: [gentoo-python] [PATCH] Error out if something installs the 'tests' package.
Date: Sun,  3 Feb 2013 11:19:24 +0100
Message-Id: <1359886764-13676-1-git-send-email-mgorny@gentoo.org>
X-Mailer: git-send-email 1.8.1.2
Precedence: bulk
List-Post: <mailto:gentoo-python@lists.gentoo.org>
List-Help: <mailto:gentoo-python+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-python+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-python+subscribe@lists.gentoo.org>
List-Id: Discussions centering around the Python ecosystem in Gentoo Linux <gentoo-python.gentoo.org>
X-BeenThere: gentoo-python@gentoo.org
X-BeenThere: gentoo-python@lists.gentoo.org
X-Archives-Salt: 1b6094cf-58d1-4db2-b5d6-d14afab65af4
X-Archives-Hash: 43afff72ac752ccccb4d6691c2629f30

This is a common error, especially in my ebuilds or those based on mine.
It gives a bunch of collisions, so dying here seems to be acceptable
while eqawarn is easy to miss.
---
 gx86/eclass/distutils-r1.eclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass
index 27730f5..13d65b5 100644
--- a/gx86/eclass/distutils-r1.eclass
+++ b/gx86/eclass/distutils-r1.eclass
@@ -367,6 +367,10 @@ distutils-r1_python_install() {
 
 	esetup.py install "${flags[@]}" --root="${root}" "${@}"
 
+	if [[ -d ${root}$(python_get_sitedir)/tests ]]; then
+		die "Package installs 'tests' package, file collisions likely."
+	fi
+
 	if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
 		_distutils-r1_rename_scripts "${root}"
 		_distutils-r1_merge_root "${root}" "${D}"
-- 
1.8.1.2