提交 4cbe76ff 编写于 作者: wenliang999's avatar wenliang999

Update download_toolchain.sh, wget branch不支持了, 改git clone --depth 1

上级 86bea809
......@@ -65,7 +65,7 @@ function SHELL_FUNCTION_PASER(){
fi
done
}
function SHELL_FUNCTION_KERNAL(){
function SHELL_FUNCTION_KERNAL_WGET(){
#echo "git_repository (git) : ${git_repository_git}"
echo "git_repository (https) : ${git_repository_https}"
......@@ -115,6 +115,54 @@ function SHELL_FUNCTION_KERNAL(){
return
}
function SHELL_FUNCTION_KERNAL_GIT_CLONE(){
#echo "git_repository (git) : ${git_repository_git}"
echo "git_repository (https) : ${git_repository_https}"
git init 1>log.txt 2>&1
git remote add origin ${git_repository_address} 1>log.txt 2>&1
git remote show origin > git_remote.log.txt
cat git_remote.log.txt | grep "gcc" | sed -e 's/^[ ]*//g' | cut -d ' ' -f 1 > git_branch.log.txt
if [ ${SHELL_OPTIONS_LIST} ]; then
echo "[git branch list]"
cat -n git_branch.log.txt
return
fi
for argv in $*; do
cat git_branch.log.txt | grep "${argv} " > git_branch.log.txt.next
if [[ ! -s git_branch.log.txt.next ]] ; then
cat git_branch.log.txt | grep "${argv}" > git_branch.log.txt.next
fi
mv git_branch.log.txt.next git_branch.log.txt
done
git_branch=$(cat git_branch.log.txt | head -n 1)
git_branch=`echo ${git_branch}`
git_branch=${git_branch%% *}
echo "git_branch : ${git_branch}"
echo "git_cmd : git clone ${git_repository_https} --depth 2 -b ${git_branch}"
git clone ${git_repository_https} --quiet --depth 1 -b ${git_branch}
mv ${git_project} toolchain-${git_branch}
git clone ${git_repository_https} --quiet --depth 1 -b ${git_branch_common}
mv ${git_project} toolchain-${git_branch_common}
rm -rf ../${git_branch}
mkdir -p ../${git_branch}
mv toolchain-${git_branch}/* ../${git_branch}/
mv toolchain-${git_branch_common}/* ../${git_branch}/
return
}
SHELL_FUNCTION_PASER $*
if [ ${SHELL_OPTIONS_HELP} ]; then
......@@ -123,7 +171,7 @@ else
TEMP_DIR=TEMP_$(date "+%Y.%m.%d.%H.%M.%S")
mkdir -p ${TEMP_DIR}
cd ${TEMP_DIR}
SHELL_FUNCTION_KERNAL $*
SHELL_FUNCTION_KERNAL_GIT_CLONE $*
cd ..
rm -rf ./${TEMP_DIR}
fi
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册