From 2d25c865cc9818bef5d4e8106d7f0e3537bbd627 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Wed, 25 Aug 2021 20:13:17 +0200 Subject: [PATCH] Remove zip dependency --- ghcup.cabal | 1 - lib/GHCup/Utils.hs | 9 ++------- stack.yaml | 1 - 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/ghcup.cabal b/ghcup.cabal index 207aae3..fccdf66 100644 --- a/ghcup.cabal +++ b/ghcup.cabal @@ -135,7 +135,6 @@ library , versions >=4.0.1 && <5.1 , word8 ^>=0.1.3 , yaml ^>=0.11.4.0 - , zip ^>=1.7.1 , zlib ^>=0.6.2.2 if (flag(internal-downloader) && !os(windows)) diff --git a/lib/GHCup/Utils.hs b/lib/GHCup/Utils.hs index 7971762..9717cbf 100644 --- a/lib/GHCup/Utils.hs +++ b/lib/GHCup/Utils.hs @@ -40,7 +40,6 @@ import GHCup.Utils.Prelude import GHCup.Utils.String.QQ import Codec.Archive hiding ( Directory ) -import Codec.Archive.Zip import Control.Applicative import Control.Exception.Safe import Control.Monad @@ -628,8 +627,7 @@ unpackToDir dfp av = do | ".tar.bz2" `isSuffixOf` fn -> liftE (untar . BZip.decompress =<< rf av) | ".tar" `isSuffixOf` fn -> liftE (untar =<< rf av) - | ".zip" `isSuffixOf` fn -> - withArchive av (unpackInto dfp) + | ".zip" `isSuffixOf` fn -> liftE (untar =<< rf av) | otherwise -> throwE $ UnknownArchive fn @@ -658,10 +656,7 @@ getArchiveFiles av = do | ".tar.bz2" `isSuffixOf` fn -> liftE (entries . BZip.decompress =<< rf av) | ".tar" `isSuffixOf` fn -> liftE (entries =<< rf av) - | ".zip" `isSuffixOf` fn -> - withArchive av $ do - entries' <- getEntries - pure $ fmap unEntrySelector $ Map.keys entries' + | ".zip" `isSuffixOf` fn -> liftE (entries =<< rf av) | otherwise -> throwE $ UnknownArchive fn diff --git a/stack.yaml b/stack.yaml index 2b83e7e..6569c09 100644 --- a/stack.yaml +++ b/stack.yaml @@ -41,7 +41,6 @@ extra-deps: - streamly-posix-0.1.0.1@sha256:5d89b806281035d34020387ed99dde1ddab282c7ed66df3b7cd010b38fd3517b,2138 - strict-base-0.4.0.0@sha256:2ff4e43cb95eedf2995558d7fc34d19362846413dd39e6aa6a5b3ea8228fef9f,1248 - xor-0.0.1.0@sha256:f8362b4a68562b9afbcd727ff64c1a303970df3a032e0033d2f4c094c3501df3,2243 - - zip-1.7.1@sha256:0ce03d0fbffba47c1ab6fbb9166f8ba5373d828d78587df21b7e9d7bb150f929,3918 flags: http-io-streams: