/[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.56 Revision 1.57
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.56 2008/10/31 22:01:32 dsd Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.57 2008/12/03 18:11:47 dsd 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 :)
145# @USAGE: variable configfile 145# @USAGE: variable configfile
146# @RETURN: the value of the variable 146# @RETURN: the value of the variable
147# @DESCRIPTION: 147# @DESCRIPTION:
148# It detects the value of the variable defined in the file configfile 148# It detects the value of the variable defined in the file configfile
149getfilevar() { 149getfilevar() {
150local ERROR workingdir basefname basedname myARCH="${ARCH}" 150local ERROR basefname basedname myARCH="${ARCH}"
151 ERROR=0 151 ERROR=0
152 152
153 [ -z "${1}" ] && ERROR=1 153 [ -z "${1}" ] && ERROR=1
154 [ ! -f "${2}" ] && ERROR=1 154 [ ! -f "${2}" ] && ERROR=1
155 155
157 then 157 then
158 echo -e "\n" 158 echo -e "\n"
159 eerror "getfilevar requires 2 variables, with the second a valid file." 159 eerror "getfilevar requires 2 variables, with the second a valid file."
160 eerror " getfilevar <VARIABLE> <CONFIGFILE>" 160 eerror " getfilevar <VARIABLE> <CONFIGFILE>"
161 else 161 else
162 workingdir="${PWD}"
163 basefname="$(basename ${2})" 162 basefname="$(basename ${2})"
164 basedname="$(dirname ${2})" 163 basedname="$(dirname ${2})"
165 unset ARCH 164 unset ARCH
166 165
167 cd "${basedname}"
168 echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \ 166 echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \
169 make M="${S}" ${BUILD_FIXES} -s -f - 2>/dev/null 167 make -C "${basedname}" M="${S}" ${BUILD_FIXES} -s -f - 2>/dev/null
170 cd "${workingdir}"
171 168
172 ARCH=${myARCH} 169 ARCH=${myARCH}
173 fi 170 fi
174} 171}
175 172

Legend:
Removed from v.1.56  
changed lines
  Added in v.1.57

  ViewVC Help
Powered by ViewVC 1.1.20