mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-08 14:16:47 +00:00
增加rust sparse稀疏索引选项 (#826)
This commit is contained in:
parent
bde08cded6
commit
f79998f626
@ -1,8 +1,33 @@
|
||||
# 更换Rust镜像源
|
||||
echo -e "[source.crates-io] \n \
|
||||
echo "正在为rust换源"
|
||||
echo "bash change_rust_src.sh --sparse以使用稀疏索引"
|
||||
sparse="false"
|
||||
while true; do
|
||||
if [ -z "$1" ]; then
|
||||
break;
|
||||
fi
|
||||
case "$1" in
|
||||
"--sparse")
|
||||
echo "使用稀疏索引"
|
||||
sparse=""
|
||||
;;
|
||||
esac
|
||||
shift 1
|
||||
done
|
||||
if [ -z ${sparse} ]; then
|
||||
echo -e "[source.crates-io] \n \
|
||||
registry = \"https://github.com/rust-lang/crates.io-index\" \n \
|
||||
\n \
|
||||
replace-with = 'tuna' \n \
|
||||
[source.tuna] \n \
|
||||
registry = \"sparse+https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/\" \n \
|
||||
" > ~/.cargo/config
|
||||
else
|
||||
echo -e "[source.crates-io] \n \
|
||||
registry = \"https://github.com/rust-lang/crates.io-index\" \n \
|
||||
\n \
|
||||
replace-with = 'tuna' \n \
|
||||
[source.tuna] \n \
|
||||
registry = \"https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git\" \n \
|
||||
" > ~/.cargo/config
|
||||
" > ~/.cargo/config
|
||||
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user