From b3b9e82f577d5ee9ec8bf1987808b183fa8beda6 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Fri, 19 Jul 2024 23:53:51 -0400 Subject: [PATCH] Add extra GHCComponents --- .../src/Security/Advisories/Core/Advisory.hs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/code/hsec-core/src/Security/Advisories/Core/Advisory.hs b/code/hsec-core/src/Security/Advisories/Core/Advisory.hs index 546f913..a49f0c7 100644 --- a/code/hsec-core/src/Security/Advisories/Core/Advisory.hs +++ b/code/hsec-core/src/Security/Advisories/Core/Advisory.hs @@ -52,7 +52,7 @@ data ComponentIdentifier = Hackage Text | GHC GHCComponent deriving stock (Show, Eq) -- Keep this list in sync with the 'ghcComponentFromText' below -data GHCComponent = GHCCompiler | GHCi | GHCRTS +data GHCComponent = GHCCompiler | GHCi | GHCRTS | GHCPkg | RunGHC | IServ | HP2PS | HPC | HSC2HS | Haddock deriving stock (Show, Eq, Enum, Bounded) ghcComponentToText :: GHCComponent -> Text @@ -60,12 +60,26 @@ ghcComponentToText c = case c of GHCCompiler -> "compiler" GHCi -> "ghci" GHCRTS -> "rts" + GHCPkg -> "ghc-pkg" + RunGHC -> "runghc" + IServ -> "iserv" + HP2PS -> "hp2ps" + HPC -> "hpc" + HSC2HS -> "hsc2hs" + Haddock -> "haddock" ghcComponentFromText :: Text -> Maybe GHCComponent ghcComponentFromText c = case c of "compiler" -> Just GHCCompiler "ghci" -> Just GHCi "rts" -> Just GHCRTS + "ghc-pkg" -> Just GHCPkg + "runghc" -> Just RunGHC + "iserv" -> Just IServ + "hp2ps" -> Just HP2PS + "hpc" -> Just HPC + "hsc2hs" -> Just HSC2HS + "haddock" -> Just Haddock _ -> Nothing -- | An affected package (or package component). An 'Advisory' must