Admin/Windows/Cygwin/setup_server
author wenzelm
Mon, 24 Oct 2022 20:37:32 +0200
changeset 76371 1ac2416e8432
parent 71385 06bb82e7af2a
child 77052 86ace3c45837
permissions -rwxr-xr-x
tuned signature (again, amending f32ac01aef5e), e.g. relevant for Isabelle/DOF;

#!/usr/bin/env bash

CYGWIN_MAIN="https://cygwin.com"
CYGWIN_MIRROR="https://ftp.eq.uc.pt/software/pc/prog/cygwin"

function fail()
{
  echo "$1" >&2
  exit 2
}

function download()
{
  local URL="$1"
  local DIR="${2:-.}"
  mkdir -p "$DIR" || fail "Cannot create directory: \"$DIR\""
  echo "Downloading $URL ..."
  curl --fail --silent "$URL" > "$DIR"/"$(basename "$URL")" || fail "FAILED"
}

download "$CYGWIN_MAIN/setup-x86_64.exe"
download "$CYGWIN_MIRROR/x86_64/setup.xz" "x86_64"
download "$CYGWIN_MIRROR/x86_64/setup.xz.sig" "x86_64"