moving set_arch_ functions to eutils from kernel
authorBrian Jackson <iggy@gentoo.org>
Sat, 2 Oct 2004 17:47:48 +0000 (17:47 +0000)
committerBrian Jackson <iggy@gentoo.org>
Sat, 2 Oct 2004 17:47:48 +0000 (17:47 +0000)
eclass/eutils.eclass
eclass/kernel.eclass

index 3a720a55c2a15f210f787f4e9aee0e26fa4ba157..ce8857c3eceff9478ccf1160d8268ea3a8845a19 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.109 2004/10/02 01:42:32 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.110 2004/10/02 17:47:48 iggy Exp $
 #
 # Author: Martin Schlemmer <azarah@gentoo.org>
 #
@@ -1438,3 +1438,26 @@ strip-linguas() {
                export LINGUAS="${newls}"
        fi
 }
+
+# moved from kernel.eclass since they are generally useful outside of
+# kernel.eclass -iggy (20041002)
+
+# the following functions are useful in kernel module ebuilds, etc.
+# for an example see ivtv or drbd ebuilds
+
+# set's ARCH to match what the kernel expects
+set_arch_to_kernel() {
+       export EUTILS_ECLASS_PORTAGE_ARCH="${ARCH}"
+       case ${ARCH} in
+               x86)    export ARCH="i386";;
+               amd64)  export ARCH="x86_64";;
+               hppa)   export ARCH="parisc";;
+               mips)   export ARCH="mips";;
+               *)      export ARCH="${ARCH}";;
+       esac
+}
+
+# set's ARCH back to what portage expects
+set_arch_to_portage() {
+       export ARCH="${EUTILS_ECLASS_PORTAGE_ARCH}"
+}
index 87034905c302b88c64b65926834791a4889bea5a..4f1bc27f718b451c9e9531e0447a3fe516c1ef6c 100644 (file)
@@ -1,11 +1,14 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kernel.eclass,v 1.50 2004/08/30 21:38:28 kumba Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/kernel.eclass,v 1.51 2004/10/02 17:47:48 iggy Exp $
 #
 # This eclass contains the common functions to be used by all lostlogic
 # based kernel ebuilds
 # with error handling contributions by gerk, and small fixes by zwelch
 # small naming fix by kain
+# moved set_arch_to_ functions to eutils -iggy (20041002)
+
+inherit eutils
 
 ECLASS=kernel
 EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst
@@ -69,20 +72,6 @@ kernel_exclude() {
        done
 }
 
-set_arch_to_kernel() {
-       export KERNEL_ECLASS_PORTAGE_ARCH="${ARCH}"
-       case ${ARCH} in
-               x86)    export ARCH="i386";;
-               amd64)  export ARCH="x86_64";;
-               hppa)   export ARCH="parisc";;
-               mips)   export ARCH="mips";;
-               *)              export ARCH="${ARCH}";;
-       esac
-}
-set_arch_to_portage() {
-       export ARCH="${KERNEL_ECLASS_PORTAGE_ARCH}"
-}
-
 kernel_universal_unpack() {
        find . -iname "*~" -exec rm {} \; 2> /dev/null