Hello fellow Portage developers,

attached portage patch draft aims to allow for easy distributing eclasses to be 
tested by
multiple tinderboxes on various architectures, without being active for normal 
installs.

Usage is to have in make.conf (or profile): PORTAGE_ECLASS_VARIANTS="testing"
and for the eclass: to live in tree-or-overlay/eclass/testing/

Thoughts? (even for var-naming, manpage yes/no/wording, ...)

Thank you!
/haubi/
>From 2ddc1db0f1c15873e2476fbf5ba0352464c8725a Mon Sep 17 00:00:00 2001
From: Michael Haubenwallner <ha...@gentoo.org>
Date: Tue, 8 Jul 2014 17:48:54 +0200
Subject: [PATCH] support PORTAGE_ECLASS_VARIANTS

---
 bin/ebuild.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index be044e0..366cab6 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -246,12 +246,14 @@ inherit() {
 		fi
 
 		for repo_location in "${PORTAGE_ECLASS_LOCATIONS[@]}"; do
-			potential_location="${repo_location}/eclass/${1}.eclass"
+		  for x in ${PORTAGE_ECLASS_VARIANTS:-} ''; do
+			potential_location="${repo_location}/eclass${x:+/}${x}/${1}.eclass"
 			if [[ -f ${potential_location} ]]; then
 				location="${potential_location}"
 				debug-print "  eclass exists: ${location}"
-				break
+				break 2
 			fi
+		  done
 		done
 		debug-print "inherit: $1 -> $location"
 		[[ -z ${location} ]] && die "${1}.eclass could not be found by inherit()"
-- 
1.8.3.2

Reply via email to