void-packages/srcpkgs/cabal-install/patches/http.patch
2020-04-14 21:24:20 +02:00

37 lines
1.5 KiB
Diff

--- Distribution/Client/Security/HTTP.hs
+++ Distribution/Client/Security/HTTP.hs
@@ -35,7 +35,6 @@ import Hackage.Security.Client
import Hackage.Security.Client.Repository.HttpLib
import Hackage.Security.Util.Checked
import Hackage.Security.Util.Pretty
-import qualified Hackage.Security.Util.Lens as Lens
{-------------------------------------------------------------------------------
'HttpLib' implementation
@@ -142,7 +141,14 @@ mkReqHeaders reqHeaders mRange = concat [
finalize (name, strs) = [HTTP.Header name (intercalate ", " (reverse strs))]
insert :: Eq a => a -> [b] -> [(a, [b])] -> [(a, [b])]
- insert x y = Lens.modify (Lens.lookupM x) (++ y)
+ insert x y = modifyAssocList x (++ y)
+
+ -- modify the first maching element
+ modifyAssocList :: Eq a => a -> (b -> b) -> [(a, b)] -> [(a, b)]
+ modifyAssocList a f = go where
+ go [] = []
+ go (p@(a', b) : xs) | a == a' = (a', f b) : xs
+ | otherwise = p : go xs
{-------------------------------------------------------------------------------
Custom exceptions
--- cabal-install.cabal
+++ cabal-install.cabal
@@ -336,7 +336,7 @@ executable cabal
time >= 1.5.0.1 && < 1.10,
transformers >= 0.4.2.0 && < 0.6,
zlib >= 0.5.3 && < 0.7,
- hackage-security >= 0.5.2.2 && < 0.6,
+ hackage-security >= 0.6.0.0 && < 0.7,
text >= 1.2.3 && < 1.3,
parsec >= 3.1.13.0 && < 3.2