/[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.43 Revision 1.44
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.43 2006/05/07 22:14:25 mrness Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.44 2006/05/11 08:33:06 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
378} 378}
379 379
380check_extra_config() { 380check_extra_config() {
381 local config negate error local_error i n 381 local config negate error local_error i n
382 local temp_config die reworkmodulenames 382 local temp_config die reworkmodulenames
383 local soft_errors_count=0 hard_errors_count=0
384 383
385 # if we haven't determined the version yet, we need too. 384 # if we haven't determined the version yet, we need too.
386 get_version; 385 get_version;
387 386
388 einfo "Checking for suitable kernel configuration options..." 387 einfo "Checking for suitable kernel configuration options:"
389 for config in ${CONFIG_CHECK} 388 for config in ${CONFIG_CHECK}
390 do 389 do
391 # if we specify any fatal, ensure we honor them 390 # if we specify any fatal, ensure we honor them
392 die=1 391 die=1
393 error=0 392 error=0
394 negate=0 393 negate=0
395 reworkmodulenames=0 394 reworkmodulenames=0
396 395
397 if [[ -z ${config/\~*} ]]; then
398 die=0
399 config=${config:1}
400 fi
401 if [[ -z ${config//\!*} ]]; then 396 if [[ -z ${config//\!*} ]]; then
402 negate=1 397 negate=1
403 config=${config:1} 398 config=${config:1}
404 fi 399 fi
405 if [[ -z ${config/\@*} ]]; then 400 if [[ -z ${config/\@*} ]]; then
406 die=2 401 die=2
407 reworkmodulenames=1 402 reworkmodulenames=1
403 config=${config:1}
404 fi
405 if [[ -z ${config/\~*} ]]; then
406 die=0
408 config=${config:1} 407 config=${config:1}
409 fi 408 fi
410 409
411 if [[ ${negate} == 1 ]]; then 410 if [[ ${negate} == 1 ]]; then
412 linux_chkconfig_present ${config} && error=2 411 linux_chkconfig_present ${config} && error=2
423 fi 422 fi
424 else 423 else
425 linux_chkconfig_present ${config} || error=1 424 linux_chkconfig_present ${config} || error=1
426 fi 425 fi
427 426
427 if [[ ${die} == 0 ]]; then
428 ebegin "CONFIG_${config}"
429 eend ${error}
430 else
428 if [[ ${error} > 0 ]]; then 431 if [[ ${error} > 0 ]]; then
429 if [[ ${die} == 0 ]]; then 432 local_error="ERROR_${config}"
430 soft_errors_count=$[soft_errors_count + 1] 433 local_error="${!local_error}"
431 else 434
432 hard_errors_count=$[hard_errors_count + 1] 435 if [[ -z "${local_error}" ]]; then
436 # using old, deprecated format.
437 local_error="${config}_ERROR"
438 local_error="${!local_error}"
439 fi
440
441 if [[ -z "${local_error}" ]]; then
442 [[ ${error} == 1 ]] \
443 && local_error="is not set when it should be." \
444 || local_error="should not be set. But it is."
445 local_error="CONFIG_${config}:\t ${local_error}"
446 fi
447 eerror " ${local_error}"
433 fi 448 fi
434 local_error="ERROR_${config}"
435 local_error="${!local_error}"
436
437 if [[ -z "${local_error}" ]]; then
438 # using old, deprecated format.
439 local_error="${config}_ERROR"
440 local_error="${!local_error}"
441 fi
442
443 if [[ -z "${local_error}" ]]; then
444 [[ ${error} == 1 ]] \
445 && local_error="is not set when it should be." \
446 || local_error="should not be set. But it is."
447 local_error="CONFIG_${config}:\t ${local_error}"
448 fi
449 eerror " ${local_error}"
450 fi 449 fi
451 done 450 done
452 451
453 if [[ $[soft_errors_count + hard_errors_count] > 0 ]]; then 452 if [[ ${error} > 0 ]]; then
454 eerror "Please check to make sure these options are set correctly." 453 eerror "Please check to make sure these options are set correctly."
455 eerror "Failure to do so may cause unexpected problems." 454 eerror "Failure to do so may cause unexpected problems."
456 if [[ ${hard_errors_count} > 0 ]]; then 455 if [[ ${die} == 1 ]]; then
457 eerror "Once you have satisfied these options, please try merging" 456 eerror "Once you have satisfied these options, please try merging"
458 eerror "this package again." 457 eerror "this package again."
459 die "Incorrect kernel configuration options" 458 die "Incorrect kernel configuration options"
460 fi 459 fi
461 else
462 eend 0
463 fi 460 fi
464} 461}
465 462
466check_zlibinflate() { 463check_zlibinflate() {
467 # if we haven't determined the version yet, we need too. 464 # if we haven't determined the version yet, we need too.

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.44

  ViewVC Help
Powered by ViewVC 1.1.20