commit 3e92b0b08438d7cf66d325cfc7bbe38bec6b0800
Author: Tom Wijsman <TomWij@live.com>
Date:   Fri Apr 12 15:25:01 2013 +0200

    Added a warning after the variables that modifying other variables in the eclass is not supported, there is a chance that we will not fix resulting bugs. Fixes bug #421721.

diff --git a/kernel-2.eclass b/kernel-2.eclass
index 1e6db22..22be9ed 100644
--- a/kernel-2.eclass
+++ b/kernel-2.eclass
@@ -69,6 +69,10 @@
 # UNIPATCH_STRICTORDER	- if this is set places patches into directories of
 #						  order, so they are applied in the order passed
 
+# Changing any other variable in this eclass is not supported; you can request
+# for additional variables to be added by contacting the current maintainer.
+# If you do change them, there is a chance that we will not fix resulting bugs.
+
 inherit eutils toolchain-funcs versionator multilib
 EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm
 

commit ccf6386791e8420269799c219518f42f01103810
Author: Tom Wijsman <TomWij@live.com>
Date:   Fri Apr 12 16:40:56 2013 +0200

    Make use of readme.gentoo.eclass to make the user aware of the Gentoo Linux Kernel Upgrade Guide only the first time he emerges the package. Fixes bug #457598.

diff --git a/kernel-2.eclass b/kernel-2.eclass
index 22be9ed..dc480fb 100644
--- a/kernel-2.eclass
+++ b/kernel-2.eclass
@@ -73,7 +73,7 @@
 # for additional variables to be added by contacting the current maintainer.
 # If you do change them, there is a chance that we will not fix resulting bugs.
 
-inherit eutils toolchain-funcs versionator multilib
+inherit eutils toolchain-funcs versionator multilib readme.gentoo
 EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm
 
 # Added by Daniel Ostrow <dostrow@gentoo.org>
@@ -100,6 +100,13 @@ RESTRICT="binchecks strip"
 # set LINUX_HOSTCFLAGS if not already set
 : ${LINUX_HOSTCFLAGS:="-Wall -Wstrict-prototypes -Os -fomit-frame-pointer -I${S}/include"}
 
+# Kernel upgrade documentation
+#==============================================================
+DISABLE_AUTOFORMATTING="yes"
+DOC_CONTENTS="
+When you plan to upgrade the kernel, you may be interested in the Gentoo Linux
+Kernel Upgrade Guide: http://www.gentoo.org/doc/en/kernel-upgrade.xml"
+
 # debugging functions
 #==============================================================
 # this function exists only to help debug kernel-2.eclass
