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 <wangjianyu3@xiaomi.com>
This commit is contained in:
wangjianyu3
2025-01-14 17:45:39 +08:00
committed by Xiang Xiao
parent aa24051628
commit b629daf61c
+12 -12
View File
@@ -116,50 +116,50 @@ fi
if [ "X${CONFIGS}" == "Xall" ]; then if [ "X${CONFIGS}" == "Xall" ]; then
echo "Normalizing all boards!" echo "Normalizing all boards!"
CONFIGS=`find boards -name defconfig | cut -d'/' -f4,6` CONFIGS=(`find boards -name defconfig | cut -d'/' -f4,6`)
else else
if [[ "X${CONFIGS}" == "Xarch:"* ]]; then if [[ "X${CONFIGS}" == "Xarch:"* ]]; then
IFS=: read -r atype archname <<< "${CONFIGS}" IFS=: read -r atype archname <<< "${CONFIGS}"
ARCH=$archname ARCH=$archname
echo "Normalizing all boards in arch: ${ARCH} !" 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 else
if [[ "X${CONFIGS}" == "Xchip:"* ]]; then if [[ "X${CONFIGS}" == "Xchip:"* ]]; then
IFS=: read -r atype chipname <<< "${CONFIGS}" IFS=: read -r atype chipname <<< "${CONFIGS}"
CHIP=$chipname CHIP=$chipname
echo "Normalizing all boards in chip: ${CHIP} !" 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 fi
fi fi
for CONFIG in ${CONFIGS}; do for i in ${!CONFIGS[@]}; do
echo " Normalize ${CONFIG}" echo " [$((${i} + 1))/${#CONFIGS[@]}] Normalize ${CONFIGS[$i]}"
# Set up the environment # Set up the environment
CONFIGSUBDIR=`echo ${CONFIG} | cut -s -d':' -f2` CONFIGSUBDIR=`echo ${CONFIGS[$i]} | cut -s -d':' -f2`
if [ -z "${CONFIGSUBDIR}" ]; then if [ -z "${CONFIGSUBDIR}" ]; then
CONFIGSUBDIR=`echo ${CONFIG} | cut -s -d'/' -f2` CONFIGSUBDIR=`echo ${CONFIGS[$i]} | cut -s -d'/' -f2`
if [ -z "${CONFIGSUBDIR}" ]; then if [ -z "${CONFIGSUBDIR}" ]; then
echo "ERROR: Malformed configuration: ${CONFIG}" echo "ERROR: Malformed configuration: ${CONFIGS[$i]}"
echo $USAGE echo $USAGE
echo $ADVICE echo $ADVICE
exit 1 exit 1
else else
BOARDSUBDIR=`echo ${CONFIG} | cut -d'/' -f1` BOARDSUBDIR=`echo ${CONFIGS[$i]} | cut -d'/' -f1`
fi fi
else else
BOARDSUBDIR=`echo ${CONFIG} | cut -d':' -f1` BOARDSUBDIR=`echo ${CONFIGS[$i]} | cut -d':' -f1`
fi fi
BOARDDIR=${CONFIG} BOARDDIR=${CONFIGS[$i]}
if [ ! -d $BOARDDIR ]; then if [ ! -d $BOARDDIR ]; then
BOARDDIR="${CWD}/${BOARDDIR}" BOARDDIR="${CWD}/${BOARDDIR}"
fi fi
if [ -d $BOARDDIR ]; then if [ -d $BOARDDIR ]; then
CONFIGSUBDIR=`basename ${CONFIG}` CONFIGSUBDIR=`basename ${CONFIGS[$i]}`
BOARDDIR=$(dirname `dirname ${BOARDDIR}`) BOARDDIR=$(dirname `dirname ${BOARDDIR}`)
else else
BOARDDIR=boards/*/*/$BOARDSUBDIR BOARDDIR=boards/*/*/$BOARDSUBDIR