changelog shortlog graph tags branches changeset files file revisions raw help

Mercurial > infra / annotate bootstrap.sh

changeset 271: cd797f4eb846
parent: 0e3229b8409f
child: 7046a8e3e517
author: Richard Westhaver <ellis@rwest.io>
date: Sun, 16 Jun 2024 19:15:28 -0400
permissions: -rwxr-xr-x
description: rm infra.asd
239
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
1
 #!/bin/sh
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
2
 set -eu
255
ad70dec68fa1 autogen updates and moved Containerfiles
Richard Westhaver <ellis@rwest.io>
parents: 254
diff changeset
3
 
239
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
4
 main() {
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
5
   . ./check.sh
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
6
   download --check
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
7
   local _arch=$(_read arch | tr -d '"')
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
8
   local _ext=""
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
9
   case "$_arch" in
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
10
     *windows*)
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
11
       _ext=".exe"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
12
       ;;
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
13
   esac
260
c5aa261cb836 bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 258
diff changeset
14
   local _url="https://packy.compiler.company/dist/${_arch}/pack"
239
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
15
   local _stash
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
16
   if ! _stash=".stash"; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
17
     # Because the previous command ran in a subshell, we must manually
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
18
     # propagate exit status.
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
19
     exit 1
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
20
   fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
21
   ensure mkdir -p "${_stash}/src"
256
9d6a767d72f0 add ublksrv and blake3
Richard Westhaver <ellis@rwest.io>
parents: 255
diff changeset
22
   ensure mkdir -p "${_stash}/share/lisp/fasl"
239
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
23
   ensure mkdir -p "${_stash}/bin"
256
9d6a767d72f0 add ublksrv and blake3
Richard Westhaver <ellis@rwest.io>
parents: 255
diff changeset
24
   ensure mkdir -p "${_stash}/lib"
9d6a767d72f0 add ublksrv and blake3
Richard Westhaver <ellis@rwest.io>
parents: 255
diff changeset
25
   ensure mkdir -p "${_stash}/include"
255
ad70dec68fa1 autogen updates and moved Containerfiles
Richard Westhaver <ellis@rwest.io>
parents: 254
diff changeset
26
   cd "${_stash}"
260
c5aa261cb836 bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 258
diff changeset
27
   local _sbcl_pack="sbcl.tar.zst"
266
0e3229b8409f autogen src
Richard Westhaver <ellis@rwest.io>
parents: 265
diff changeset
28
   # local _rocksdb_pack="rocksdb.tar.zst"
260
c5aa261cb836 bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 258
diff changeset
29
   local _core_pack="core.tar.zst"
c5aa261cb836 bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 258
diff changeset
30
   local _core_src_pack="core-source.tar.zst"
256
9d6a767d72f0 add ublksrv and blake3
Richard Westhaver <ellis@rwest.io>
parents: 255
diff changeset
31
   local _sbcl_url="${_url}/${_sbcl_pack}"
266
0e3229b8409f autogen src
Richard Westhaver <ellis@rwest.io>
parents: 265
diff changeset
32
   # local _rocksdb_url="${_url}/${_rocksdb_pack}"
256
9d6a767d72f0 add ublksrv and blake3
Richard Westhaver <ellis@rwest.io>
parents: 255
diff changeset
33
   local _core_url="${_url}/${_core_pack}"
261
e51101c3c83c bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 260
diff changeset
34
   local _core_src_url="${_url}/${_core_src_pack}"
256
9d6a767d72f0 add ublksrv and blake3
Richard Westhaver <ellis@rwest.io>
parents: 255
diff changeset
35
   ensure download "$_sbcl_url" "$_sbcl_pack" "$_arch"
9d6a767d72f0 add ublksrv and blake3
Richard Westhaver <ellis@rwest.io>
parents: 255
diff changeset
36
   unzstd "${_sbcl_pack}"
265
fab40b02d833 less verbose, start lisp from autogen.lisp
Richard Westhaver <ellis@rwest.io>
parents: 264
diff changeset
37
   tar -xf "sbcl.tar"
256
9d6a767d72f0 add ublksrv and blake3
Richard Westhaver <ellis@rwest.io>
parents: 255
diff changeset
38
   cd sbcl && INSTALL_ROOT=$(realpath ..) sh install.sh && cd ..
266
0e3229b8409f autogen src
Richard Westhaver <ellis@rwest.io>
parents: 265
diff changeset
39
   ensure download "$_core_src_url" "$_core_src_pack" "$_arch"
0e3229b8409f autogen src
Richard Westhaver <ellis@rwest.io>
parents: 265
diff changeset
40
   unzstd "${_core_src_pack}"
0e3229b8409f autogen src
Richard Westhaver <ellis@rwest.io>
parents: 265
diff changeset
41
   tar -xvf "core-source.tar"
