toolchain-funcs.eclass: tc-ninja_magic_to_arch, remove old KV support
authorMichał Górny <mgorny@gentoo.org>
Mon, 27 Jun 2016 05:52:14 +0000 (07:52 +0200)
committerMichał Górny <mgorny@gentoo.org>
Mon, 27 Jun 2016 05:58:14 +0000 (07:58 +0200)
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
eclass/toolchain-funcs.eclass

index e6a15389c91338963ff0e353b147fa4d348508dd..bfbe26f25c339bef56b416520d0fa1421903e9ee 100755 (executable)
@@ -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 \
index d3abfb5289368c29b0593a0276a1f9812b6247dc..2652e0eef9204c9f7d2b0fba28fc53de1f19d1d4 100644 (file)
@@ -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