Fix var shadowing in toolchain script

pull/365/head
Dmitry Ilyin 2022-08-17 18:22:36 +03:00
parent fd2811f648
commit 29bb017481
1 changed files with 5 additions and 5 deletions

View File

@ -9,7 +9,7 @@ toolchain_by_config() {
BR2_VER=$(grep BR2_DEFAULT_KERNEL_VERSION $CF) BR2_VER=$(grep BR2_DEFAULT_KERNEL_VERSION $CF)
if [ ! -z $BR2_VER ]; then if [ ! -z $BR2_VER ]; then
VENDOR=$(echo $CF | cut -d - -f 4 | cut -d / -f 1 | sed -r 's/\<./\U&/g') VENDOR=$(echo $CF | cut -d - -f 4 | cut -d / -f 1 | sed -r 's/\<./\U&/g')
VER=$(echo $BR2_VER | cut -d \" -f 2 | awk -F . '{printf "%s_%s", $1, $2}') KVER=$(echo $BR2_VER | cut -d \" -f 2 | awk -F . '{printf "%s_%s", $1, $2}')
GCC_VER=$(sed -rn "s/^BR2_GCC_VERSION_([0-9]*)_X=y/\1/p" $CF) GCC_VER=$(sed -rn "s/^BR2_GCC_VERSION_([0-9]*)_X=y/\1/p" $CF)
ARCH=$(sed -rn "s/^BR2_(arm[a-z0-9_]+)=y/\1/p" $CF) ARCH=$(sed -rn "s/^BR2_(arm[a-z0-9_]+)=y/\1/p" $CF)
if [ -z "$ARCH" ]; then if [ -z "$ARCH" ]; then
@ -34,10 +34,10 @@ toolchain_by_config() {
SOC=$(echo $CF | cut -d _ -f 3) SOC=$(echo $CF | cut -d _ -f 3)
case $FMT in case $FMT in
list) list)
echo $ARCH $GCC_VER $LIBC $VER $VENDOR $CF echo $ARCH $GCC_VER $LIBC $KVER $VENDOR $CF
;; ;;
uniq) uniq)
echo $ARCH $GCC_VER $LIBC $VER echo $ARCH $GCC_VER $LIBC $KVER
;; ;;
*) *)
if [ ! -z "$2" ]; then if [ ! -z "$2" ]; then
@ -60,9 +60,9 @@ toolchain_by_config() {
;; ;;
esac esac
HASH=$(echo $VER | sha1sum | cut -c 1-8) HASH=$(echo $VER | sha1sum | cut -c 1-8)
echo ${ARCH}-gcc${GCC_VER}-${LIBC}-${VER}-${HASH} echo ${ARCH}-gcc${GCC_VER}-${LIBC}-${KVER}-${HASH}
else else
echo ${ARCH}-gcc${GCC_VER}-${LIBC}-${VER} echo ${ARCH}-gcc${GCC_VER}-${LIBC}-${KVER}
fi fi
;; ;;
esac esac