/[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.30 Revision 1.31
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.30 2005/07/14 19:33:52 johnm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.31 2005/09/22 14:09:25 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
372 die "No support for external modules in ${KV_FULL} config" 372 die "No support for external modules in ${KV_FULL} config"
373 fi 373 fi
374} 374}
375 375
376check_extra_config() { 376check_extra_config() {
377 local config negate error local_error i n temp_config 377 local config negate error local_error i n
378 local temp_config die reworkmodulenames
378 379
379 # if we haven't determined the version yet, we need too. 380 # if we haven't determined the version yet, we need too.
380 get_version; 381 get_version;
381 382
382 einfo "Checking for suitable kernel configuration options" 383 einfo "Checking for suitable kernel configuration options:"
383 for config in ${CONFIG_CHECK} 384 for config in ${CONFIG_CHECK}
384 do 385 do
385 negate="${config:0:1}" 386 # if we specify any fatal, ensure we honor them
386 if [ "${negate}" == "!" ]; 387 die=1
387 then 388 error=0
389 negate=0
390 reworkmodulenames=0
391
392 if [[ -z ${config//\!*} ]]; then
393 negate=1
388 config="${config:1}" 394 config=${config:1}
395 fi
396 if [[ -z ${config/\@*} ]]; then
397 die=2
398 reworkmodulenames=1
399 config=${config:1}
400 fi
401 if [[ -z ${config/\~*} ]]; then
402 die=0
403 config=${config:1}
404 fi
405
406 if [[ ${negate} == 1 ]]; then
407 linux_chkconfig_present ${config} && error=2
408 elif [[ ${reworkmodulenames} == 1 ]]; then
409 temp_config="${config//*:}"
410 config="${config//:*}"
389 if linux_chkconfig_present ${config} 411 if linux_chkconfig_present ${config}; then
390 then 412 for i in ${MODULE_NAMES}; do
413 n="${i//${temp_config}}"
414 [[ -z ${n//(*} ]] && \
415 MODULE_IGNORE="${MODULE_IGNORE} ${temp_config}"
416 done
417 error=2
418 fi
419 else
420 linux_chkconfig_present ${config} || error=1
421 fi
422
423 if [[ ${die} == 0 ]]; then
424 ebegin "CONFIG_${config}"
425 eend ${error}
426 else
427 if [[ ${error} > 0 ]]; then
391 local_error="${config}_ERROR" 428 local_error="${config}_ERROR"
392 local_error="${!local_error}" 429 local_error="${!local_error}"
393 [ -n "${local_error}" ] && eerror " ${local_error}" || \ 430 if [[ -z "${local_error}" ]]; then
394 eerror " CONFIG_${config}:\tshould not be set in the kernel configuration, but it is." 431 [[ ${error} == 1 ]] \
395 error=1 432 && local_error="is not set when it should be." \
433 || local_error="should not be set. But it is."
434 local_error="CONFIG_${config}:\t ${local_error}"
435 fi
436 eerror " ${local_error}"
396 fi 437 fi
397 elif [ "${negate}" == "@" ];
398 then
399 # we never call this unless we are using MODULE_NAMES
400
401 config="${config:1}"
402 temp_config="${config//*:}"
403 config="${config//:*}"
404 if linux_chkconfig_present ${config}
405 then
406 local_error="${config}_ERROR"
407 local_error="${!local_error}"
408 [ -n "${local_error}" ] && eerror " ${local_error}" || \
409 eerror " CONFIG_${config}:\tshould not be set in the kernel configuration, but it is."
410
411 for i in ${MODULE_NAMES}
412 do
413 n="${i//${temp_config}}"
414 [ -z "${n//(*}" ] && MODULE_IGNORE="${MODULE_IGNORE} ${temp_config}"
415 done
416 error=0
417 fi
418 else
419 if ! linux_chkconfig_present ${config}
420 then
421 # Support the new syntax first.
422 local_error="ERROR_${config}"
423 local_error="${!local_error}"
424
425 # then fall back on the older syntax.
426 if [[ -z ${local_error} ]] ; then
427 local_error="${config}_ERROR"
428 local_error="${!local_error}"
429 fi
430
431 [[ -n ${local_error} ]] && eerror " ${local_error}" || \
432 eerror " CONFIG_${config}:\tshould be set in the kernel configuration, but isn't"
433 error=1
434 fi
435 fi 438 fi
436 done 439 done
437 440
438 if [ "${error}" == 1 ] ; 441 if [[ ${error} > 0 ]]; then
439 then
440 eerror "Please check to make sure these options are set correctly." 442 eerror "Please check to make sure these options are set correctly."
443 eerror "Failure to do so may cause unexpected problems."
444 if [[ ${die} == 1 ]]; then
441 eerror "Once you have satisfied these options, please try merging" 445 eerror "Once you have satisfied these options, please try merging"
442 eerror "this package again." 446 eerror "this package again."
443 die "Incorrect kernel configuration options" 447 die "Incorrect kernel configuration options"
448 fi
444 fi 449 fi
445} 450}
446 451
447check_zlibinflate() { 452check_zlibinflate() {
448 # if we haven't determined the version yet, we need too. 453 # if we haven't determined the version yet, we need too.

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

  ViewVC Help
Powered by ViewVC 1.1.20