/[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.237 Revision 1.238
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 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.237 2010/07/19 20:19:18 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.238 2010/07/30 00:44:59 mpagano 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# Original author: John Mylchreest <johnm@gentoo.org> 8# Original author: John Mylchreest <johnm@gentoo.org>
777 777
778# unipatch 778# unipatch
779#============================================================== 779#==============================================================
780unipatch() { 780unipatch() {
781 local i x y z extention PIPE_CMD UNIPATCH_DROP KPATCH_DIR PATCH_DEPTH ELINE 781 local i x y z extention PIPE_CMD UNIPATCH_DROP KPATCH_DIR PATCH_DEPTH ELINE
782 local STRICT_COUNT PATCH_LEVEL myLC_ALL myLANG extglob_bak 782 local STRICT_COUNT PATCH_LEVEL myLC_ALL myLANG
783 783
784 # set to a standard locale to ensure sorts are ordered properly. 784 # set to a standard locale to ensure sorts are ordered properly.
785 myLC_ALL="${LC_ALL}" 785 myLC_ALL="${LC_ALL}"
786 myLANG="${LANG}" 786 myLANG="${LANG}"
787 LC_ALL="C" 787 LC_ALL="C"
789 789
790 [ -z "${KPATCH_DIR}" ] && KPATCH_DIR="${WORKDIR}/patches/" 790 [ -z "${KPATCH_DIR}" ] && KPATCH_DIR="${WORKDIR}/patches/"
791 [ ! -d ${KPATCH_DIR} ] && mkdir -p ${KPATCH_DIR} 791 [ ! -d ${KPATCH_DIR} ] && mkdir -p ${KPATCH_DIR}
792 792
793 # We're gonna need it when doing patches with a predefined patchlevel 793 # We're gonna need it when doing patches with a predefined patchlevel
794 extglob_bak=$(shopt -p extglob)
795 shopt -s extglob 794 eshopts_push -s extglob
796 795
797 # This function will unpack all passed tarballs, add any passed patches, and remove any passed patchnumbers 796 # This function will unpack all passed tarballs, add any passed patches, and remove any passed patchnumbers
798 # usage can be either via an env var or by params 797 # usage can be either via an env var or by params
799 # although due to the nature we pass this within this eclass 798 # although due to the nature we pass this within this eclass
800 # it shall be by param only. 799 # it shall be by param only.
924 break 923 break
925 else 924 else
926 eend 1 925 eend 1
927 eerror "Failed to apply patch ${i/*\//}" 926 eerror "Failed to apply patch ${i/*\//}"
928 eerror "Please attach ${STDERR_T} to any bug you may post." 927 eerror "Please attach ${STDERR_T} to any bug you may post."
928 eshopts_pop
929 die "Failed to apply ${i/*\//}" 929 die "Failed to apply ${i/*\//}"
930 fi 930 fi
931 else 931 else
932 PATCH_DEPTH=$((${PATCH_DEPTH} + 1)) 932 PATCH_DEPTH=$((${PATCH_DEPTH} + 1))
933 fi 933 fi
934 done 934 done
935 if [ ${PATCH_DEPTH} -eq 5 ]; then 935 if [ ${PATCH_DEPTH} -eq 5 ]; then
936 eend 1 936 eend 1
937 eerror "Please attach ${STDERR_T} to any bug you may post." 937 eerror "Please attach ${STDERR_T} to any bug you may post."
938 eshopts_pop
938 die "Unable to dry-run patch." 939 die "Unable to dry-run patch."
939 fi 940 fi
940 done 941 done
941 done 942 done
942 943
953 # clean up KPATCH_DIR's - fixes bug #53610 954 # clean up KPATCH_DIR's - fixes bug #53610
954 for x in ${KPATCH_DIR}; do rm -Rf ${x}; done 955 for x in ${KPATCH_DIR}; do rm -Rf ${x}; done
955 956
956 LC_ALL="${myLC_ALL}" 957 LC_ALL="${myLC_ALL}"
957 LANG="${myLANG}" 958 LANG="${myLANG}"
958 eval ${extglob_bak} 959 eshopts_pop
959} 960}
960 961
961# getfilevar accepts 2 vars as follows: 962# getfilevar accepts 2 vars as follows:
962# getfilevar <VARIABLE> <CONFIGFILE> 963# getfilevar <VARIABLE> <CONFIGFILE>
963# pulled from linux-info 964# pulled from linux-info

Legend:
Removed from v.1.237  
changed lines
  Added in v.1.238

  ViewVC Help
Powered by ViewVC 1.1.20