From 3473e8da54dee9fc05178885c311bc2418116143 Mon Sep 17 00:00:00 2001 From: Adithya Kumar Date: Tue, 30 Apr 2024 01:33:58 +0530 Subject: [PATCH] Support FreeBSD --- packcheck.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packcheck.sh b/packcheck.sh index 0cdefc2..28a36f5 100755 --- a/packcheck.sh +++ b/packcheck.sh @@ -139,7 +139,7 @@ win_ungztar() { set_os_specific_vars() { local os=$(uname) case "$os" in - Darwin|Linux) + Darwin|Linux|FreeBSD) OS_HAS_TOOLS=tar OS_UNGZTAR_CMD="run_verbose_errexit tar xmzvf" OS_LOCAL_DIR=.local @@ -160,8 +160,8 @@ set_os_specific_vars() { show_machine_info() { local os=$(uname) case "$os" in - Linux) - echo "OS: Linux" + Linux|FreeBSD) + echo "OS: $os" lscpu | grep "^Archi\|^CPU\|^Bogo\|^Hyper\|^Virtualiz" echo "Memory:" @@ -670,7 +670,7 @@ fetch_stack() { local os=$(uname) case "$os" in Darwin) retry_cmd fetch_stack_osx $1 ;; - Linux) retry_cmd fetch_stack_linux $1 ;; + Linux|FreeBSD) retry_cmd fetch_stack_linux $1 ;; MINGW*) retry_cmd fetch_stack_windows $1 ;; *) die "Unknown OS [$os]" ;; esac @@ -909,7 +909,7 @@ ghcup_install() { # Determine GHCUP_ARCH os=$(uname -s -m) case "$os" in - "Linux x86_64") GHCUP_ARCH="x86_64-linux" ;; + "Linux x86_64"|"FreeBSD x86_64") GHCUP_ARCH="x86_64-linux" ;; "Darwin x86_64") GHCUP_ARCH="x86_64-apple-darwin" ;; "Darwin arm64") GHCUP_ARCH="aarch64-apple-darwin" ;; *) echo "Unknown OS/Arch: $os"; exit 1;; @@ -1670,7 +1670,7 @@ install_hlint() { OS=osx;; MINGW*|MSYS*) OS=windows;; - Linux) + Linux|FreeBSD) OS=linux;; *) die "install_hlint: unknown os";; esac @@ -1798,7 +1798,7 @@ your .hlint.ignore file." install_docspec() { show_step "Installing docspec from $DOCSPEC_URL" case "$(uname)" in - Linux) + Linux|FreeBSD) OS=linux;; *) die "install_docspec: unknown or unsupported os";; esac @@ -1964,7 +1964,7 @@ get_sys_time() { # Do not use floating point values so that we can avoid using bc for # computations. #Linux | MINGW*) date +%s.%N ;; - Linux | MINGW*) date +%s ;; + Linux | FreeBSD | MINGW*) date +%s ;; Darwin) date +%s ;; *) die "Unknown OS [$os]" ;; esac