streamly-archive 0.0.2 → 0.1.0
raw patch · 5 files changed
+22/−18 lines, 5 filesdep ~streamlyPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: streamly
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- README.md +1/−1
- src/Streamly/External/Archive.hs +5/−5
- streamly-archive.cabal +5/−5
- test/Streamly/External/Archive/Tests.hs +7/−7
ChangeLog.md view
@@ -1,3 +1,7 @@+## 0.1.0++* Updated for streamly 0.8.0.+ ## 0.0.2 * Allow QuickCheck <2.15 and tasty <1.5.
README.md view
@@ -1,7 +1,7 @@ # streamly-archive [](https://hackage.haskell.org/package/streamly-archive)-[](https://travis-ci.org/shlok/streamly-archive)+ Stream data from archives (tar, tar.gz, zip, or any other format [supported by libarchive](https://github.com/libarchive/libarchive/wiki/LibarchiveFormats)) using the Haskell [streamly](https://hackage.haskell.org/package/streamly) library.
src/Streamly/External/Archive.hs view
@@ -26,12 +26,12 @@ import Data.Void (Void) import Foreign (Ptr, free, malloc) import Foreign.C.Types (CChar, CSize)+import Streamly.Internal.Data.IOFinalizer (newIOFinalizer, runIOFinalizer) import Streamly.Internal.Data.Stream.StreamD.Type (Step (..)) import Streamly.Internal.Data.Unfold (supply)-import Streamly.Internal.Data.Unfold.Types (Unfold (..))+import Streamly.Internal.Data.Unfold.Type (Unfold (..)) import qualified Data.ByteString as B-import qualified Streamly.Internal.Data.Stream.StreamD as D import Streamly.External.Archive.Internal.Foreign (Entry, FileType (..), archive_entry_filetype, archive_entry_pathname, archive_entry_pathname_utf8, archive_entry_size,@@ -62,14 +62,14 @@ -- | Creates an unfold with which we can stream data out of the given archive. {-# INLINE readArchive #-} readArchive :: (MonadIO m) => FilePath -> Unfold m Void (Either Header ByteString)-readArchive fp = flip supply () $+readArchive fp = supply () $ Unfold (\(arch, buf, sz, offs, pos, ref, readHeader) -> if readHeader then do me <- liftIO $ archive_read_next_header arch case me of Nothing -> do- liftIO $ D.runIORefFinalizer ref+ liftIO $ runIOFinalizer ref return Stop Just e -> do return $ Yield (Left $ Header e) (arch, buf, sz, offs, 0, ref, False)@@ -86,7 +86,7 @@ buf :: Ptr (Ptr CChar) <- liftIO malloc sz :: Ptr CSize <- liftIO malloc offs :: Ptr Int64 <- liftIO malloc- ref <- D.newFinalizedIORef $ archive_read_free arch >> free buf >> free sz >> free offs+ ref <- newIOFinalizer $ archive_read_free arch >> free buf >> free sz >> free offs return (arch, buf, sz, offs, ref) liftIO $ archive_read_support_filter_all arch liftIO $ archive_read_support_format_all arch
streamly-archive.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: d1bdeda7161e474d2faae54074a27a35ecd88370e604246d11b83a5f54a66471+-- hash: 3fcf39b51710099491d88d24c7309b32d8799b3ab5c85856dddb8b74361e25be name: streamly-archive-version: 0.0.2+version: 0.1.0 synopsis: Stream data from archives using the streamly library. description: Please see the README on GitHub at <https://github.com/shlok/streamly-archive#readme> category: Archive, Codec, Streaming, Streamly@@ -15,7 +15,7 @@ bug-reports: https://github.com/shlok/streamly-archive/issues author: Shlok Datye maintainer: sd-haskell@quant.is-copyright: 2020 Shlok Datye+copyright: 2021 Shlok Datye license: BSD3 license-file: LICENSE build-type: Simple@@ -43,7 +43,7 @@ build-depends: base >=4.7 && <5 , bytestring ==0.10.*- , streamly ==0.7.*+ , streamly ==0.8.* default-language: Haskell2010 test-suite streamly-archive-test@@ -64,7 +64,7 @@ , cryptonite >=0.26 , directory >=1.3.6.0 && <1.4 , filepath >=1.4.2.1 && <1.5- , streamly ==0.7.*+ , streamly ==0.8.* , streamly-archive , tar >=0.5.1.1 && <0.6 , tasty >=1.2.3 && <1.5
test/Streamly/External/Archive/Tests.hs view
@@ -19,7 +19,7 @@ import Data.Function ((&)) import Data.List (nub, sort) import Data.Maybe (fromJust)-import Streamly.Internal.Data.Fold.Types (Fold (..))+import Streamly.Internal.Data.Fold.Type (Fold (Fold), Step (Partial)) import System.Directory (createDirectoryIfMissing) import System.FilePath (addTrailingPathSeparator, hasTrailingPathSeparator, joinPath, takeDirectory) import System.IO.Temp (withSystemTempDirectory)@@ -73,11 +73,11 @@ mfp_ <- headerPathName h mtyp_ <- headerFileType h msz_ <- headerSize h- return (unpack <$> mfp_, mtyp_, msz_, mbs)- Right bs -> return (mfp, mtyp, msz, case mbs of+ return $ Partial (unpack <$> mfp_, mtyp_, msz_, mbs)+ Right bs -> return $ Partial (mfp, mtyp, msz, case mbs of Nothing -> Just bs Just bs' -> Just $ bs' `append` bs))- (return (Nothing, Nothing, Nothing, Nothing))+ (return $ Partial (Nothing, Nothing, Nothing, Nothing)) return pathsFileTypesSizesAndByteStrings <-@@ -116,11 +116,11 @@ case e of Left h -> do mfp_ <- headerPathName h- return (unpack <$> mfp_, mbs)- Right bs -> return (mfp, case mbs of+ return $ Partial (unpack <$> mfp_, mbs)+ Right bs -> return $ Partial (mfp, case mbs of Nothing -> Just bs Just bs' -> Just $ bs' `append` bs))- (return (Nothing, Nothing))+ (return $ Partial (Nothing, Nothing)) return archive <-