From 7d0ee8af33cded27e928e23f46585b63ac3abf62 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Tue, 14 Jan 2025 17:45:39 +0800 Subject: [PATCH] tools/refresh.sh: Add log for progress Log $ ./tools/refresh.sh --silent --defaults arch:risc-v Normalizing all boards in arch: risc-v ! [1/227] Normalize arty_a7/nsh [2/227] Normalize arty_a7/netnsh [3/227] Normalize arty_a7/knsh # ... ... Signed-off-by: wangjianyu3 --- tools/refresh.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/refresh.sh b/tools/refresh.sh index f3d3c38cce..0f28ad39b7 100755 --- a/tools/refresh.sh +++ b/tools/refresh.sh @@ -116,50 +116,50 @@ fi if [ "X${CONFIGS}" == "Xall" ]; then echo "Normalizing all boards!" - CONFIGS=`find boards -name defconfig | cut -d'/' -f4,6` + CONFIGS=(`find boards -name defconfig | cut -d'/' -f4,6`) else if [[ "X${CONFIGS}" == "Xarch:"* ]]; then IFS=: read -r atype archname <<< "${CONFIGS}" ARCH=$archname echo "Normalizing all boards in arch: ${ARCH} !" - CONFIGS=`find boards/${ARCH} -name defconfig | cut -d'/' -f4,6` + CONFIGS=(`find boards/${ARCH} -name defconfig | cut -d'/' -f4,6`) else if [[ "X${CONFIGS}" == "Xchip:"* ]]; then IFS=: read -r atype chipname <<< "${CONFIGS}" CHIP=$chipname echo "Normalizing all boards in chip: ${CHIP} !" - CONFIGS=`find boards/*/${CHIP} -name defconfig | cut -d'/' -f4,6` + CONFIGS=(`find boards/*/${CHIP} -name defconfig | cut -d'/' -f4,6`) fi fi fi -for CONFIG in ${CONFIGS}; do - echo " Normalize ${CONFIG}" +for i in ${!CONFIGS[@]}; do + echo " [$((${i} + 1))/${#CONFIGS[@]}] Normalize ${CONFIGS[$i]}" # Set up the environment - CONFIGSUBDIR=`echo ${CONFIG} | cut -s -d':' -f2` + CONFIGSUBDIR=`echo ${CONFIGS[$i]} | cut -s -d':' -f2` if [ -z "${CONFIGSUBDIR}" ]; then - CONFIGSUBDIR=`echo ${CONFIG} | cut -s -d'/' -f2` + CONFIGSUBDIR=`echo ${CONFIGS[$i]} | cut -s -d'/' -f2` if [ -z "${CONFIGSUBDIR}" ]; then - echo "ERROR: Malformed configuration: ${CONFIG}" + echo "ERROR: Malformed configuration: ${CONFIGS[$i]}" echo $USAGE echo $ADVICE exit 1 else - BOARDSUBDIR=`echo ${CONFIG} | cut -d'/' -f1` + BOARDSUBDIR=`echo ${CONFIGS[$i]} | cut -d'/' -f1` fi else - BOARDSUBDIR=`echo ${CONFIG} | cut -d':' -f1` + BOARDSUBDIR=`echo ${CONFIGS[$i]} | cut -d':' -f1` fi - BOARDDIR=${CONFIG} + BOARDDIR=${CONFIGS[$i]} if [ ! -d $BOARDDIR ]; then BOARDDIR="${CWD}/${BOARDDIR}" fi if [ -d $BOARDDIR ]; then - CONFIGSUBDIR=`basename ${CONFIG}` + CONFIGSUBDIR=`basename ${CONFIGS[$i]}` BOARDDIR=$(dirname `dirname ${BOARDDIR}`) else BOARDDIR=boards/*/*/$BOARDSUBDIR