From: Brian Jackson Date: Sat, 2 Oct 2004 17:47:48 +0000 (+0000) Subject: moving set_arch_ functions to eutils from kernel X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=747c35441f246fd4650dc27929ecf46f84644257;p=gentoo.git moving set_arch_ functions to eutils from kernel --- diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 3a720a55c2a1..ce8857c3ecef 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -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 # @@ -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}" +} diff --git a/eclass/kernel.eclass b/eclass/kernel.eclass index 87034905c302..4f1bc27f718b 100644 --- a/eclass/kernel.eclass +++ b/eclass/kernel.eclass @@ -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