| 1 | # Copyright 1999-2013 Gentoo Foundation |
1 | # Copyright 1999-2013 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/linux-info.eclass,v 1.95 2013/01/16 14:29:01 zmedico Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.96 2013/01/24 20:47:23 vapier Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: linux-info.eclass |
5 | # @ECLASS: linux-info.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # kernel-misc@gentoo.org |
7 | # kernel-misc@gentoo.org |
| 8 | # @AUTHOR: |
8 | # @AUTHOR: |
| … | |
… | |
| 584 | KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/build) |
584 | KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/build) |
| 585 | unset KV_FULL |
585 | unset KV_FULL |
| 586 | get_version |
586 | get_version |
| 587 | return $? |
587 | return $? |
| 588 | else |
588 | else |
|
|
589 | # This handles a variety of weird kernel versions. Make sure to update |
|
|
590 | # tests/linux-info:get_running_version.sh if you want to change this. |
|
|
591 | local kv_full=${KV_FULL//[-+_]*} |
| 589 | KV_MAJOR=$(get_version_component_range 1 ${KV_FULL}) |
592 | KV_MAJOR=$(get_version_component_range 1 ${kv_full}) |
| 590 | KV_MINOR=$(get_version_component_range 2 ${KV_FULL}) |
593 | KV_MINOR=$(get_version_component_range 2 ${kv_full}) |
| 591 | KV_PATCH=$(get_version_component_range 3 ${KV_FULL}) |
594 | KV_PATCH=$(get_version_component_range 3 ${kv_full}) |
| 592 | KV_PATCH=${KV_PATCH//-*} |
|
|
| 593 | KV_EXTRA="${KV_FULL#${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}}" |
595 | KV_EXTRA="${KV_FULL#${KV_MAJOR}.${KV_MINOR}${KV_PATCH:+.${KV_PATCH}}}" |
|
|
596 | : ${KV_PATCH:=0} |
| 594 | fi |
597 | fi |
| 595 | return 0 |
598 | return 0 |
| 596 | } |
599 | } |
| 597 | |
600 | |
| 598 | # This next function is named with the eclass prefix to avoid conflicts with |
601 | # This next function is named with the eclass prefix to avoid conflicts with |