From 2850f343b9df7c26a0dcb91f14eb89f637276779 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Tue, 16 Jan 2024 23:56:30 +0800 Subject: [PATCH] Disable cabal XDG by default --- scripts/bootstrap/bootstrap-haskell | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/bootstrap/bootstrap-haskell b/scripts/bootstrap/bootstrap-haskell index 7c2ca66..2ede0ec 100755 --- a/scripts/bootstrap/bootstrap-haskell +++ b/scripts/bootstrap/bootstrap-haskell @@ -12,6 +12,7 @@ # * BOOTSTRAP_HASKELL_VERBOSE - any nonzero value for more verbose installation # * BOOTSTRAP_HASKELL_GHC_VERSION - the ghc version to install # * BOOTSTRAP_HASKELL_CABAL_VERSION - the cabal version to install +# * BOOTSTRAP_HASKELL_CABAL_XDG - don't disable the XDG logic (this doesn't force XDG though, because cabal is confusing) # * BOOTSTRAP_HASKELL_INSTALL_NO_STACK - disable installation of stack # * BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK - disable installation stack ghcup hook # * BOOTSTRAP_HASKELL_INSTALL_HLS - whether to install latest hls @@ -820,6 +821,15 @@ if [ -z "${BOOTSTRAP_HASKELL_MINIMAL}" ] ; then do_cabal_config_init $ask_cabal_config_init_answer + if [ -z "${BOOTSTRAP_HASKELL_CABAL_XDG}" ] ; then + # disable XDG if we can + if [ -e "${XDG_CONFIG_HOME:-"$HOME/.config"}/cabal" ] || [ -n "${CABAL_DIR}" ] || [ -n "${CABAL_CONFIG}" ] ; then + : + else + edo mkdir -p "${HOME}/.cabal" + fi + fi + edo cabal update --ignore-project else # don't install ghc and cabal case "${plat}" in