Merge remote-tracking branch 'origin/merge-requests/109'

This commit is contained in:
Julian Ospald 2019-07-23 10:46:50 +08:00
commit 1b719ead22
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
2 changed files with 13 additions and 3 deletions

1
.requirements/ghc/darwin Normal file
View File

@ -0,0 +1 @@
(Note: on OS X, in the course of running ghcup you will be given a dialog box to install the command line tools. Accept and the requirements will be installed for you. You will then need to run the command again.)

15
ghcup
View File

@ -1020,6 +1020,7 @@ download_to_stdout() {
unpack() { unpack() {
[ -z "$1" ] && die "Internal error: no argument given to unpack" [ -z "$1" ] && die "Internal error: no argument given to unpack"
mydistro=$(get_distro_alias "$(get_distro_name)")
filename=$1 filename=$1
file_ext=${filename##*.} file_ext=${filename##*.}
@ -1028,8 +1029,13 @@ unpack() {
# capability # capability
case "${file_ext}" in case "${file_ext}" in
xz) xz)
debug_message "xz -cd \"${filename}\" | tar -xf -" if test "${mydistro}" = "darwin"; then
( xz -cd "${filename}" | tar -xf - ; ) || die "unpacking failed!" debug_message "tar -xzf \"${filename}\""
( tar -xzf "${filename}" ) || die "unpacking failed!"
else
debug_message "xz -cd \"${filename}\" | tar -xf -"
( xz -cd "${filename}" | tar -xf - ; ) || die "unpacking failed!"
fi
;; ;;
gz) gz)
debug_message "gzip -cd \"${filename}\" | tar -xf -" debug_message "gzip -cd \"${filename}\" | tar -xf -"
@ -1042,7 +1048,7 @@ unpack() {
die "Unknown file extension: \"${file_ext}\"" die "Unknown file extension: \"${file_ext}\""
esac esac
unset filename file_ext unset mydistro filename file_ext
} }
# @FUNCTION: ask_for_confirmation # @FUNCTION: ask_for_confirmation
@ -1984,6 +1990,9 @@ system_reqs_url() {
"debian"|"ubuntu") "debian"|"ubuntu")
printf "%s/.requirements/ghc/ubuntu" "${BASE_DOWNLOAD_URL}" printf "%s/.requirements/ghc/ubuntu" "${BASE_DOWNLOAD_URL}"
;; ;;
"darwin")
printf "%s/.requirements/ghc/darwin" "${BASE_DOWNLOAD_URL}"
;;
*) *)
printf "%s/.requirements/ghc/default" "${BASE_DOWNLOAD_URL}" printf "%s/.requirements/ghc/default" "${BASE_DOWNLOAD_URL}"
;; ;;