From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-888973-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 576521382D5
	for <garchives@archives.gentoo.org>; Mon, 27 Jun 2016 05:58:31 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id C5D64141E9;
	Mon, 27 Jun 2016 05:58:30 +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 277BE141E9
	for <gentoo-commits@lists.gentoo.org>; Mon, 27 Jun 2016 05:58:29 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(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 D0EA0340C30
	for <gentoo-commits@lists.gentoo.org>; Mon, 27 Jun 2016 05:58:28 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id CCADC23F1
	for <gentoo-commits@lists.gentoo.org>; Mon, 27 Jun 2016 05:58:23 +0000 (UTC)
From: "Michał Górny" <mgorny@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, "Michał Górny" <mgorny@gentoo.org>
Message-ID: <1467007094.81c226e451be564a545696f93fc5880ebc160812.mgorny@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/tests/, eclass/
X-VCS-Repository: repo/gentoo
X-VCS-Files: eclass/tests/toolchain-funcs.sh eclass/toolchain-funcs.eclass
X-VCS-Directories: eclass/ eclass/tests/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: 81c226e451be564a545696f93fc5880ebc160812
X-VCS-Branch: master
Date: Mon, 27 Jun 2016 05:58:23 +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: a837e310-fcc8-439a-bce3-db3394f299ab
X-Archives-Hash: 35f6974b3e8b35ee4ba6213fa61ba425

commit:     81c226e451be564a545696f93fc5880ebc160812
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 27 05:52:14 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jun 27 05:58:14 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=81c226e4

toolchain-funcs.eclass: tc-ninja_magic_to_arch, remove old KV support

Remove the support for old kernel versions that are no longer used
in Gentoo, and rely on KV_to_int() function. This functions is provided
by Portage but not listed in PMS. Furthermore, for a long time Portage
replaced it with 'return 1' in global scope, so they did not really work
as expected anyway.

 eclass/tests/toolchain-funcs.sh |  7 -------
 eclass/toolchain-funcs.eclass   | 16 +++-------------
 2 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh
index e6a1538..bfbe26f 100755
--- a/eclass/tests/toolchain-funcs.sh
+++ b/eclass/tests/toolchain-funcs.sh
@@ -25,13 +25,6 @@ test-tc-arch-kernel() {
 	done
 	return ${ret}
 }
-tbegin "tc-arch-kernel() (KV=2.6.0)"
-test-tc-arch-kernel 2.6.0 \
-	alpha arm{,eb}:arm avr32 bfin:blackfin cris hppa:parisc \
-	i{3..6}86:i386 ia64 m68k mips{,eb}:mips nios2 powerpc:ppc powerpc64:ppc64 \
-	s390{,x}:s390 sh{1..4}{,eb}:sh sparc{,64} vax x86_64 \
-	i{3..6}86-gentoo-freebsd:i386
-tend $?
 tbegin "tc-arch-kernel() (KV=2.6.30)"
 test-tc-arch-kernel 2.6.30 \
 	i{3..6}86:x86 x86_64:x86 \

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index d3abfb5..2652e0e 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -460,10 +460,6 @@ ninj() { [[ ${type} == "kern" ]] && echo $1 || echo $2 ; }
 	local host=$2
 	[[ -z ${host} ]] && host=${CTARGET:-${CHOST}}
 
-	local KV=${KV:-${KV_FULL}}
-	[[ ${type} == "kern" ]] && [[ -z ${KV} ]] && \
-	ewarn "QA: Kernel version could not be determined, please inherit kernel-2 or linux-info"
-
 	case ${host} in
 		aarch64*)	echo arm64;;
 		alpha*)		echo alpha;;
@@ -479,7 +475,7 @@ ninj() { [[ ${type} == "kern" ]] && echo $1 || echo $2 ; }
 			# Starting with linux-2.6.24, the 'x86_64' and 'i386'
 			# trees have been unified into 'x86'.
 			# FreeBSD still uses i386
-			if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -lt $(KV_to_int 2.6.24) || ${host} == *freebsd* ]] ; then
+			if [[ ${type} == "kern" && ${host} == *freebsd* ]] ; then
 				echo i386
 			else
 				echo x86
@@ -497,14 +493,8 @@ ninj() { [[ ${type} == "kern" ]] && echo $1 || echo $2 ; }
 			# Starting with linux-2.6.15, the 'ppc' and 'ppc64' trees
 			# have been unified into simply 'powerpc', but until 2.6.16,
 			# ppc32 is still using ARCH="ppc" as default
-			if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -ge $(KV_to_int 2.6.16) ]] ; then
+			if [[ ${type} == "kern" ]] ; then
 				echo powerpc
-			elif [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -eq $(KV_to_int 2.6.15) ]] ; then
-				if [[ ${host} == powerpc64* ]] || [[ ${PROFILE_ARCH} == "ppc64" ]] ; then
-					echo powerpc
-				else
-					echo ppc
-				fi
 			elif [[ ${host} == powerpc64* ]] ; then
 				echo ppc64
 			elif [[ ${PROFILE_ARCH} == "ppc64" ]] ; then
@@ -529,7 +519,7 @@ ninj() { [[ ${type} == "kern" ]] && echo $1 || echo $2 ; }
 		x86_64*)
 			# Starting with linux-2.6.24, the 'x86_64' and 'i386'
 			# trees have been unified into 'x86'.
-			if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -ge $(KV_to_int 2.6.24) ]] ; then
+			if [[ ${type} == "kern" ]] ; then
 				echo x86
 			else
 				ninj x86_64 amd64