From d83e2fb1b66d5cd1062a39e8f66eebe7af11cb92 Mon Sep 17 00:00:00 2001 From: Mike Pilgrem Date: Fri, 19 Jan 2024 00:15:51 +0000 Subject: [PATCH] Support ansi-terminal-1.0.2 --- ChangeLog.md | 4 ++++ package.yaml | 2 +- pantry.cabal | 2 +- src/Pantry/Repo.hs | 12 +++++++++++- stack-ghc-9.6.3.yaml | 7 +------ stack-ghc-9.8.1.yaml | 4 +--- stack.yaml.lock | 17 +++++------------ 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 93ee076c..b22be2bb 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,9 @@ # Changelog for pantry +## v0.9.3.2 + +* Support `ansi-terminal-1.0.2`. + ## v0.9.3.1 * Depend on `aeson-warning-parser-0.1.1`. diff --git a/package.yaml b/package.yaml index aee124e9..622fbbd4 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: pantry -version: 0.9.3.1 +version: 0.9.3.2 synopsis: Content addressable Haskell package management description: Please see the README on GitHub at category: Development diff --git a/pantry.cabal b/pantry.cabal index a7308298..10175a08 100644 --- a/pantry.cabal +++ b/pantry.cabal @@ -5,7 +5,7 @@ cabal-version: 2.0 -- see: https://github.com/sol/hpack name: pantry -version: 0.9.3.1 +version: 0.9.3.2 synopsis: Content addressable Haskell package management description: Please see the README on GitHub at category: Development diff --git a/src/Pantry/Repo.hs b/src/Pantry/Repo.hs index 0485c657..0b248ac7 100644 --- a/src/Pantry/Repo.hs +++ b/src/Pantry/Repo.hs @@ -1,4 +1,5 @@ {-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} @@ -43,7 +44,11 @@ import RIO.Process , withWorkingDir ) import qualified RIO.Text as T +#if MIN_VERSION_ansi_terminal(1, 0, 2) +import System.Console.ANSI ( hNowSupportsANSI ) +#else import System.Console.ANSI ( hSupportsANSIWithoutEmulation ) +#endif import System.IsWindows ( osIsWindows ) data TarType = Gnu | Bsd @@ -311,7 +316,12 @@ withRepo sr@SimpleRepo{..} action = -- that command clears, but does not then restore, the -- ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for native terminals. The -- following hack re-enables the lost ANSI-capability. - when osIsWindows $ void $ liftIO $ hSupportsANSIWithoutEmulation stdout + when osIsWindows $ void $ liftIO $ +#if MIN_VERSION_ansi_terminal(1, 0, 2) + hNowSupportsANSI stdout +#else + hSupportsANSIWithoutEmulation stdout +#endif logInfo $ "Cloning " <> display sRepoCommit <> " from " <> display sRepoUrl runCommand ["clone", repoUrl, dir] fixANSIForWindows diff --git a/stack-ghc-9.6.3.yaml b/stack-ghc-9.6.3.yaml index 8c882999..7804e589 100644 --- a/stack-ghc-9.6.3.yaml +++ b/stack-ghc-9.6.3.yaml @@ -1,10 +1,5 @@ # Snapshot specification for GHC 9.6.3. -resolver: lts-22.4 # GHC 9.6.3 - -packages: -# lts-22.4 provides tar-conduit-0.4.0 -- tar-conduit-0.4.1@sha256:112d28118eb71901ea9e224e1b174c648b378256729669c2739b8b803d25b43a,3126 - +resolver: lts-22.6 # GHC 9.6.3 flags: hackage-security: diff --git a/stack-ghc-9.8.1.yaml b/stack-ghc-9.8.1.yaml index b2a261d2..071f6086 100644 --- a/stack-ghc-9.8.1.yaml +++ b/stack-ghc-9.8.1.yaml @@ -1,10 +1,8 @@ # Snapshot specification for GHC 9.8.1. -resolver: nightly-2024-01-06 # GHC 9.8.1 +resolver: nightly-2024-01-17 # GHC 9.8.1 packages: - hedgehog-1.4@sha256:47633efec27b49fe5a21d51f3b9fce428ca4b945d39eaa163b2b6a1d3e1465be,4724 -# nightly-2024-01-06 provides tar-conduit-0.4.0 -- tar-conduit-0.4.1@sha256:112d28118eb71901ea9e224e1b174c648b378256729669c2739b8b803d25b43a,3126 flags: hackage-security: diff --git a/stack.yaml.lock b/stack.yaml.lock index 7acf3ff3..1b74b0a3 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -3,17 +3,10 @@ # For more information, please see the documentation at: # https://docs.haskellstack.org/en/stable/lock_files -packages: -- completed: - hackage: tar-conduit-0.4.1@sha256:112d28118eb71901ea9e224e1b174c648b378256729669c2739b8b803d25b43a,3126 - pantry-tree: - sha256: ef68ea6504605689648cd26a461e855247ac66518a0caf615af2d97fdfe9ceef - size: 828 - original: - hackage: tar-conduit-0.4.1@sha256:112d28118eb71901ea9e224e1b174c648b378256729669c2739b8b803d25b43a,3126 +packages: [] snapshots: - completed: - sha256: 8b211c5a6aad3787e023dfddaf7de7868968e4f240ecedf14ad1c5b2199046ca - size: 714097 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/4.yaml - original: lts-22.4 + sha256: 1b4c2669e26fa828451830ed4725e4d406acc25a1fa24fcc039465dd13d7a575 + size: 714100 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/6.yaml + original: lts-22.6