@@ -781,12 +788,6 @@ postinst_sources() {
 	# Don't forget to make directory for sysfs
 	[[ ! -d ${ROOT}sys ]] && kernel_is 2 6 && mkdir ${ROOT}sys
 
-	echo
-	elog "If you are upgrading from a previous kernel, you may be interested"
-	elog "in the following document:"
-	elog "  - General upgrade guide: http://www.gentoo.org/doc/en/kernel-upgrade.xml"
-	echo
-
 	# if K_EXTRAEINFO is set then lets display it now
 	if [[ -n ${K_EXTRAEINFO} ]]; then
 		echo ${K_EXTRAEINFO} | fmt |
@@ -1191,10 +1192,12 @@ kernel-2_src_install() {
 	install_universal
 	[[ ${ETYPE} == headers ]] && install_headers
 	[[ ${ETYPE} == sources ]] && install_sources
+	readme.gentoo_create_doc
 }
 
 kernel-2_pkg_postinst() {
 	[[ ${ETYPE} == sources ]] && postinst_sources
+	readme.gentoo_print_elog
 }
 
 kernel-2_pkg_setup() {

commit ce71bc155415849dbee18a142459f8ed6296df22
Author: Tom Wijsman <TomWij@live.com>
Date:   Fri Apr 12 17:06:24 2013 +0200

    Clarify the default DESCRIPTION and make it not use versions, a directory with ebuilds that inherit this eclass may contain multiple versions and we also don't want to give the impression that a new directory needs to made if that's not the case. Fixes bug #445110.

diff --git a/kernel-2.eclass b/kernel-2.eclass
index dc480fb..195fd7f 100644
--- a/kernel-2.eclass
+++ b/kernel-2.eclass
@@ -432,7 +432,7 @@ if [[ ${ETYPE} == sources ]]; then
 	PDEPEND="!build? ( virtual/dev-manager )"
 
 	SLOT="${PVR}"
-	DESCRIPTION="Sources for the ${KV_MAJOR}.${KV_MINOR:-$KV_PATCH} linux kernel"
+	DESCRIPTION="Sources based on the Linux Kernel."
 	IUSE="symlink build"
 
 	# Bug #266157, deblob for libre support

commit b0d6bbe5804383549974592e10833678562ceb83
Author: Tom Wijsman <TomWij@live.com>
Date:   Fri Apr 12 17:52:02 2013 +0200

    Clarified which patch depths are used in the normal output and error output when applying patches. Fixes bug #436402.

diff --git a/kernel-2.eclass b/kernel-2.eclass
index 195fd7f..d00f9e8 100644
--- a/kernel-2.eclass
+++ b/kernel-2.eclass
@@ -990,12 +990,12 @@ unipatch() {
 
 			if [ -z "${PATCH_DEPTH}" ]; then PATCH_DEPTH=0; fi
 
-			ebegin "Applying ${i/*\//} (-p${PATCH_DEPTH}+)"
 			while [ ${PATCH_DEPTH} -lt 5 ]; do
 				echo "Attempting Dry-run:" >> ${STDERR_T}
 				echo "cmd: patch -p${PATCH_DEPTH} --no-backup-if-mismatch --dry-run -f < ${i}" >> ${STDERR_T}
 				echo "=======================================================" >> ${STDERR_T}
 				if [ $(patch -p${PATCH_DEPTH} --no-backup-if-mismatch --dry-run -f < ${i} >> ${STDERR_T}) $? -eq 0 ]; then
+					ebegin "Applying ${i/*\//} (-p${PATCH_DEPTH})"
 					echo "Attempting patch:" > ${STDERR_T}
 					echo "cmd: patch -p${PATCH_DEPTH} --no-backup-if-mismatch -f < ${i}" >> ${STDERR_T}
 					echo "=======================================================" >> ${STDERR_T}
@@ -1008,17 +1008,17 @@ unipatch() {
 						eerror "Failed to apply patch ${i/*\//}"
 						eerror "Please attach ${STDERR_T} to any bug you may post."
 						eshopts_pop
-						die "Failed to apply ${i/*\//}"
+						die "Failed to apply ${i/*\//} on patch depth ${PATCH_DEPTH}."
 					fi
 				else
 					PATCH_DEPTH=$((${PATCH_DEPTH} + 1))
 				fi
 			done
 			if [ ${PATCH_DEPTH} -eq 5 ]; then
-				eend 1
+				eerror "Failed to dry-run patch ${i/*\//}"
 				eerror "Please attach ${STDERR_T} to any bug you may post."
 				eshopts_pop
-				die "Unable to dry-run patch."
+				die "Unable to dry-run patch on any patch depth lower than 5."
 			fi
 		done
 	done

commit bedaf8052261a1889d7125683ee0f1acfc561579
Author: Tom Wijsman <TomWij@live.com>
Date:   Fri Apr 12 18:36:04 2013 +0200

    Made sure .tmp_gas_check is created inside the temp folder, it accidentally created temp.tmp_gas_check instead. Fixes bug #336732.

diff --git a/kernel-2.eclass b/kernel-2.eclass
index d00f9e8..c77e7e3 100644
--- a/kernel-2.eclass
+++ b/kernel-2.eclass
@@ -1157,11 +1157,11 @@ kernel-2_src_unpack() {
 	if [[ -n ${KV_MINOR} &&  ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} < 2.6.27 ]]
 	then
 		sed -i \
-			-e 's|TOUT	:= .tmp_gas_check|TOUT	:= $(T).tmp_gas_check|' \
+			-e "s|TOUT	:= .tmp_gas_check|TOUT	:= \"${T}\"/.tmp_gas_check|" \
 			"${S}"/arch/ppc/Makefile
 	else
 		sed -i \
-			-e 's|TOUT	:= .tmp_gas_check|TOUT	:= $(T).tmp_gas_check|' \
+			-e "s|TOUT	:= .tmp_gas_check|TOUT	:= \"${T}\"/.tmp_gas_check|" \
 			"${S}"/arch/powerpc/Makefile
 	fi
 }

commit 6fc0d0fe5636313555f087105ad6b048f876c6fb
Author: Tom Wijsman <TomWij@live.com>
Date:   Fri Apr 12 20:01:46 2013 +0200

    Make UNIPATCH_DOCS work again, install 0000_README document when using genpatches. Fixes bug #301478.

diff --git a/kernel-2.eclass b/kernel-2.eclass
index c77e7e3..c0dc87b 100644
--- a/kernel-2.eclass
+++ b/kernel-2.eclass
@@ -747,6 +747,10 @@ install_sources() {
 	fi
 
 	mv ${WORKDIR}/linux* "${D}"/usr/src
+
+	if [[ -z ${UNIPATCH_DOCS} ]] ; then
+		dodoc ${UNIPATCH_DOCS}
+	fi
 }
 
 # pkg_preinst functions
@@ -1023,13 +1027,23 @@ unipatch() {
 		done
 	done
 
-	# This is a quick, and kind of nasty hack to deal with UNIPATCH_DOCS which
-	# sit in KPATCH_DIR's. This is handled properly in the unipatch rewrite,
-	# which is why I'm not taking too much time over this.
+	# When genpatches is used, we want to install 0000_README which documents
+	# the patches that were used; such that the user can see them, bug #301478.
+	if [[ ! -z ${K_WANT_GENPATCHES} ]] ; then
+		UNIPATCH_DOCS="${UNIPATCH_DOCS} 0000_README"
+	fi
+
+	# When files listed in UNIPATCH_DOCS are found in KPATCH_DIR's, we copy it
+	# to the temporary directory and remember them in UNIPATCH_DOCS to install
+	# them during the install phase.
 	local tmp
-	for i in ${UNIPATCH_DOCS}; do
-		tmp="${tmp} ${i//*\/}"
-		cp -f ${i} "${T}"/
+	for x in ${KPATCH_DIR}; do
+		for i in ${UNIPATCH_DOCS}; do
+			if [[ -f "${x}/${i}" ]] ; then
+				tmp="${tmp} \"${T}/${i}\""
+				cp -f "${x}/${i}" "${T}"/
+			fi
+		done
 	done
 	UNIPATCH_DOCS="${tmp}"
 
