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

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

  ViewVC Help
Powered by ViewVC 1.1.20