-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathdl-checksum.sh
executable file
·48 lines (41 loc) · 1.01 KB
/
dl-checksum.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env sh
set -e
DIR=~/Downloads
MIRROR=https://repo.anaconda.com/miniconda
dl()
{
local ver=$1
local python_ver=$2
local os=$3
local arch=$4
local dotexe=${5:-sh}
local platform="${os}-${arch}"
local file="Miniconda3-py${python_ver}_${ver}-${platform}.${dotexe}"
local url=$MIRROR/$file
local lfile=$DIR/$file
if [ ! -e $lfile ];
then
curl -sSLf -o $lfile $url
fi
printf " # %s\n" $url
printf " %s: sha256:%s\n" $platform $(sha256sum $lfile | awk '{print $1}')
}
dlver_help () {
local ver=$1
local python_ver=$2
printf " '%s':\n" $python_ver
dl $ver $python_ver Linux aarch64
dl $ver $python_ver Linux s390x
dl $ver $python_ver Linux x86_64
dl $ver $python_ver MacOSX x86_64
dl $ver $python_ver MacOSX arm64
dl $ver $python_ver Windows x86_64 exe
}
dlver () {
local ver=$1
printf " '%s':\n" $ver
dlver_help $ver 310
dlver_help $ver 311
dlver_help $ver 312
}
dlver ${1:-24.11.1-0}