@@ -137,9 +137,6 @@ install_ghcup() {
137137 else
138138 curl --proto ' =https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_MINIMAL=1 sh
139139 source " $( dirname " ${GHCUP_BIN} " ) /env"
140- # make sure we use the vanilla channel for installing binaries
141- # see https://github.com/haskell/ghcup-metadata/pull/166#issuecomment-1893075575
142- ghcup config set url-source https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.8.yaml
143140 ghcup install cabal --set " ${BOOTSTRAP_HASKELL_CABAL_VERSION} "
144141 fi
145142}
@@ -213,26 +210,31 @@ mktempdir() {
213210setup_locale () {
214211 # BSD grep terminates early with -q, consequently locale -a will get a
215212 # SIGPIPE and the pipeline will fail with pipefail.
216- shopt -o -u pipefail
217- if locale -a | grep -q C.UTF-8; then
218- # Debian
219- export LANG=C.UTF-8
220- elif locale -a | grep -q C.utf8; then
221- # Fedora calls it this
222- export LANG=C.utf8
223- elif locale -a | grep -q en_US.UTF-8; then
224- # Centos doesn't have C.UTF-8
225- export LANG=en_US.UTF-8
226- elif locale -a | grep -q en_US.utf8; then
227- # Centos doesn't have C.UTF-8
228- export LANG=en_US.utf8
213+ if command -v locale > /dev/null 2>&1 ; then
214+ shopt -o -u pipefail
215+ if locale -a | grep -q C.UTF-8; then
216+ # Debian
217+ export LANG=C.UTF-8
218+ elif locale -a | grep -q C.utf8; then
219+ # Fedora calls it this
220+ export LANG=C.utf8
221+ elif locale -a | grep -q en_US.UTF-8; then
222+ # Centos doesn't have C.UTF-8
223+ export LANG=en_US.UTF-8
224+ elif locale -a | grep -q en_US.utf8; then
225+ # Centos doesn't have C.UTF-8
226+ export LANG=en_US.utf8
227+ else
228+ error " Failed to find usable locale"
229+ info " Available locales:"
230+ locale -a
231+ fail " No usable locale, aborting..."
232+ fi
233+ info " Using locale $LANG ..."
234+ export LC_ALL=$LANG
235+ shopt -o -s pipefail
229236 else
230- error " Failed to find usable locale"
231- info " Available locales:"
232- locale -a
233- fail " No usable locale, aborting..."
237+ info " No 'locale' binary found, skipping locale setup..."
234238 fi
235- info " Using locale $LANG ..."
236- export LC_ALL=$LANG
237- shopt -o -s pipefail
238239}
240+
0 commit comments