/[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.29 Revision 1.30
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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.29 2005/07/11 15:08:06 swegener Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.30 2005/07/14 19:33:52 johnm Exp $
4# 4#
5# Description: This eclass is used as a central eclass for accessing kernel 5# Description: This eclass is used as a central eclass for accessing kernel
6# related information for sources already installed. 6# related information for sources already installed.
7# It is vital for linux-mod to function correctly, and is split 7# It is vital for linux-mod to function correctly, and is split
8# out so that any ebuild behaviour "templates" are abstracted out 8# out so that any ebuild behaviour "templates" are abstracted out
190 done 190 done
191 191
192 [ ${test} ${operator} ${value} ] && return 0 || return 1 192 [ ${test} ${operator} ${value} ] && return 0 || return 1
193} 193}
194 194
195get_localversion() {
196 local lv_list i x
197
198 # ignore files with ~ in it.
199 for i in $(ls ${1}/localversion* 2>/dev/null); do
200 [[ -n ${i//*~*} ]] && lv_list="${lv_list} ${i}"
201 done
202
203 for i in ${lv_list}; do
204 x="${x}$(<${i})"
205 done
206 x=${x/ /}
207 echo ${x}
208}
209
195get_version() { 210get_version() {
196 local kbuild_output 211 local kbuild_output
197 212
198 # no need to execute this twice assuming KV_FULL is populated. 213 # no need to execute this twice assuming KV_FULL is populated.
199 # we can force by unsetting KV_FULL 214 # we can force by unsetting KV_FULL
269 if [ -n "${KV_OUT_DIR}" ]; 284 if [ -n "${KV_OUT_DIR}" ];
270 then 285 then
271 qeinfo "Found kernel object directory:" 286 qeinfo "Found kernel object directory:"
272 qeinfo " ${KV_OUT_DIR}" 287 qeinfo " ${KV_OUT_DIR}"
273 288
274 KV_LOCAL="$(cat ${KV_OUT_DIR}/localversion* 2>/dev/null)" 289 KV_LOCAL="$(get_localversion ${KV_OUT_DIR})"
275 fi 290 fi
276 # and if we STILL haven't got it, then we better just set it to KV_DIR 291 # and if we STILL haven't got it, then we better just set it to KV_DIR
277 KV_OUT_DIR="${KV_OUT_DIR:-${KV_DIR}}" 292 KV_OUT_DIR="${KV_OUT_DIR:-${KV_DIR}}"
278 293
279 KV_LOCAL="${KV_LOCAL}$(cat ${KV_DIR}/localversion* 2>/dev/null)" 294 KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_OUT_DIR})"
280 KV_LOCAL="${KV_LOCAL}$(linux_chkconfig_string LOCALVERSION)" 295 KV_LOCAL="${KV_LOCAL}$(linux_chkconfig_string LOCALVERSION)"
281 KV_LOCAL="${KV_LOCAL//\"/}" 296 KV_LOCAL="${KV_LOCAL//\"/}"
282 297
283 # And we should set KV_FULL to the full expanded version 298 # And we should set KV_FULL to the full expanded version
284 KV_FULL="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}${KV_LOCAL}" 299 KV_FULL="${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}${KV_LOCAL}"

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

  ViewVC Help
Powered by ViewVC 1.1.20