From 16a9336d31122ad78be982e3fef58693259ec6e1 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 25 Apr 2021 17:59:15 +0200 Subject: [PATCH] Fix missing pretty instance --- lib/GHCup/Errors.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/GHCup/Errors.hs b/lib/GHCup/Errors.hs index 4db0c1e..f86d690 100644 --- a/lib/GHCup/Errors.hs +++ b/lib/GHCup/Errors.hs @@ -24,6 +24,8 @@ import GHCup.Utils.Prelude #if !defined(TAR) import Codec.Archive +#else +import qualified Codec.Archive.Tar as Tar #endif import Control.Exception.Safe import Data.ByteString ( ByteString ) @@ -339,4 +341,14 @@ instance Pretty ArchiveResult where pPrint ArchiveRetry = text "Archive result: retry" pPrint ArchiveOk = text "Archive result: Ok" pPrint ArchiveEOF = text "Archive result: EOF" +#else +instance Pretty Tar.FormatError where + pPrint Tar.TruncatedArchive = text "Truncated archive" + pPrint Tar.ShortTrailer = text "Short trailer" + pPrint Tar.BadTrailer = text "Bad trailer" + pPrint Tar.TrailingJunk = text "Trailing junk" + pPrint Tar.ChecksumIncorrect = text "Checksum incorrect" + pPrint Tar.NotTarFormat = text "Not a tar format" + pPrint Tar.UnrecognisedTarFormat = text "Unrecognised tar format" + pPrint Tar.HeaderBadNumericEncoding = text "Header has bad numeric encoding" #endif