author | wenzelm |
Tue, 07 Mar 2023 23:09:30 +0100 | |
changeset 77569 | a8fa53c086a4 |
parent 77052 | 86ace3c45837 |
child 78304 | e4b57eea7f86 |
permissions | -rwxr-xr-x |
68268 | 1 |
#!/usr/bin/env bash |
2 |
||
3 |
CYGWIN_MAIN="https://cygwin.com" |
|
4 |
CYGWIN_MIRROR="https://ftp.eq.uc.pt/software/pc/prog/cygwin" |
|
5 |
||
6 |
function fail() |
|
7 |
{ |
|
8 |
echo "$1" >&2 |
|
9 |
exit 2 |
|
10 |
} |
|
11 |
||
12 |
function download() |
|
13 |
{ |
|
14 |
local URL="$1" |
|
15 |
local DIR="${2:-.}" |
|
16 |
mkdir -p "$DIR" || fail "Cannot create directory: \"$DIR\"" |
|
17 |
echo "Downloading $URL ..." |
|
77052
86ace3c45837
more uniform options for "curl", following lib/Tools/components;
wenzelm
parents:
71385
diff
changeset
|
18 |
curl --fail --silent --location "$URL" > "$DIR"/"$(basename "$URL")" || fail "FAILED" |
68268 | 19 |
} |
20 |
||
21 |
download "$CYGWIN_MAIN/setup-x86_64.exe" |
|
22 |
download "$CYGWIN_MIRROR/x86_64/setup.xz" "x86_64" |
|
23 |
download "$CYGWIN_MIRROR/x86_64/setup.xz.sig" "x86_64" |