/[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.79 Revision 1.80
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.79 2010/01/10 09:01:38 robbat2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.80 2010/01/10 09:25:12 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 :)
364 364
365kernel_is() { 365kernel_is() {
366 # if we haven't determined the version yet, we need to. 366 # if we haven't determined the version yet, we need to.
367 linux-info_get_any_version 367 linux-info_get_any_version
368 368
369 local operator test value x=0 y=0 z=0 369 local operator testagainst value x=0 y=0 z=0
370 370
371 case ${1} in 371 case ${1} in
372 -lt|lt) operator="-lt"; shift;; 372 -lt|lt) operator="-lt"; shift;;
373 -gt|gt) operator="-gt"; shift;; 373 -gt|gt) operator="-gt"; shift;;
374 -le|le) operator="-le"; shift;; 374 -le|le) operator="-le"; shift;;
381 for((y=0; y<$((3 - ${#x})); y++)); do value="${value}0"; done 381 for((y=0; y<$((3 - ${#x})); y++)); do value="${value}0"; done
382 value="${value}${x}" 382 value="${value}${x}"
383 z=$((${z} + 1)) 383 z=$((${z} + 1))
384 384
385 case ${z} in 385 case ${z} in
386 1) for((y=0; y<$((3 - ${#KV_MAJOR})); y++)); do test="${test}0"; done; 386 1) for((y=0; y<$((3 - ${#KV_MAJOR})); y++)); do testagainst="${testagainst}0"; done;
387 test="${test}${KV_MAJOR}";; 387 testagainst="${testagainst}${KV_MAJOR}";;
388 2) for((y=0; y<$((3 - ${#KV_MINOR})); y++)); do test="${test}0"; done; 388 2) for((y=0; y<$((3 - ${#KV_MINOR})); y++)); do testagainst="${testagainst}0"; done;
389 test="${test}${KV_MINOR}";; 389 testagainst="${testagainst}${KV_MINOR}";;
390 3) for((y=0; y<$((3 - ${#KV_PATCH})); y++)); do test="${test}0"; done; 390 3) for((y=0; y<$((3 - ${#KV_PATCH})); y++)); do testagainst="${testagainst}0"; done;
391 test="${test}${KV_PATCH}";; 391 testagainst="${testagainst}${KV_PATCH}";;
392 *) die "Error in kernel-2_kernel_is(): Too many parameters.";; 392 *) die "Error in kernel-2_kernel_is(): Too many parameters.";;
393 esac 393 esac
394 done 394 done
395 395
396 [ ${test} ${operator} ${value} ] && return 0 || return 1 396 [ "${testagainst}" ${operator} "${value}" ] && return 0 || return 1
397} 397}
398 398
399get_localversion() { 399get_localversion() {
400 local lv_list i x 400 local lv_list i x
401 401

Legend:
Removed from v.1.79  
changed lines
  Added in v.1.80

  ViewVC Help
Powered by ViewVC 1.1.20