shake-bindist 1.0.2.0 → 1.1.0.0
raw patch · 3 files changed
+21/−30 lines, 3 filesdep −brotlidep ~lzlibPVP ok
version bump matches the API change (PVP)
Dependencies removed: brotli
Dependency ranges changed: lzlib
API changes (from Hackage documentation)
- Development.Shake.BinDist: tarBrotli :: [FilePath] -> FilePattern -> Rules ()
- Development.Shake.BinDist: tarBrotliA :: [FilePath] -> FilePath -> Action ()
Files
- CHANGELOG.md +4/−0
- shake-bindist.cabal +9/−12
- src/Development/Shake/BinDist.hs +8/−18
CHANGELOG.md view
@@ -1,5 +1,9 @@ # shake-bindist +## 1.1.0.0++ * Remove brotli support+ ## 1.0.2.0 * Fix bug in `tarXz`
shake-bindist.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.0 name: shake-bindist-version: 1.0.2.0+version: 1.1.0.0 license: BSD3 license-file: LICENSE copyright: Copyright: (c) 2020 Vanessa McHale@@ -18,11 +18,6 @@ type: darcs location: https://hub.darcs.net/vmchale/shake-bindist -flag development- description: Enable `-Werror`- default: False- manual: True- library exposed-modules: Development.Shake.BinDist hs-source-dirs: src@@ -31,17 +26,13 @@ build-depends: base >=4.3 && <5, shake -any,- lzlib >=0.3.2.0,+ lzlib >=1.0.2.0, zstd -any, bytestring -any, archive-sig >=0.2.0.0, bz2 >=0.1.1.0, zlib -any,- lzma -any,- brotli -any-- if flag(development)- ghc-options: -Werror+ lzma -any if impl(ghc >=8.0) ghc-options:@@ -50,3 +41,9 @@ if impl(ghc >=8.4) ghc-options: -Wmissing-export-lists++ if impl(ghc >=8.2)+ ghc-options: -Wcpp-undef++ if impl(ghc >=8.10)+ ghc-options: -Wunused-packages
src/Development/Shake/BinDist.hs view
@@ -4,18 +4,15 @@ , tarBz2 , tarGz , tarXz- , tarBrotli -- * Actions , tarLzipA , tarZstdA , tarBz2A , tarGzA , tarXzA- , tarBrotliA ) where import Archive.Compression (packFromFilesAndCompress)-import qualified Codec.Compression.Brotli as Brotli import qualified Codec.Compression.BZip as Bz2 import qualified Codec.Compression.GZip as GZip import qualified Codec.Compression.Lzma as Lzma@@ -23,7 +20,12 @@ import qualified Codec.Lzip as Lzip import qualified Data.ByteString.Lazy as BSL import Development.Shake hiding (action)+import System.IO (IOMode (ReadMode), hFileSize,+ withFile) +fileSize :: FilePath -> IO Integer+fileSize fp = withFile fp ReadMode hFileSize+ tarGenericA :: String -- ^ Rule name -> (BSL.ByteString -> BSL.ByteString) -- ^ Compression function -> [FilePath] -- ^ Files to pack up@@ -40,8 +42,6 @@ -- | The [lzip](http://www.nongnu.org/lzip/lzip.html) format is suitable for -- archiving.------ Note that 'tarLzip' doesn't stream in memory; the others do. tarLzip :: [FilePath] -- ^ Files to pack up -> FilePattern -- ^ Resultant tarball -> Rules ()@@ -68,16 +68,12 @@ -> Rules () tarXz = mkRule tarXzA --- | @since 1.0.2.0-tarBrotli :: [FilePath] -- ^ Files to pack up- -> FilePattern -- ^ Resultant tarball- -> Rules ()-tarBrotli = mkRule tarBrotliA- tarLzipA :: [FilePath] -- ^ Files to pack up -> FilePath -- ^ File name of resultant tarball -> Action ()-tarLzipA = tarGenericA "tar-lzip" Lzip.compressBest+tarLzipA fps tar = do+ guessSz <- liftIO (sum <$> traverse (fmap fromIntegral . fileSize) fps)+ tarGenericA "tar-lzip" (flip Lzip.compressSzBest guessSz) fps tar tarZstdA :: [FilePath] -- ^ Files to pack up -> FilePath -- ^ File name of resultant tarball@@ -99,9 +95,3 @@ -> FilePath -- ^ File name of resultant tarball -> Action () tarXzA = tarGenericA "lzma" Lzma.compress---- | @since 1.0.2.0-tarBrotliA :: [FilePath] -- ^ Files to pack up- -> FilePath -- ^ File name of resultant tarball- -> Action ()-tarBrotliA = tarGenericA "brotli" Brotli.compress