tar-conduit 0.1.0 → 0.1.1
raw patch · 3 files changed
+15/−2 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- src/Data/Conduit/Tar.hs +10/−1
- tar-conduit.cabal +1/−1
ChangeLog.md view
@@ -1,3 +1,7 @@+## 0.1.1 - 2017-05-31++ * Allow checksums to have leading spaces ([PR 8](https://github.com/snoyberg/tar-conduit/pull/8))+ ## 0.1.0 - 2016-11-03 * Initial release
src/Data/Conduit/Tar.hs view
@@ -1,4 +1,6 @@ {-# LANGUAGE BangPatterns #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE DeriveDataTypeable #-} {-| This module is about stream-processing tar archives. It is currently not very well tested. See the documentation of 'withEntries' for an usage sample. -}@@ -33,6 +35,10 @@ import Data.ByteString.Short (ShortByteString, toShort, fromShort) import Data.Monoid ((<>)) +#if !MIN_VERSION_base(4,8,0)+import Control.Applicative ((<*))+#endif+ data Header = Header { headerOffset :: !Offset , headerPayloadOffset :: !Offset@@ -108,7 +114,7 @@ parseHeader offset bs = assert (S.length bs == 512) $ do let checksumBytes = S.take 8 $ S.drop 148 bs expectedChecksum = parseOctal checksumBytes- actualChecksum = bsum bs - bsum checksumBytes + 8 * 0x20+ actualChecksum = bsum bs - bsum checksumBytes + 8 * space unless (actualChecksum == expectedChecksum) (Left (BadChecksum offset)) return Header { headerOffset = offset@@ -137,7 +143,10 @@ parseOctal :: Integral i => ByteString -> i parseOctal = S.foldl' (\t c -> t * 8 + fromIntegral (c - zero)) 0 . S.takeWhile (\c -> zero <= c && c <= seven)+ . S.dropWhile (== space) + space :: Integral i => i+ space = 0x20 zero = 48 seven = 55
tar-conduit.cabal view
@@ -1,5 +1,5 @@ name: tar-conduit-version: 0.1.0+version: 0.1.1 synopsis: Parse tar files using conduit for streaming description: Please see README.md homepage: https://github.com/snoyberg/tar-conduit#readme