packages feed

libarchive 2.2.0.1 → 2.2.0.2

raw patch · 7 files changed

+28/−10 lines, 7 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # libarchive +## 2.2.0.2++  * Use `bracket` where it doesn't crash GHC+ ## 2.2.0.1    * Use `bracket` in a few places where it doesn't crash GHC
LICENSE view
@@ -1,4 +1,4 @@-Copyright Vanessa McHale (c) 2018-2019+Copyright Vanessa McHale (c) 2018-2020  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 
README.md view
@@ -22,3 +22,7 @@ ```  so that you have appropriate test data downloaded.++## Performance++`libarchive` is faster than `tar` or `tar-conduit` when unpacking archives.
libarchive.cabal view
@@ -1,12 +1,12 @@ cabal-version:   1.18 name:            libarchive-version:         2.2.0.1+version:         2.2.0.2 license:         BSD3 license-file:    LICENSE-copyright:       Copyright: (c) 2018-2019 Vanessa McHale+copyright:       Copyright: (c) 2018-2020 Vanessa McHale maintainer:      vamchale@gmail.com author:          Vanessa McHale-tested-with:     ghc ==8.4.4 ghc ==8.6.5 ghc ==8.8.1+tested-with:     ghc ==8.4.4 ghc ==8.6.5 ghc ==8.8.2 bug-reports:     https://github.com/vmchale/libarchive/issues synopsis:        Haskell interface to libarchive description:
src/Codec/Archive/Foreign/Archive.chs view
@@ -384,6 +384,7 @@ {#pointer *archive as ArchivePtr -> Archive #} {#pointer *archive_entry as ArchiveEntryPtr -> ArchiveEntry #} {#pointer *stat as StatPtr -> Stat #}+-- | @FILE*@ in C {#pointer *FILE as FilePtr newtype#}  {#typedef size_t CSize#}
src/Codec/Archive/Pack.hs view
@@ -188,12 +188,12 @@                 handle $ archiveWriteOpenFilename a fpc             packEntries a hsEntries') -withArchiveEntry :: MonadIO m => (Ptr ArchiveEntry -> m a) -> m a-withArchiveEntry fact = do-    entry <- liftIO archiveEntryNew-    res <- fact entry-    liftIO $ archiveEntryFree entry-    pure res+withArchiveEntry :: (Ptr ArchiveEntry -> ArchiveM a) -> ArchiveM a+withArchiveEntry fact =+    bracketM+        archiveEntryNew+        archiveEntryFree+        fact  archiveEntryAdd :: Ptr Archive -> Entry -> ArchiveM () archiveEntryAdd a (Entry fp contents perms owner mtime) =
test/Spec.hs view
@@ -4,12 +4,21 @@ import           Codec.Archive import           Codec.Archive.Roundtrip (itPacksUnpacks, itPacksUnpacksViaFS, roundtrip, roundtripFreaky, roundtripStrict) import           Codec.Archive.Test+import qualified Data.ByteString         as BS import           Data.Either             (isRight) import           Data.Foldable           (traverse_) import           System.Directory        (doesDirectoryExist, listDirectory) import           System.FilePath         ((</>)) import           System.IO.Temp          (withSystemTempDirectory) import           Test.Hspec++reChunk :: Int -> BS.ByteString -> [BS.ByteString]+reChunk bSz b =+    if BS.length b <= bSz+        then [b]+        else+            let (b', b'') = BS.splitAt bSz b+            in b' : reChunk bSz b''  testFp :: FilePath -> Spec testFp fp = parallel $ it ("sucessfully unpacks/packs (" ++ fp ++ ")") $