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

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

  ViewVC Help
Powered by ViewVC 1.1.20