scripts: add action to dump current configuration in humane-readable form
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jan 31 15:57:22 2010 +0100 (2010-01-31)
changeset 17889547490131d9
parent 1787 626a0914bfe0
child 1789 dcfe244fc65a
scripts: add action to dump current configuration in humane-readable form
ct-ng.comp
samples/samples.mk
scripts/showSamples.sh
     1.1 --- a/ct-ng.comp	Sun Jan 31 12:47:37 2010 +0100
     1.2 +++ b/ct-ng.comp	Sun Jan 31 15:57:22 2010 +0100
     1.3 @@ -16,7 +16,7 @@
     1.4  
     1.5      actions='help menuconfig oldconfig saveconfig
     1.6               build build. build-all build-all.
     1.7 -             list-samples list-steps show-tuple show-all
     1.8 +             list-samples list-steps show-tuple show-all show-config
     1.9               clean distclean wiki-samples updatetools
    1.10               tarball version'
    1.11  
     2.1 --- a/samples/samples.mk	Sun Jan 31 12:47:37 2010 +0100
     2.2 +++ b/samples/samples.mk	Sun Jan 31 15:57:22 2010 +0100
     2.3 @@ -36,6 +36,11 @@
     2.4  # ----------------------------------------------------------
     2.5  # This part deals with printing samples information
     2.6  
     2.7 +# Print the details of current configuration
     2.8 +PHONY += show-config
     2.9 +show-config: .config
    2.10 +	@$(CT_LIB_DIR)/scripts/showSamples.sh -v current
    2.11 +
    2.12  # Prints the details of a sample
    2.13  PHONY += $(patsubst %,show-%,$(CT_SAMPLES))
    2.14  $(patsubst %,show-%,$(CT_SAMPLES)):
     3.1 --- a/scripts/showSamples.sh	Sun Jan 31 12:47:37 2010 +0100
     3.2 +++ b/scripts/showSamples.sh	Sun Jan 31 15:57:22 2010 +0100
     3.3 @@ -20,14 +20,21 @@
     3.4      [ "$1" = "-w" ] && wiki=1 && shift
     3.5      local width="$1"
     3.6      local sample="$2"
     3.7 -    if [ -f "${CT_TOP_DIR}/samples/${sample}/crosstool.config" ]; then
     3.8 -        sample_top="${CT_TOP_DIR}"
     3.9 -        sample_type="l"
    3.10 -    else
    3.11 -        sample_top="${CT_LIB_DIR}"
    3.12 -        sample_type="g"
    3.13 -    fi
    3.14 -    . "${sample_top}/samples/${sample}/crosstool.config"
    3.15 +    case "${sample}" in
    3.16 +        current)
    3.17 +            sample_type="l"
    3.18 +            . .config
    3.19 +            ;;
    3.20 +        *)  if [ -f "${CT_TOP_DIR}/samples/${sample}/crosstool.config" ]; then
    3.21 +                sample_top="${CT_TOP_DIR}"
    3.22 +                sample_type="l"
    3.23 +            else
    3.24 +                sample_top="${CT_LIB_DIR}"
    3.25 +                sample_type="g"
    3.26 +            fi
    3.27 +            . "${sample_top}/samples/${sample}/crosstool.config"
    3.28 +            ;;
    3.29 +    esac
    3.30      if [ -z "${wiki}" ]; then
    3.31          t_width=13
    3.32          printf "%-*s  [%s" ${width} "${sample}" "${sample_type}"