packages feed

ats-pkg 2.2.1.0 → 2.2.1.1

raw patch · 3 files changed

+18/−3 lines, 3 filesdep +zip-archivePVP ok

version bump matches the API change (PVP)

Dependencies added: zip-archive

API changes (from Hackage documentation)

Files

ats-pkg.cabal view
@@ -1,5 +1,5 @@ name:                ats-pkg-version:             2.2.1.0+version:             2.2.1.1 synopsis:            A build tool for ATS description:         A collection of scripts to simplify building ATS projects. homepage:            https://github.com/vmchale/atspkg#readme@@ -57,6 +57,7 @@                      , shake-ext >= 2.3.0.0                      , composition-prelude >= 1.1.0.2                      , optparse-applicative+                     , zip-archive                      , temporary                      , ansi-wl-pprint                      , binary
src/Language/ATS/Package/Dependency.hs view
@@ -8,6 +8,7 @@                                        ) where  import qualified Codec.Archive.Tar                    as Tar+import           Codec.Archive.Zip                    (ZipOption (..), extractFilesFromArchive, toArchive) import qualified Codec.Compression.GZip               as Gzip import           Control.Concurrent.ParallelIO.Global import           Control.Lens@@ -97,6 +98,17 @@     | ".tar" `TL.isSuffixOf` s = pure id     | otherwise = unrecognized (TL.unpack s) +tarResponse :: Text -> FilePath -> ByteString -> IO ()+tarResponse url' dirName response = do+    compress <- getCompressor url'+    let f = Tar.unpack dirName . Tar.read . compress+    f response++zipResponse :: FilePath -> ByteString -> IO ()+zipResponse dirName response = do+    let options = OptDestination dirName+    extractFilesFromArchive [options] (toArchive response)+ buildHelper :: Bool -> ATSDependency -> IO () buildHelper b (ATSDependency lib' dirName' url'' _) = do @@ -112,8 +124,9 @@         response <- responseBody <$> httpLbs (initialRequest { method = "GET" }) manager          putStrLn ("Unpacking library " ++ lib ++ "...")-        compress <- getCompressor url''-        Tar.unpack dirName . Tar.read . compress $ response+        if "zip" `TL.isSuffixOf` url'' then+            zipResponse dirName response+                else tarResponse url'' dirName response          needsMove <- doesDirectoryExist (dirName ++ "/package")         when needsMove $ do
src/Language/ATS/Package/Upgrade.hs view
@@ -16,6 +16,7 @@ import           System.Info import           System.Posix.Files +-- https://github.com/vmchale/atspkg/archive/master.zip manufacturer :: String manufacturer = case os of     "darwin" -> "apple"