/[gentoo-x86]/eclass/linux-info.eclass
Gentoo

Diff of /eclass/linux-info.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.77 Revision 1.78
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 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.77 2010/01/10 08:25:55 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.78 2010/01/10 08:47:01 robbat2 Exp $
4# 4#
5# Original author: John Mylchreest <johnm@gentoo.org> 5# Original author: John Mylchreest <johnm@gentoo.org>
6# Maintainer: kernel-misc@gentoo.org 6# Maintainer: kernel-misc@gentoo.org
7# 7#
8# Please direct your bugs to the current eclass maintainer :) 8# Please direct your bugs to the current eclass maintainer :)
488 # KBUILD_OUTPUT, and we need this for .config and localversions-* 488 # KBUILD_OUTPUT, and we need this for .config and localversions-*
489 # so we better find it eh? 489 # so we better find it eh?
490 # do we pass KBUILD_OUTPUT on the CLI? 490 # do we pass KBUILD_OUTPUT on the CLI?
491 OUTPUT_DIR="${OUTPUT_DIR:-${KBUILD_OUTPUT}}" 491 OUTPUT_DIR="${OUTPUT_DIR:-${KBUILD_OUTPUT}}"
492 492
493 # keep track of it
494 KERNEL_MAKEFILE="${KV_DIR}/Makefile"
495
496 # Check if the Makefile is valid for direct parsing.
497 # Check status results:
498 # - PASS, use 'getfilevar' to extract values
499 # - FAIL, use 'getfilevar_noexec' to extract values
500 # The check may fail if:
501 # - make is not present
502 # - corruption exists in the kernel makefile
503 local a='' b='' mkfunc='getfilevar'
504 a="$(getfilevar VERSION ${KERNEL_MAKEFILE})"
505 b="$(getfilevar_noexec VERSION ${KERNEL_MAKEFILE})"
506 [[ "${a}" != "${b}" ]] && mkfunc='getfilevar_noexec'
507
493 # And if we didn't pass it, we can take a nosey in the Makefile 508 # And if we didn't pass it, we can take a nosey in the Makefile
494 kbuild_output="$(getfilevar_noexec KBUILD_OUTPUT ${KV_DIR}/Makefile)" 509 kbuild_output="$(${mkfunc} KBUILD_OUTPUT ${KERNEL_MAKEFILE})"
495 OUTPUT_DIR="${OUTPUT_DIR:-${kbuild_output}}" 510 OUTPUT_DIR="${OUTPUT_DIR:-${kbuild_output}}"
496 511
497 # And contrary to existing functions I feel we shouldn't trust the 512 # And contrary to existing functions I feel we shouldn't trust the
498 # directory name to find version information as this seems insane. 513 # directory name to find version information as this seems insane.
499 # so we parse ${KV_DIR}/Makefile 514 # so we parse ${KERNEL_MAKEFILE}
500 KV_MAJOR="$(getfilevar_noexec VERSION ${KV_DIR}/Makefile)" 515 KV_MAJOR="$(${mkfunc} VERSION ${KERNEL_MAKEFILE})"
501 KV_MINOR="$(getfilevar_noexec PATCHLEVEL ${KV_DIR}/Makefile)" 516 KV_MINOR="$(${mkfunc} PATCHLEVEL ${KERNEL_MAKEFILE})"
502 KV_PATCH="$(getfilevar_noexec SUBLEVEL ${KV_DIR}/Makefile)" 517 KV_PATCH="$(${mkfunc} SUBLEVEL ${KERNEL_MAKEFILE})"
503 KV_EXTRA="$(getfilevar_noexec EXTRAVERSION ${KV_DIR}/Makefile)" 518 KV_EXTRA="$(${mkfunc} EXTRAVERSION ${KERNEL_MAKEFILE})"
504 519
505 if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ] 520 if [ -z "${KV_MAJOR}" -o -z "${KV_MINOR}" -o -z "${KV_PATCH}" ]
506 then 521 then
507 if [ -z "${get_version_warning_done}" ]; then 522 if [ -z "${get_version_warning_done}" ]; then
508 get_version_warning_done=1 523 get_version_warning_done=1

Legend:
Removed from v.1.77  
changed lines
  Added in v.1.78

  ViewVC Help
Powered by ViewVC 1.1.20