scripts/showSamples.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jun 15 22:02:45 2008 +0000 (2008-06-15)
changeset 564 30fbb26a83b4
parent 539 c538627f69f1
child 576 c4cf38f1d616
permissions -rwxr-xr-x
Some makeinfo versions are a pain in [somewhere very painful].
Work this around with a wrapper that always succeeds, and leave incomplete files in place.

/trunk/scripts/crosstool.sh | 7 7 0 0 +++++++
1 file changed, 7 insertions(+)
     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 [ "$1" = "-v" ] && opt="$1" && shift
     7 [ "$1" = "-w" ] && opt="$1" && shift
     8 
     9 # GREP_OPTIONS screws things up.
    10 export GREP_OPTIONS=
    11 
    12 # Dump a single sample
    13 dump_single_sample() {
    14     local verbose=0
    15     [ "$1" = "-v" ] && verbose=1 && shift
    16     [ "$1" = "-w" ] && wiki=1 && shift
    17     local width="$1"
    18     local sample="$2"
    19     if [ -f "${CT_TOP_DIR}/samples/${sample}/crosstool.config" ]; then
    20         sample_top="${CT_TOP_DIR}"
    21         sample_type="local"
    22     else
    23         sample_top="${CT_LIB_DIR}"
    24         sample_type="global"
    25     fi
    26     . "${sample_top}/samples/${sample}/crosstool.config"
    27     if [ -z "${wiki}" ]; then
    28         printf "  %-*s  (%s" ${width} "${sample}" "${sample_type}"
    29         [ -f "${sample_top}/samples/${sample}/broken" ] && printf ",broken"
    30         echo ")"
    31         if [ ${verbose} -ne 0 ]; then
    32             echo    "    OS        : ${CT_KERNEL}-${CT_KERNEL_VERSION}"
    33             echo    "    binutils  : binutils-${CT_BINUTILS_VERSION}"
    34             echo -n "    C compiler: ${CT_CC}-${CT_CC_VERSION} (C"
    35             [ "${CT_CC_LANG_CXX}" = "y"     ] && echo -n ",C++"
    36             [ "${CT_CC_LANG_FORTRAN}" = "y" ] && echo -n ",Fortran"
    37             [ "${CT_CC_LANG_JAVA}" = "y"    ] && echo -n ",Java"
    38             [ "${CT_CC_LANG_ADA}" = "y"     ] && echo -n ",ADA"
    39             [ "${CT_CC_LANG_OBJC}" = "y"    ] && echo -n ",Objective-C"
    40             [ "${CT_CC_LANG_OBJCXX}" = "y"  ] && echo -n ",Objective-C++"
    41             [ -n "${CT_CC_LANG_OTHERS}"     ] && echo -n ",$CT_CC_LANG_OTHERS}"
    42             echo    ")"
    43             echo    "    C library : ${CT_LIBC}-${CT_LIBC_VERSION}"
    44             echo -n "    Tools     :"
    45             [ "${CT_LIBELF}"  ] && echo -n " libelf-${CT_LIBELF_VERSION}"
    46             [ "${CT_SSTRIP}"  ] && echo -n " sstrip"
    47             [ "${CT_DMALLOC}" ] && echo -n " dmalloc-${CT_DMALLOC_VERSION}"
    48             [ "${CT_DUMA}"    ] && echo -n " duma-${CT_DUMA_VERSION}"
    49             [ "${CT_GDB}"     ] && echo -n " gdb-${CT_GDB_VERSION}"
    50             [ "${CT_LTRACE}"  ] && echo -n " ltrace-${CT_LTRACE_VERSION}"
    51             [ "${CT_STRACE}"  ] && echo -n " strace-${CT_STRACE_VERSION}"
    52             echo
    53         fi
    54     else
    55         echo -n "| ''${sample}''  "
    56         echo -n "|  ${CT_CC_VERSION}  "
    57         echo -n "|  ''${CT_LIBC}''  "
    58         echo -n "|  ${CT_LIBC_VERSION}  "
    59         echo -n "|  ${CT_BINUTILS_VERSION}  "
    60         echo -n "|  ${CT_KERNEL_VERSION}  "
    61         echo -n "|  ${CT_ARCH_FLOAT_HW:+hard}${CT_ARCH_FLOAT_SW:+soft} float  "
    62         echo -n "|  ${CT_THREADS_NPTL:+NPTL}${CT_THREADS_LINUXTHREADS:+linuxthreads}${CT_THREADS_NONE:+none}  "
    63         echo -n "|  "
    64         if [ -f "${sample_top}/samples/${sample}/reported.by" ]; then
    65             ( . "${sample_top}/samples/${sample}/reported.by"; \
    66               echo -n "|  [[${reporter_url}|${reporter_name}]]  "
    67             )
    68         else
    69             echo -n "|  [[http://ymorin.is-a-geek.org/|YEM]]  "
    70         fi
    71         echo "|"
    72     fi
    73 }
    74 
    75 # Get largest sample width
    76 width=0
    77 for sample in "${@}"; do
    78     [ ${#sample} -gt ${width} ] && width=${#sample}
    79 done
    80 
    81 if [ "${opt}" = -w ]; then
    82     echo "^ $(date +%Y%m%d.%H%M) ||||||||||"
    83     echo "^ Target ^ gcc version ^ libc ^ libc version ^ binutils version ^ kernel headers ^  float support  ^  threading model  ^  Misc  ^  Reported by  ^"
    84 fi
    85 for sample in "${@}"; do
    86     ( dump_single_sample ${opt} ${width} "${sample}" )
    87 done