Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 331467
Collapse All | Expand All

(-)linux-info.eclass.orig (-18 / +24 lines)
Lines 539-563 Link Here
539
	# and if we STILL have not got it, then we better just set it to KV_DIR
539
	# and if we STILL have not got it, then we better just set it to KV_DIR
540
	KV_OUT_DIR="${KV_OUT_DIR:-${KV_DIR}}"
540
	KV_OUT_DIR="${KV_OUT_DIR:-${KV_DIR}}"
541
541
542
	if linux_config_src_exists; then
542
	# Fix for bug # 331467 - blame Guenther Brunthaler <gb_about_gnu@gmx.net> for any problems!
543
		# For things like git that can append extra stuff:
543
	KV_LOCAL="$(
544
		# This script is NOT posix-compliant. Running it with 'sh' when 'sh'
544
		set -e
545
		# is a real POSIX shell causes some breakages (bug #323717).
545
		KERNELVERSION=${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}
546
		if [ -e ${KV_DIR}/scripts/setlocalversion ] ; then
546
		test -n "$KERNELVERSION"
547
			KV_LOCAL="${KV_LOCAL}$(cd ${KV_OUT_DIR} ; bash ${KV_DIR}/scripts/setlocalversion ${KV_DIR})"
547
		KERNELRELEASE=$(cat "${KV_OUT_DIR}"/include/config/kernel.release 2> /dev/null)
548
		else
548
		test -n "$KERNELRELEASE"
549
			# localversion* files
549
		LOCALVERSION=${KERNELRELEASE#"${KERNELVERSION}"}
550
			KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_DIR})"
550
		test x"${KERNELVERSION}${LOCALVERSION}" = x"${KERNELRELEASE}"
551
551
		printf '?%s\n' "${LOCALVERSION}"
552
			# CONFIG_LOCALVERSION + LOCALVERSION
552
	)"
553
			KV_LOCAL="${KV_LOCAL}$(linux_chkconfig_string LOCALVERSION)${LOCALVERSION}"
553
	test x"?${KV_LOCAL#?}" = x"${KV_LOCAL}" || {
554
			KV_LOCAL="${KV_LOCAL//\"/}"
554
		if [ -z "${get_version_warning_done}" ]; then
555
555
			get_version_warning_done=1
556
			# CONFIG_LOCALVERSION_AUTO logic ???
556
			qeerror "Could not detect kernel release name."
557
			qeerror "Please ensure that \"make kernelrelease\", when run from"
558
			qeerror "directory \"${KV_OUT_DIR}\", reports"
559
			qeerror "a valid kernel release name!"
560
			qeerror "If it does not, maybe you forgot to run \"make oldconfig\""
561
			qeerror "or \"make menuconfig\" there before?"
557
		fi
562
		fi
558
	else
563
		return 1
559
		KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_DIR})"
564
	}
560
	fi
565
	KV_LOCAL=${KV_LOCAL#?}
566
	# End of fix for bug # 331467.
561
567
562
	# And we should set KV_FULL to the full expanded version
568
	# And we should set KV_FULL to the full expanded version
563
	KV_FULL="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}${KV_LOCAL}"
569
	KV_FULL="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}${KV_LOCAL}"

Return to bug 331467