/[gentoo-x86]/eclass/kernel-2.eclass
Gentoo

Diff of /eclass/kernel-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.202 Revision 1.203
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.202 2007/02/14 16:40:49 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.203 2007/04/25 18:22:37 robbat2 Exp $
4 4
5# Description: kernel.eclass rewrite for a clean base regarding the 2.6 5# Description: kernel.eclass rewrite for a clean base regarding the 2.6
6# series of kernel with back-compatibility for 2.4 6# series of kernel with back-compatibility for 2.4
7# 7#
8# Maintainer: John Mylchreest <johnm@gentoo.org> 8# Maintainer: John Mylchreest <johnm@gentoo.org>
152 fi 152 fi
153 KV_PATCH=${KV_PATCH/[-_]*} 153 KV_PATCH=${KV_PATCH/[-_]*}
154 154
155 KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2" 155 KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2"
156 156
157 debug-print "0.0 CKV: ${CKV}"
158 debug-print "0.0 OKV: ${OKV}"
157 RELEASE=${CKV/${OKV}} 159 RELEASE=${CKV/${OKV}}
160 debug-print "0 RELEASE: ${RELEASE}"
158 RELEASE=${RELEASE/_beta} 161 RELEASE=${RELEASE/_beta}
162 debug-print "1 RELEASE: ${RELEASE}"
159 RELEASE=${RELEASE/_rc/-rc} 163 RELEASE=${RELEASE/_rc/-rc}
164 debug-print "2 RELEASE: ${RELEASE}"
160 RELEASE=${RELEASE/_pre/-pre} 165 RELEASE=${RELEASE/_pre/-pre}
166 debug-print "3 RELEASE: ${RELEASE}"
161 kernel_is ge 2 6 && RELEASE=${RELEASE/-pre/-git} 167 kernel_is ge 2 6 && RELEASE=${RELEASE/-pre/-git}
168 debug-print "4 RELEASE: ${RELEASE}"
162 RELEASETYPE=${RELEASE//[0-9]} 169 RELEASETYPE=${RELEASE//[0-9]}
163 170
164 # Now we know that RELEASE is the -rc/-git 171 # Now we know that RELEASE is the -rc/-git
165 # and RELEASETYPE is the same but with its numerics stripped 172 # and RELEASETYPE is the same but with its numerics stripped
166 # we can work on better sorting EXTRAVERSION. 173 # we can work on better sorting EXTRAVERSION.
823 if [ -z "${PATCH_DEPTH}" ]; then PATCH_DEPTH=0; fi 830 if [ -z "${PATCH_DEPTH}" ]; then PATCH_DEPTH=0; fi
824 831
825 ebegin "Applying ${i/*\//} (-p${PATCH_DEPTH}+)" 832 ebegin "Applying ${i/*\//} (-p${PATCH_DEPTH}+)"
826 while [ ${PATCH_DEPTH} -lt 5 ]; do 833 while [ ${PATCH_DEPTH} -lt 5 ]; do
827 echo "Attempting Dry-run:" >> ${STDERR_T} 834 echo "Attempting Dry-run:" >> ${STDERR_T}
828 echo "cmd: patch -p${PATCH_DEPTH} --no-backup-if-mismatch --dry-run -f < ${i}" >> ${STDERR_T} 835 cmdopts="-d${S} --no-backup-if-mismatch -p${PATCH_DEPTH} -f < ${i}"
836 echo "cmd: patch --dry-run ${cmdopts}" >> ${STDERR_T}
829 echo "=======================================================" >> ${STDERR_T} 837 echo "=======================================================" >> ${STDERR_T}
830 if [ $(patch -p${PATCH_DEPTH} --no-backup-if-mismatch --dry-run -f < ${i} >> ${STDERR_T}) $? -eq 0 ]; then 838 if [ $(eval patch --dry-run ${cmdopts} >> ${STDERR_T}) $? -eq 0 ]; then
831 echo "Attempting patch:" > ${STDERR_T} 839 echo "Attempting patch:" > ${STDERR_T}
832 echo "cmd: patch -p${PATCH_DEPTH} --no-backup-if-mismatch -f < ${i}" >> ${STDERR_T} 840 echo "cmd: patch ${cmdopts}" >> ${STDERR_T}
833 echo "=======================================================" >> ${STDERR_T} 841 echo "=======================================================" >> ${STDERR_T}
834 if [ $(patch -p${PATCH_DEPTH} --no-backup-if-mismatch -f < ${i} >> ${STDERR_T}) "$?" -eq 0 ]; then 842 if [ $(eval patch ${cmdopts} >> ${STDERR_T}) "$?" -eq 0 ]; then
835 eend 0 843 eend 0
836 rm ${STDERR_T} 844 rm ${STDERR_T}
837 break 845 break
838 else 846 else
839 eend 1 847 eend 1
1051 [[ ${ETYPE} == headers ]] && postinst_headers 1059 [[ ${ETYPE} == headers ]] && postinst_headers
1052 [[ ${ETYPE} == sources ]] && postinst_sources 1060 [[ ${ETYPE} == sources ]] && postinst_sources
1053} 1061}
1054 1062
1055kernel-2_pkg_setup() { 1063kernel-2_pkg_setup() {
1064 debug-print-kernel2-variables
1056 if kernel_is 2 4; then 1065 if kernel_is 2 4; then
1057 if [ "$( gcc-major-version )" -eq "4" ] ; then 1066 if [ "$( gcc-major-version )" -eq "4" ] ; then
1058 echo 1067 echo
1059 ewarn "Be warned !! >=sys-devel/gcc-4.0.0 isn't supported with linux-2.4!" 1068 ewarn "Be warned !! >=sys-devel/gcc-4.0.0 isn't supported with linux-2.4!"
1060 ewarn "Either switch to another gcc-version (via gcc-config) or use a" 1069 ewarn "Either switch to another gcc-version (via gcc-config) or use a"

Legend:
Removed from v.1.202  
changed lines
  Added in v.1.203

  ViewVC Help
Powered by ViewVC 1.1.20