scripts/showSamples.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed May 23 19:07:54 2007 +0000 (2007-05-23)
changeset 126 cf871e2cccc9
parent 124 851120479fb9
child 168 45811aef4097
permissions -rwxr-xr-x
Correctly handle the log level overide in scripts/saveSample.sh.
Little eye candy in scripts/showSamples.sh.
     1 #!/bin/bash
     2 
     3 # Parses all samples on the command line, and for each of them, prints
     4 # the versions of the main tools
     5 
     6 # GREP_OPTIONS screws things up.
     7 export GREP_OPTIONS=
     8 
     9 # Dump a single sample
    10 dump_single_sample() {
    11     local width="$1"
    12     local sample="$2"
    13     . "${CT_TOP_DIR}/samples/${sample}/crosstool.config"
    14     printf "  %-*s" ${width} "${sample}"
    15     [ -f "${CT_TOP_DIR}/samples/${sample}/broken" ] && printf "  (broken)"
    16     echo
    17     echo "   \   ${CT_KERNEL}-${CT_KERNEL_VERSION} binutils-${CT_BINUTILS_VERSION}"
    18     echo "    \_ ${CT_CC}-${CT_CC_VERSION} ${CT_LIBC}-${CT_LIBC_VERSION}"
    19 }
    20 
    21 # Get largest sample width
    22 width=0
    23 for sample in "${@}"; do
    24     [ ${#sample} -gt ${width} ] && width=${#sample}
    25 done
    26 
    27 for sample in "${@}"; do
    28     ( dump_single_sample ${width} "${sample}" )
    29 done