Blob Blame History Raw
From 0165f0a739a634ed03e6c87f258ebb5810005d21 Mon Sep 17 00:00:00 2001
From: Oleg Grenrus <oleg.grenrus@iki.fi>
Date: Fri, 29 Nov 2019 01:48:44 +0200
Subject: [PATCH 002/274] Use hackage-security-0.6

Also in CI setup, install hackage-repo-tool using `cabal new-install`.
And remove slightly confusing cabal.project.travis file.
---
 .../Distribution/Client/Security/HTTP.hs      | 10 ++++++--
 cabal-install/bootstrap.sh                    |  4 ++--
 cabal-install/cabal-install.cabal             |  2 +-
 cabal-install/cabal-install.cabal.pp          |  2 +-
 cabal.project.travis                          | 20 ----------------
 cabal.project.travis.libonly                  | 24 -------------------
 travis-common.sh                              |  2 --
 travis-script.sh                              | 16 ++++---------
 8 files changed, 16 insertions(+), 64 deletions(-)
 delete mode 100644 cabal.project.travis
 delete mode 100644 cabal.project.travis.libonly

--- a/Distribution/Client/Security/HTTP.hs
+++ b/Distribution/Client/Security/HTTP.hs
@@ -35,7 +35,6 @@
 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 @@
     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
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -260,8 +260,8 @@
                        # 0.2.2.*
 ED25519_VER="0.0.5.0"; ED25519_VER_REGEXP="0\.0\.?"
                        # 0.0.*
-HACKAGE_SECURITY_VER="0.5.3.0"; HACKAGE_SECURITY_VER_REGEXP="0\.5\.((2\.[2-9]|[3-9])|3)"
-                       # >= 0.5.2 && < 0.6
+HACKAGE_SECURITY_VER="0.6.0.0"; HACKAGE_SECURITY_VER_REGEXP="0\.6\."
+                       # >= 0.7.0.0 && < 0.7
 TAR_VER="0.5.1.0";     TAR_VER_REGEXP="0\.5\.([1-9]|1[0-9]|0\.[3-9]|0\.1[0-9])\.?"
                        # >= 0.5.0.3  && < 0.6
 DIGEST_VER="0.0.1.2"; DIGEST_REGEXP="0\.0\.(1\.[2-9]|[2-9]\.?)"
--- a/cabal-install.cabal
+++ b/cabal-install.cabal
@@ -308,7 +308,7 @@
     build-depends:
         async      >= 2.0      && < 2.3,
         array      >= 0.4      && < 0.6,
-        base       >= 4.8      && < 4.13,
+        base       >= 4.8      && < 4.15,
         base16-bytestring >= 0.1.1 && < 0.2,
         binary     >= 0.7.3    && < 0.9,
         bytestring >= 0.10.6.0 && < 0.11,
@@ -332,7 +332,7 @@
         tar        >= 0.5.0.3  && < 0.6,
         time       >= 1.5.0.1  && < 1.10,
         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