[Linux] 添加对HEnvBox工具优先级设置,允许将HEnvBox工具放在PATH最后

This commit is contained in:
HEYAHONG 2025-01-13 20:33:15 +08:00
parent daaa51dea9
commit 1b3497e06e
No known key found for this signature in database
GPG Key ID: 2D9DCE4738519ABB
2 changed files with 16 additions and 2 deletions

View File

@ -82,12 +82,12 @@ then
export HENVBOX_LOCAL_BINDIR_PATH_UNIX=${HENVBOX_LOCAL_BINDIR_PATH}
#设置PATH变量
export PATH=${HENVBOX_LOCAL_BINDIR_PATH_UNIX}:$PATH
export PATH=${PATH}:${HENVBOX_LOCAL_BINDIR_PATH_UNIX}
#导入local目录下的其它软件(如ct-ng编译的交叉编译工具链)
for bin in `find ${HENVBOX_LOCAL_ROOT_PATH_UNIX} -mindepth 2 -maxdepth 2 -type d -name bin 2> /dev/null`
do
export PATH=${bin}:$PATH
export PATH=${PATH}:${bin}
done
#导入tools中的配置脚本
@ -95,6 +95,15 @@ then
then
. "${HENVBOX_ROOT_PATH}/tools/${HENVBOX_TYPE}/config.sh"
fi
if [ "${CONFIG_HENVBOX_TOOLS_PATH_PRIORITY_HIGH}" = "y" ]
then
export PATH=${HENVBOX_LOCAL_BINDIR_PATH_UNIX}:${PATH}
for bin in `find ${HENVBOX_LOCAL_ROOT_PATH_UNIX} -mindepth 2 -maxdepth 2 -type d -name bin 2> /dev/null`
do
export PATH=${bin}:$PATH
done
fi
else
echo 无法完成HEnvBox配置!
fi

View File

@ -9,4 +9,9 @@ if HENVBOX_USE_KCONFIG
#导入EnvCheck的Kconfig配置
source "../EnvCheck/Kconfig"
config HENVBOX_TOOLS_PATH_PRIORITY_HIGH
bool "high priority of HEnvBox tools"
default n
endif