From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-878714-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 97367138206
	for <garchives@archives.gentoo.org>; Wed, 27 Apr 2016 17:53:25 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id DCFDE21C101;
	Wed, 27 Apr 2016 17:53:23 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 82FED21C101
	for <gentoo-commits@lists.gentoo.org>; Wed, 27 Apr 2016 17:53:23 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 6F8D9340A9C
	for <gentoo-commits@lists.gentoo.org>; Wed, 27 Apr 2016 17:53:22 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 6D41E188
	for <gentoo-commits@lists.gentoo.org>; Wed, 27 Apr 2016 17:53:20 +0000 (UTC)
From: "Mike Gilbert" <floppym@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Mike Gilbert" <floppym@gentoo.org>
Message-ID: <1461779597.e1374135af76bf31a01ff4ecb6696d8bbe041f31.floppym@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-boot/grub/grub-2.02_beta3-r1.ebuild sys-boot/grub/grub-9999-r1.ebuild
X-VCS-Directories: sys-boot/grub/
X-VCS-Committer: floppym
X-VCS-Committer-Name: Mike Gilbert
X-VCS-Revision: e1374135af76bf31a01ff4ecb6696d8bbe041f31
X-VCS-Branch: master
Date: Wed, 27 Apr 2016 17:53:20 +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
X-Archives-Salt: 2e836c2c-c11a-411a-9884-321b551b1528
X-Archives-Hash: 980673279dd94b2deb015686d47524e5

commit:     e1374135af76bf31a01ff4ecb6696d8bbe041f31
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 27 17:53:01 2016 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Apr 27 17:53:17 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1374135

sys-boot/grub: populate MULTIBUILD_VARIANTS in a more PMS-defined way

Package-Manager: portage-2.2.28_p79

 sys-boot/grub/grub-2.02_beta3-r1.ebuild | 15 ++++++++++++++-
 sys-boot/grub/grub-9999-r1.ebuild       | 15 ++++++++++++++-
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/sys-boot/grub/grub-2.02_beta3-r1.ebuild b/sys-boot/grub/grub-2.02_beta3-r1.ebuild
index 99531f1..ab05794 100644
--- a/sys-boot/grub/grub-2.02_beta3-r1.ebuild
+++ b/sys-boot/grub/grub-2.02_beta3-r1.ebuild
@@ -215,6 +215,19 @@ grub_configure() {
 	ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
 }
 
+grub_get_platforms() {
+	MULTIBUILD_VARIANTS=()
+	local platform
+	for platform in "${GRUB_ALL_PLATFORMS[@]}"; do
+		if use "grub_platforms_${platform}"; then
+			MULTIBUILD_VARIANTS+=( "${platform}" )
+		fi
+	done
+	if (( ${#MULTIBUILD_VARIANTS[@]} == 0 )); then
+		MULTIBUILD_VARIANTS=( guessed )
+	fi
+}
+
 src_configure() {
 	# Bug 508758.
 	replace-flags -O3 -O2
@@ -236,7 +249,7 @@ src_configure() {
 	tc-export BUILD_CC # Bug 485592
 
 	# Portage will take care of cleaning up GRUB_PLATFORMS
-	MULTIBUILD_VARIANTS=( ${GRUB_PLATFORMS:-guessed} )
+	grub_get_platforms
 	grub_do grub_configure
 }
 

diff --git a/sys-boot/grub/grub-9999-r1.ebuild b/sys-boot/grub/grub-9999-r1.ebuild
index 350857b..c880d12 100644
--- a/sys-boot/grub/grub-9999-r1.ebuild
+++ b/sys-boot/grub/grub-9999-r1.ebuild
@@ -217,6 +217,19 @@ grub_configure() {
 	ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
 }
 
+grub_get_platforms() {
+	MULTIBUILD_VARIANTS=()
+	local platform
+	for platform in "${GRUB_ALL_PLATFORMS[@]}"; do
+		if use "grub_platforms_${platform}"; then
+			MULTIBUILD_VARIANTS+=( "${platform}" )
+		fi
+	done
+	if (( ${#MULTIBUILD_VARIANTS[@]} == 0 )); then
+		MULTIBUILD_VARIANTS=( guessed )
+	fi
+}
+
 src_configure() {
 	# Bug 508758.
 	replace-flags -O3 -O2
@@ -238,7 +251,7 @@ src_configure() {
 	tc-export BUILD_CC # Bug 485592
 
 	# Portage will take care of cleaning up GRUB_PLATFORMS
-	MULTIBUILD_VARIANTS=( ${GRUB_PLATFORMS:-guessed} )
+	grub_get_platforms
 	grub_do grub_configure
 }