0e3229b8409f autogen src
Richard Westhaver <ellis@rwest.io>
parents: 265
diff changeset
42
   mv core src/
260
c5aa261cb836 bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 258
diff changeset
43
   # ensure download "$_rocksdb_url" "${_rocksdb_pack}" "$_arch"
c5aa261cb836 bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 258
diff changeset
44
   # unzstd "${_rocksdb_pack}"
c5aa261cb836 bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 258
diff changeset
45
   # tar -xvf "pack/rocksdb.tar"
c5aa261cb836 bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 258
diff changeset
46
   # cp -rf rocksdb/include/* include/
c5aa261cb836 bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 258
diff changeset
47
   # cp -rf rocksdb/*.so lib/
261
e51101c3c83c bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 260
diff changeset
48
   ensure download "$_core_url" "${_core_pack}" "$_arch"
e51101c3c83c bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 260
diff changeset
49
   unzstd "${_core_pack}"
265
fab40b02d833 less verbose, start lisp from autogen.lisp
Richard Westhaver <ellis@rwest.io>
parents: 264
diff changeset
50
   tar -xf "core.tar"
261
e51101c3c83c bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 260
diff changeset
51
   cp -rf core/bin/* bin/
e51101c3c83c bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 260
diff changeset
52
   cp -rf core/share/* share/
260
c5aa261cb836 bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 258
diff changeset
53
   chmod +x bin/*
261
e51101c3c83c bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 260
diff changeset
54
   rm -rf core sbcl
260
c5aa261cb836 bootstrap updates
Richard Westhaver <ellis@rwest.io>
parents: 258
diff changeset
55
   rm -rf *.tar
264
Richard Westhaver <ellis@rwest.io>
parents: 261
diff changeset
56
   say "successfully unpacked core"
Richard Westhaver <ellis@rwest.io>
parents: 261
diff changeset
57
   say "starting lisp..."
271
cd797f4eb846 rm infra.asd
Richard Westhaver <ellis@rwest.io>
parents: 266
diff changeset
58
   cd .. && \
cd797f4eb846 rm infra.asd
Richard Westhaver <ellis@rwest.io>
parents: 266
diff changeset
59
     .stash/bin/sbcl --core .stash/share/lisp/user.core \
cd797f4eb846 rm infra.asd
Richard Westhaver <ellis@rwest.io>
parents: 266
diff changeset
60
                     --load autogen.lisp \
cd797f4eb846 rm infra.asd
Richard Westhaver <ellis@rwest.io>
parents: 266
diff changeset
61
                     --eval "(infra/autogen:autogen)" \
cd797f4eb846 rm infra.asd
Richard Westhaver <ellis@rwest.io>
parents: 266
diff changeset
62
                     --non-interactive
264
Richard Westhaver <ellis@rwest.io>
parents: 261
diff changeset
63
   say "OK"
239
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
64
 }
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
65
 
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
66
 _read() {
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
67
   grep ":$1" $INFRA_HOST_CONFIG | cut -d' ' -f 2-
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
68
 }
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
69
 
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
70
 # Check if curl supports the --retry flag, then pass it to the curl invocation.
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
71
 check_curl_for_retry_support() {
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
72
   local _retry_supported=""
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
73
   # "unspecified" is for arch, allows for possibility old OS using macports, homebrew, etc.
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
74
   if check_help_for "notspecified" "curl" "--retry"; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
75
     _retry_supported="--retry 3"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
76
     if check_help_for "notspecified" "curl" "--continue-at"; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
77
       # "-C -" tells curl to automatically find where to resume the download when retrying.
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
78
       _retry_supported="--retry 3 -C -"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
79
     fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
80
   fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
81
   RETVAL="$_retry_supported"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
82
 }
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
83
 
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
84
 # Return cipher suite string specified by user, otherwise return strong TLS 1.2-1.3 cipher suites
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
85
 # if support by local tools is detected. Detection currently supports these curl backends:
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
86
 # GnuTLS and OpenSSL (possibly also LibreSSL and BoringSSL). Return value can be empty.
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
87
 get_ciphersuites_for_curl() {
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
88
   if [ -n "${TLS_CIPHERSUITES-}" ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
89
     # user specified custom cipher suites, assume they know what they're doing
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
90
     RETVAL="$TLS_CIPHERSUITES"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
91
     return
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
92
   fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
93
   local _openssl_syntax="no"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
94
   local _gnutls_syntax="no"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
95
   local _backend_supported="yes"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
96
   if curl -V | grep -q ' OpenSSL/'; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
97
     _openssl_syntax="yes"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
98
   elif curl -V | grep -iq ' LibreSSL/'; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
99
     _openssl_syntax="yes"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
100
   elif curl -V | grep -iq ' BoringSSL/'; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
101
     _openssl_syntax="yes"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
102
   elif curl -V | grep -iq ' GnuTLS/'; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
103
     _gnutls_syntax="yes"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
104
   else
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
105
     _backend_supported="no"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
106
   fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
107
   local _args_supported="no"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
108
   if [ "$_backend_supported" = "yes" ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
109
     # "unspecified" is for arch, allows for possibility old OS using macports, homebrew, etc.
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
110
     if check_help_for "notspecified" "curl" "--tlsv1.2" "--ciphers" "--proto"; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
111
       _args_supported="yes"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
112
     fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
113
   fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
114
   local _cs=""
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
115
   if [ "$_args_supported" = "yes" ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
116
     if [ "$_openssl_syntax" = "yes" ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
117
       _cs=$(get_strong_ciphersuites_for "openssl")
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
118
     elif [ "$_gnutls_syntax" = "yes" ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
119
       _cs=$(get_strong_ciphersuites_for "gnutls")
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
120
     fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
121
   fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
122
   RETVAL="$_cs"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
123
 }
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
124
 
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
125
 # Return cipher suite string specified by user, otherwise return strong TLS 1.2-1.3 cipher suites
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
126
 # if support by local tools is detected. Detection currently supports these wget backends:
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
127
 # GnuTLS and OpenSSL (possibly also LibreSSL and BoringSSL). Return value can be empty.
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
128
 get_ciphersuites_for_wget() {
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
129
   if [ -n "${TLS_CIPHERSUITES-}" ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
130
     # user specified custom cipher suites, assume they know what they're doing
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
131
     RETVAL="$TLS_CIPHERSUITES"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
132
     return
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
133
   fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
134
   local _cs=""
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
135
   if wget -V | grep -q '\-DHAVE_LIBSSL'; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
136
     # "unspecified" is for arch, allows for possibility old OS using macports, homebrew, etc.
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
137
     if check_help_for "notspecified" "wget" "TLSv1_2" "--ciphers" "--https-only" "--secure-protocol"; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
138
       _cs=$(get_strong_ciphersuites_for "openssl")
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
139
     fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
140
   elif wget -V | grep -q '\-DHAVE_LIBGNUTLS'; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
141
     # "unspecified" is for arch, allows for possibility old OS using macports, homebrew, etc.
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
142
     if check_help_for "notspecified" "wget" "TLSv1_2" "--ciphers" "--https-only" "--secure-protocol"; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
143
       _cs=$(get_strong_ciphersuites_for "gnutls")
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
144
     fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
145
   fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
146
   RETVAL="$_cs"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
147
 }
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
148
 
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
149
 check_help_for() {
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
150
     local _arch
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
151
     local _cmd
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
152
     local _arg
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
153
     _arch="$1"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
154
     shift
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
155
     _cmd="$1"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
156
     shift
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
157
     local _category
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
158
     if "$_cmd" --help | grep -q 'For all options use the manual or "--help all".'; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
159
       _category="all"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
160
     else
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
161
       _category=""
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
162
     fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
163
 
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
164
     case "$_arch" in
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
165
         *darwin*)
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
166
         if check_cmd sw_vers; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
167
             case $(sw_vers -productVersion) in
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
168
                 10.*)
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
169
                     # If we're running on macOS, older than 10.13, then we always
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
170
                     # fail to find these options to force fallback
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
171
                     if [ "$(sw_vers -productVersion | cut -d. -f2)" -lt 13 ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
172
                         # Older than 10.13
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
173
                         echo "Warning: Detected macOS platform older than 10.13"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
174
                         return 1
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
175
                     fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
176
                     ;;
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
177
                 11.*)
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
178
                     # We assume Big Sur will be OK for now
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
179
                     ;;
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
180
                 *)
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
181
                     # Unknown product version, warn and continue
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
182
                     echo "Warning: Detected unknown macOS major version: $(sw_vers -productVersion)"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
183
                     echo "Warning TLS capabilities detection may fail"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
184
                     ;;
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
185
             esac
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
186
         fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
187
         ;;
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
188
     esac
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
189
     for _arg in "$@"; do
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
190
         if ! "$_cmd" --help "$_category" | grep -q -- "$_arg"; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
191
             return 1
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
192
         fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
193
     done
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
194
     true # not strictly needed
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
195
 }
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
196
 
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
197
 # Return strong TLS 1.2-1.3 cipher suites in OpenSSL or GnuTLS syntax. TLS 1.2
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
198
 # excludes non-ECDHE and non-AEAD cipher suites. DHE is excluded due to bad
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
199
 # DH params often found on servers (see RFC 7919). Sequence matches or is
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
200
 # similar to Firefox 68 ESR with weak cipher suites disabled via about:config.
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
201
 # $1 must be openssl or gnutls.
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
202
 get_strong_ciphersuites_for() {
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
203
   if [ "$1" = "openssl" ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
204
     # OpenSSL is forgiving of unknown values, no problems with TLS 1.3 values on versions that don't support it yet.
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
205
     echo "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
206
   elif [ "$1" = "gnutls" ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
207
     # GnuTLS isn't forgiving of unknown values, so this may require a GnuTLS version that supports TLS 1.3 even if wget doesn't.
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
208
     # Begin with SECURE128 (and higher) then remove/add to build cipher suites. Produces same 9 cipher suites as OpenSSL but in slightly different order.
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
209
     echo "SECURE128:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1:-VERS-DTLS-ALL:-CIPHER-ALL:-MAC-ALL:-KX-ALL:+AEAD:+ECDHE-ECDSA:+ECDHE-RSA:+AES-128-GCM:+CHACHA20-POLY1305:+AES-256-GCM"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
210
   fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
211
 }
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
212
 
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
213
 # This wraps curl or wget. Try curl first, if not installed,
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
214
 # use wget instead.
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
215
 download() {
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
216
   local _dld
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
217
   local _ciphersuites
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
218
   local _err
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
219
   local _status
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
220
   local _retry
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
221
   if check_cmd curl; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
222
     _dld=curl
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
223
   elif check_cmd wget; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
224
     _dld=wget
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
225
   else
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
226
     _dld='curl or wget' # to be used in error message of need_cmd
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
227
   fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
228
   if [ "$1" = --check ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
229
     need_cmd "$_dld"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
230
   elif [ "$_dld" = curl ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
231
     check_curl_for_retry_support
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
232
     _retry="$RETVAL"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
233
     get_ciphersuites_for_curl
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
234
     _ciphersuites="$RETVAL"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
235
     if [ -n "$_ciphersuites" ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
236
       _err=$(curl $_retry --proto '=https' --tlsv1.2 --ciphers "$_ciphersuites" --silent --show-error --fail --location "$1" --output "$2" 2>&1)
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
237
       _status=$?
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
238
     else
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
239
       echo "Warning: Not enforcing strong cipher suites for TLS, this is potentially less secure"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
240
       if ! check_help_for "$3" curl --proto --tlsv1.2; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
241
         echo "Warning: Not enforcing TLS v1.2, this is potentially less secure"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
242
         _err=$(curl $_retry --silent --show-error --fail --location "$1" --output "$2" 2>&1)
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
243
         _status=$?
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
244
       else
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
245
         _err=$(curl $_retry --proto '=https' --tlsv1.2 --silent --show-error --fail --location "$1" --output "$2" 2>&1)
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
246
         _status=$?
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
247
       fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
248
     fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
249
     if [ -n "$_err" ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
250
       echo "$_err" >&2
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
251
       if echo "$_err" | grep -q 404$; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
252
         err "installer for platform '$3' not found, this may be unsupported"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
253
       fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
254
     fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
255
     return $_status
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
256
   elif [ "$_dld" = wget ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
257
     if [ "$(wget -V 2>&1|head -2|tail -1|cut -f1 -d" ")" = "BusyBox" ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
258
       echo "Warning: using the BusyBox version of wget.  Not enforcing strong cipher suites for TLS or TLS v1.2, this is potentially less secure"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
259
       _err=$(wget "$1" -O "$2" 2>&1)
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
260
       _status=$?
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
261
     else
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
262
       get_ciphersuites_for_wget
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
263
       _ciphersuites="$RETVAL"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
264
       if [ -n "$_ciphersuites" ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
265
         _err=$(wget --https-only --secure-protocol=TLSv1_2 --ciphers "$_ciphersuites" "$1" -O "$2" 2>&1)
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
266
         _status=$?
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
267
       else
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
268
         echo "Warning: Not enforcing strong cipher suites for TLS, this is potentially less secure"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
269
         if ! check_help_for "$3" wget --https-only --secure-protocol; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
270
           echo "Warning: Not enforcing TLS v1.2, this is potentially less secure"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
271
           _err=$(wget "$1" -O "$2" 2>&1)
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
272
           _status=$?
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
273
         else
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
274
           _err=$(wget --https-only --secure-protocol=TLSv1_2 "$1" -O "$2" 2>&1)
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
275
           _status=$?
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
276
         fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
277
       fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
278
     fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
279
     if [ -n "$_err" ]; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
280
       echo "$_err" >&2
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
281
       if echo "$_err" | grep -q ' 404 Not Found$'; then
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
282
         err "installer for platform '$3' not found, this may be unsupported"
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
283
       fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
284
     fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
285
     return $_status
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
286
   else
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
287
     err "Unknown downloader"   # should not reach here
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
288
   fi
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
289
 }
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
290
 
7c6e3bbfe8cd bootstrap mv
Richard Westhaver <ellis@rwest.io>
parents: 213
diff changeset
291
 main "$@" || exit 1