Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 811726 | Differences between
and this patch

Collapse All | Expand All

(-)a/eclass/linux-info.eclass (-28 / +20 lines)
Lines 629-662 get_running_version() { Link Here
629
		die "${FUNCNAME}() called on non-Linux system, please fix the ebuild"
629
		die "${FUNCNAME}() called on non-Linux system, please fix the ebuild"
630
	fi
630
	fi
631
631
632
	KV_FULL=$(uname -r)
632
	local kv=$(uname -r)
633
633
634
	if [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile && -f ${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then
634
	if [[ -f ${ROOT%/}/lib/modules/${kv}/source/Makefile ]]; then
635
		KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/source)
635
		KERNEL_DIR=$(readlink -f "${ROOT%/}/lib/modules/${kv}/source")
636
		KBUILD_OUTPUT=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/build)
636
		if [[ -f ${ROOT%/}/lib/modules/${kv}/build/Makefile ]]; then
637
		unset KV_FULL
637
			KBUILD_OUTPUT=$(readlink -f "${ROOT%/}/lib/modules/${kv}/build")
638
		get_version
638
		fi
639
		return $?
639
		get_version && return 0
640
	elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile ]]; then
641
		KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/source)
642
		unset KV_FULL
643
		get_version
644
		return $?
645
	elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then
646
		KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/build)
647
		unset KV_FULL
648
		get_version
649
		return $?
650
	else
651
		# This handles a variety of weird kernel versions.  Make sure to update
652
		# tests/linux-info_get_running_version.sh if you want to change this.
653
		local kv_full=${KV_FULL//[-+_]*}
654
		KV_MAJOR=$(ver_cut 1 ${kv_full})
655
		KV_MINOR=$(ver_cut 2 ${kv_full})
656
		KV_PATCH=$(ver_cut 3 ${kv_full})
657
		KV_EXTRA="${KV_FULL#${KV_MAJOR}.${KV_MINOR}${KV_PATCH:+.${KV_PATCH}}}"
658
		: ${KV_PATCH:=0}
659
	fi
640
	fi
641
642
	KV_FULL=$kv
643
644
	# This handles a variety of weird kernel versions.  Make sure to update
645
	# tests/linux-info_get_running_version.sh if you want to change this.
646
	local kv_full=${KV_FULL//[-+_]*}
647
	KV_MAJOR=$(ver_cut 1 ${kv_full})
648
	KV_MINOR=$(ver_cut 2 ${kv_full})
649
	KV_PATCH=$(ver_cut 3 ${kv_full})
650
	KV_EXTRA="${KV_FULL#${KV_MAJOR}.${KV_MINOR}${KV_PATCH:+.${KV_PATCH}}}"
651
	: ${KV_PATCH:=0}
652
660
	return 0
653
	return 0
661
}
654
}
662
655
663
- 

Return to bug 811726