tar 0.5.0.3 → 0.5.1.0
raw patch · 3 files changed
+81/−28 lines, 3 filesdep +semigroupsdep ~arraydep ~basedep ~bytestringnew-uploader
Dependencies added: semigroups
Dependency ranges changed: array, base, bytestring, bytestring-builder, containers, directory, filepath, old-time, time
Files
- Codec/Archive/Tar/Types.hs +17/−7
- changelog.md +5/−0
- tar.cabal +59/−21
Codec/Archive/Tar/Types.hs view
@@ -62,6 +62,7 @@ import Data.Int (Int64) import Data.Monoid (Monoid(..))+import Data.Semigroup as Sem import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as BS.Char8 import qualified Data.ByteString.Lazy as LBS@@ -79,7 +80,8 @@ #ifdef TESTS import Test.QuickCheck-import Control.Applicative ((<$>), pure, (<*>))+import Control.Applicative ((<$>), (<*>), pure)+import Data.Word (Word16) #endif @@ -535,9 +537,13 @@ mapEntriesNoFail f = foldEntries (\entry -> Next (f entry)) Done Fail +-- | @since 0.5.1.0+instance Sem.Semigroup (Entries e) where+ a <> b = foldEntries Next b Fail a+ instance Monoid (Entries e) where- mempty = Done- mappend a b = foldEntries Next b Fail a+ mempty = Done+ mappend = (Sem.<>) instance Functor Entries where fmap f = foldEntries Next Done (Fail . f)@@ -559,13 +565,13 @@ <*> arbitrary <*> arbitraryEpochTime <*> arbitrary where arbitraryPermissions :: Gen Permissions- arbitraryPermissions = fromIntegral <$> (arbitraryOctal 7 :: Gen Int)+ arbitraryPermissions = fromIntegral <$> (arbitrary :: Gen Word16) arbitraryEpochTime :: Gen EpochTime- arbitraryEpochTime = fromIntegral <$> (arbitraryOctal 11 :: Gen Int)+ arbitraryEpochTime = arbitraryOctal 11 shrink (Entry path content perms author time format) =- [ Entry path' content' perms author' time' format + [ Entry path' content' perms author' time' format | (path', content', author', time') <- shrink (path, content, author, time) ] ++ [ Entry path content perms' author time format@@ -651,7 +657,11 @@ arbitrary = Ownership <$> name <*> name <*> idno <*> idno where- name = listOf0ToN 32 (arbitrary `suchThat` (/= '\0'))+ -- restrict user/group to posix ^[a-z][-a-z0-9]{0,30}$+ name = do+ first <- choose ('a', 'z')+ rest <- listOf0ToN 30 (oneof [choose ('a', 'z'), choose ('0', '9'), pure '-'])+ return $ first : rest idno = arbitraryOctal 7 shrink (Ownership oname gname oid gid) =
changelog.md view
@@ -1,3 +1,8 @@+0.5.1.0 Herbert Valerio Riedel <hvr@gnu.org> March 2018++ * Add support for GHC 8.4.1 / base-4.11+ * Add `Semigroup` instance for `Entries`+ 0.5.0.3 Duncan Coutts <duncan@community.haskell.org> May 2016 * Fix tarbomb logic to ignore special PAX entries. Was breaking many
tar.cabal view
@@ -1,5 +1,5 @@ name: tar-version: 0.5.0.3+version: 0.5.1.0 license: BSD3 license-file: LICENSE author: Duncan Coutts <duncan@community.haskell.org>@@ -24,8 +24,8 @@ build-type: Simple cabal-version: >=1.8 extra-source-files: changelog.md-tested-with: GHC==6.10.4, GHC==6.12.3, GHC==7.0.4, GHC==7.2.2, GHC==7.4.2,- GHC==7.6.3, GHC==7.8.4, GHC==7.10.2, GHC==8.1+tested-with: GHC==7.0.4, GHC==7.2.2, GHC==7.4.2, GHC==7.6.3,+ GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.1 source-repository head type: git@@ -38,22 +38,25 @@ default: False library- build-depends: base == 4.*,- filepath,- directory,- array,- containers >= 0.2,- deepseq >= 1.1 && < 1.5+ build-depends: base == 4.*,+ filepath < 1.5,+ array < 0.6,+ containers >= 0.2 && < 0.6,+ deepseq >= 1.1 && < 1.5+ if flag(old-time)- build-depends: directory < 1.2, old-time+ build-depends: directory < 1.2, old-time < 1.2 else- build-depends: directory >= 1.2, time+ build-depends: directory >= 1.2 && < 1.4, time < 1.9 if flag(old-bytestring)- build-depends: bytestring-builder, bytestring >= 0.9 && <0.10+ build-depends: bytestring-builder >= 0.10.4.0.2 && < 0.11, bytestring == 0.9.* else- build-depends: bytestring >= 0.10+ build-depends: bytestring == 0.10.* + if !impl(ghc >= 8.0)+ build-depends: semigroups == 0.18.*+ exposed-modules: Codec.Archive.Tar Codec.Archive.Tar.Entry@@ -70,8 +73,12 @@ Codec.Archive.Tar.Index.IntTrie other-extensions:- CPP, BangPatterns,- DeriveDataTypeable, ScopedTypeVariables+ BangPatterns+ CPP+ DeriveDataTypeable+ GeneralizedNewtypeDeriving+ PatternGuards+ ScopedTypeVariables ghc-options: -Wall -fno-warn-unused-imports @@ -83,7 +90,7 @@ containers, deepseq, bytestring-handle,- QuickCheck == 2.*,+ QuickCheck == 2.*, tasty >= 0.10 && <0.12, tasty-quickcheck == 0.8.* @@ -97,6 +104,9 @@ else build-depends: bytestring >= 0.10 + if !impl(ghc >= 8.0)+ build-depends: semigroups == 0.18.*+ hs-source-dirs: . test main-is: test/Properties.hs@@ -107,9 +117,21 @@ Codec.Archive.Tar.Index.StringTable Codec.Archive.Tar.Index.IntTrie + -- shared w/ lib:tar component+ other-modules:+ Codec.Archive.Tar+ Codec.Archive.Tar.Check+ Codec.Archive.Tar.Pack+ Codec.Archive.Tar.Read+ Codec.Archive.Tar.Types+ Codec.Archive.Tar.Unpack+ Codec.Archive.Tar.Write+ other-extensions:- CPP, BangPatterns,- DeriveDataTypeable, ScopedTypeVariables+ CPP+ BangPatterns,+ DeriveDataTypeable+ ScopedTypeVariables ghc-options: -fno-ignore-asserts @@ -118,11 +140,27 @@ hs-source-dirs: . bench main-is: bench/Main.hs build-depends: base,- bytestring,- filepath, directory,+ bytestring >= 0.10,+ filepath,+ directory >= 1.2, array, containers, deepseq,- old-time, time,+ time, criterion >= 1.0 + if !impl(ghc >= 8.0)+ build-depends: semigroups == 0.18.*++ -- shared w/ lib:tar component+ other-modules:+ Codec.Archive.Tar+ Codec.Archive.Tar.Check+ Codec.Archive.Tar.Index+ Codec.Archive.Tar.Index.IntTrie+ Codec.Archive.Tar.Index.StringTable+ Codec.Archive.Tar.Pack+ Codec.Archive.Tar.Read+ Codec.Archive.Tar.Types+ Codec.Archive.Tar.Unpack+ Codec.Archive.Tar.Write