Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-zlib for openSUSE:Factory checked in at 2021-03-10 08:56:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-zlib (Old) and /work/SRC/openSUSE:Factory/.ghc-zlib.new.2378 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-zlib" Wed Mar 10 08:56:02 2021 rev:23 rq:877690 version:0.6.2.3 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-zlib/ghc-zlib.changes 2020-12-22 11:49:49.342025245 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-zlib.new.2378/ghc-zlib.changes 2021-03-10 08:57:56.230931213 +0100 @@ -1,0 +2,8 @@ +Tue Feb 23 10:03:49 UTC 2021 - psim...@suse.com + +- Update zlib to version 0.6.2.3. + 0.6.2.3 Emily Pillmore <emil...@cohomolo.gy> February 2021 + + * Add support for bytestring-0.11.0.0 + +------------------------------------------------------------------- Old: ---- zlib-0.6.2.2.tar.gz New: ---- zlib-0.6.2.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-zlib.spec ++++++ --- /var/tmp/diff_new_pack.LY5muJ/_old 2021-03-10 08:57:56.790931791 +0100 +++ /var/tmp/diff_new_pack.LY5muJ/_new 2021-03-10 08:57:56.794931796 +0100 @@ -1,7 +1,7 @@ # # spec file for package ghc-zlib # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %global pkg_name zlib %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.6.2.2 +Version: 0.6.2.3 Release: 0 Summary: Compression and decompression in the gzip and zlib formats License: BSD-2-Clause ++++++ zlib-0.6.2.2.tar.gz -> zlib-0.6.2.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-0.6.2.2/Codec/Compression/Zlib/ByteStringCompat.hs new/zlib-0.6.2.3/Codec/Compression/Zlib/ByteStringCompat.hs --- old/zlib-0.6.2.2/Codec/Compression/Zlib/ByteStringCompat.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/zlib-0.6.2.3/Codec/Compression/Zlib/ByteStringCompat.hs 2001-09-09 03:46:40.000000000 +0200 @@ -0,0 +1,54 @@ +-- Lifted from the text package, with light editing: +-- Data.Text.Internal.ByteStringCompat + +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE CPP #-} +{-# LANGUAGE MagicHash #-} +module Codec.Compression.Zlib.ByteStringCompat (mkBS, withBS) where + +import Data.ByteString.Internal (ByteString (..)) +import Data.Word (Word8) +import Foreign.ForeignPtr (ForeignPtr) + +#if MIN_VERSION_base(4,10,0) +import GHC.ForeignPtr (plusForeignPtr) +#else +import GHC.ForeignPtr (ForeignPtr(ForeignPtr)) +import GHC.Types (Int (..)) +import GHC.Prim (plusAddr#) +#endif + +mkBS :: ForeignPtr Word8 -> Int -> Int -> ByteString +#if MIN_VERSION_bytestring(0,11,0) +mkBS dfp o n = BS (plusForeignPtr dfp o) n +#else +mkBS dfp o n = PS dfp o n +#endif +{-# INLINE mkBS #-} + +withBS :: ByteString -> (ForeignPtr Word8 -> Int -> r) -> r +#if MIN_VERSION_bytestring(0,11,0) +withBS (BS !sfp !slen) kont = kont sfp slen +#else +withBS (PS !sfp !soff !slen) kont = kont (plusForeignPtr sfp soff) slen +#endif +{-# INLINE withBS #-} + +#if !MIN_VERSION_base(4,10,0) +-- |Advances the given address by the given offset in bytes. +-- +-- The new 'ForeignPtr' shares the finalizer of the original, +-- equivalent from a finalization standpoint to just creating another +-- reference to the original. That is, the finalizer will not be +-- called before the new 'ForeignPtr' is unreachable, nor will it be +-- called an additional time due to this call, and the finalizer will +-- be called with the same address that it would have had this call +-- not happened, *not* the new address. +plusForeignPtr :: ForeignPtr a -> Int -> ForeignPtr b +plusForeignPtr (ForeignPtr addr guts) (I# offset) = ForeignPtr (plusAddr# addr offset) guts +{-# INLINE [0] plusForeignPtr #-} +{-# RULES +"ByteString plusForeignPtr/0" forall fp . + plusForeignPtr fp 0 = fp + #-} +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-0.6.2.2/Codec/Compression/Zlib/Internal.hs new/zlib-0.6.2.3/Codec/Compression/Zlib/Internal.hs --- old/zlib-0.6.2.2/Codec/Compression/Zlib/Internal.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/zlib-0.6.2.3/Codec/Compression/Zlib/Internal.hs 2001-09-09 03:46:40.000000000 +0200 @@ -92,6 +92,7 @@ import GHC.IO (noDuplicate) import qualified Codec.Compression.Zlib.Stream as Stream +import Codec.Compression.Zlib.ByteStringCompat (mkBS, withBS) import Codec.Compression.Zlib.Stream (Stream) -- | The full set of parameters for compression. The defaults are @@ -471,13 +472,12 @@ \chunk -> do Stream.deflateInit format compLevel method bits memLevel strategy setDictionary mdict - case chunk of - _ | S.null chunk -> - fillBuffers 20 --gzip header is 20 bytes, others even smaller - - S.PS inFPtr offset length -> do - Stream.pushInputBuffer inFPtr offset length - fillBuffers initChunkSize + withBS chunk $ \inFPtr length -> + if length == 0 + then fillBuffers 20 --gzip header is 20 bytes, others even smaller + else do + Stream.pushInputBuffer inFPtr 0 length + fillBuffers initChunkSize where -- we flick between two states: @@ -507,11 +507,11 @@ Stream.pushOutputBuffer outFPtr 0 outChunkSize if inputBufferEmpty - then return $ CompressInputRequired $ \chunk -> - case chunk of - _ | S.null chunk -> drainBuffers True - S.PS inFPtr offset length -> do - Stream.pushInputBuffer inFPtr offset length + then return $ CompressInputRequired $ flip withBS $ \inFPtr length -> + if length == 0 + then drainBuffers True + else do + Stream.pushInputBuffer inFPtr 0 length drainBuffers False else drainBuffers False @@ -534,7 +534,7 @@ outputBufferFull <- Stream.outputBufferFull if outputBufferFull then do (outFPtr, offset, length) <- Stream.popOutputBuffer - let chunk = S.PS outFPtr offset length + let chunk = mkBS outFPtr offset length return $ CompressOutputAvailable chunk $ do fillBuffers defaultCompressBufferSize else do fillBuffers defaultCompressBufferSize @@ -545,7 +545,7 @@ outputBufferBytesAvailable <- Stream.outputBufferBytesAvailable if outputBufferBytesAvailable > 0 then do (outFPtr, offset, length) <- Stream.popOutputBuffer - let chunk = S.PS outFPtr offset length + let chunk = mkBS outFPtr offset length Stream.finalise return $ CompressOutputAvailable chunk (return CompressStreamEnd) else do Stream.finalise @@ -607,25 +607,25 @@ Stream.inflateReset else assert outputBufferFull $ Stream.inflateInit format bits - case chunk of - _ | S.null chunk -> do - -- special case to avoid demanding more input again - -- always an error anyway - when outputBufferFull $ do - let outChunkSize = 1 - outFPtr <- Stream.unsafeLiftIO (S.mallocByteString outChunkSize) - Stream.pushOutputBuffer outFPtr 0 outChunkSize - drainBuffers True - - S.PS inFPtr offset length -> do - Stream.pushInputBuffer inFPtr offset length - -- Normally we start with no output buffer (so counts as full) but - -- if we're resuming then we'll usually still have output buffer - -- space available - assert (if not resume then outputBufferFull else True) $ return () - if outputBufferFull - then fillBuffers initChunkSize - else drainBuffers False + withBS chunk $ \inFPtr length -> + if length == 0 + then do + -- special case to avoid demanding more input again + -- always an error anyway + when outputBufferFull $ do + let outChunkSize = 1 + outFPtr <- Stream.unsafeLiftIO (S.mallocByteString outChunkSize) + Stream.pushOutputBuffer outFPtr 0 outChunkSize + drainBuffers True + else do + Stream.pushInputBuffer inFPtr 0 length + -- Normally we start with no output buffer (so counts as full) but + -- if we're resuming then we'll usually still have output buffer + -- space available + assert (if not resume then outputBufferFull else True) $ return () + if outputBufferFull + then fillBuffers initChunkSize + else drainBuffers False where -- we flick between two states: @@ -657,11 +657,12 @@ if inputBufferEmpty then return $ DecompressInputRequired $ \chunk -> - case chunk of - _ | S.null chunk -> drainBuffers True - S.PS inFPtr offset length -> do - Stream.pushInputBuffer inFPtr offset length - drainBuffers False + withBS chunk $ \inFPtr length -> + if length == 0 + then drainBuffers True + else do + Stream.pushInputBuffer inFPtr 0 length + drainBuffers False else drainBuffers False @@ -682,7 +683,7 @@ outputBufferFull <- Stream.outputBufferFull if outputBufferFull then do (outFPtr, offset, length) <- Stream.popOutputBuffer - let chunk = S.PS outFPtr offset length + let chunk = mkBS outFPtr offset length return $ DecompressOutputAvailable chunk $ do fillBuffers defaultDecompressBufferSize else do fillBuffers defaultDecompressBufferSize @@ -695,7 +696,7 @@ if inputBufferEmpty then do finish (DecompressStreamEnd S.empty) else do (inFPtr, offset, length) <- Stream.popRemainingInputBuffer - let inchunk = S.PS inFPtr offset length + let inchunk = mkBS inFPtr offset length finish (DecompressStreamEnd inchunk) Stream.Error code msg -> case code of @@ -714,7 +715,7 @@ outputBufferBytesAvailable <- Stream.outputBufferBytesAvailable if outputBufferBytesAvailable > 0 then do (outFPtr, offset, length) <- Stream.popOutputBuffer - return (DecompressOutputAvailable (S.PS outFPtr offset length) (return end)) + return (DecompressOutputAvailable (mkBS outFPtr offset length) (return end)) else return end setDictionary :: Stream.DictionaryHash -> Maybe S.ByteString @@ -902,7 +903,7 @@ tryFollowingStream :: S.ByteString -> Stream.State s -> ST s (DecompressStream (ST s)) - tryFollowingStream chunk zstate = + tryFollowingStream chunk zstate = case S.length chunk of 0 -> return $ DecompressInputRequired $ \chunk' -> case S.length chunk' of 0 -> finaliseStreamEnd S.empty zstate diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-0.6.2.2/changelog new/zlib-0.6.2.3/changelog --- old/zlib-0.6.2.2/changelog 2001-09-09 03:46:40.000000000 +0200 +++ new/zlib-0.6.2.3/changelog 2001-09-09 03:46:40.000000000 +0200 @@ -1,5 +1,9 @@ See also http://pvp.haskell.org/faq +0.6.2.3 Emily Pillmore <emil...@cohomolo.gy> February 2021 + + * Add support for bytestring-0.11.0.0 + 0.6.2.2 Julian Ospald <hasuf...@posteo.de> August 2020 * Bump bundled zlib to 1.2.11, fixes #26 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-0.6.2.2/test/Test.hs new/zlib-0.6.2.3/test/Test.hs --- old/zlib-0.6.2.2/test/Test.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/zlib-0.6.2.3/test/Test.hs 2001-09-09 03:46:40.000000000 +0200 @@ -22,6 +22,9 @@ import qualified Data.ByteString.Char8 as BS.Char8 import qualified Data.ByteString.Lazy as BL import qualified Data.ByteString as BS +#if !MIN_VERSION_bytestring(0,11,0) +import qualified Data.ByteString.Internal as BS +#endif import System.IO #if !(MIN_VERSION_base(4,6,0)) import Prelude hiding (catch) @@ -38,7 +41,8 @@ testProperty "concatenated gzip members" prop_gzip_concat, testProperty "multiple gzip members, boundaries (all 2-chunks)" prop_multiple_members_boundary2, testProperty "multiple gzip members, boundaries (all 3-chunks)" prop_multiple_members_boundary3, - testProperty "prefixes of valid stream detected as truncated" prop_truncated + testProperty "prefixes of valid stream detected as truncated" prop_truncated, + testProperty "compress works with BSes with non-zero offset" prop_compress_nonzero_bs_offset ], testGroup "unit tests" [ testCase "simple gzip case" test_simple_gzip, @@ -136,6 +140,23 @@ shortStrings = sized $ \sz -> resize (sz `div` 6) arbitrary +prop_compress_nonzero_bs_offset :: BS.ByteString + -> Int + -> Property +prop_compress_nonzero_bs_offset original to_drop = + to_drop > 0 && + BS.length original > to_drop ==> + let input = BS.drop to_drop original +#if MIN_VERSION_bytestring(0,11,0) + dropped = to_drop +#else + (BS.PS _ptr dropped _length) = input +#endif + input' = BL.pack $ BS.unpack input -- BL.fromStrict is only available since bytestring-0.10.4.0 + compressed = compress gzipFormat defaultCompressParams input' + decompressed = decompress gzipFormat defaultDecompressParams compressed + in dropped == to_drop && decompressed == input' + test_simple_gzip :: Assertion test_simple_gzip = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/zlib-0.6.2.2/zlib.cabal new/zlib-0.6.2.3/zlib.cabal --- old/zlib-0.6.2.2/zlib.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/zlib-0.6.2.3/zlib.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,12 +1,12 @@ cabal-version: >= 1.10 name: zlib -version: 0.6.2.2 +version: 0.6.2.3 copyright: (c) 2006-2016 Duncan Coutts license: BSD3 license-file: LICENSE author: Duncan Coutts <dun...@community.haskell.org> -maintainer: Duncan Coutts <dun...@community.haskell.org> +maintainer: Duncan Coutts <dun...@community.haskell.org>, Andrew Lelechenko <andrew.leleche...@gmail.com>, Emily Pillmore <emil...@cohomolo.gy>, Herbert Valerio Riedel <h...@gnu.org> bug-reports: https://github.com/haskell/zlib/issues category: Codec synopsis: Compression and decompression in the gzip and zlib formats @@ -21,7 +21,19 @@ tasks and for the few cases where more control is needed it provides access to the full zlib feature set. build-type: Simple -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.1, GHC==8.0.2, GHC ==8.2.2, GHC ==8.4.4, GHC==8.6.5, GHC==8.8.3, GHC==8.10.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.4 + , GHC == 8.6.5 + , GHC == 8.8.4 + , GHC == 8.10.3 extra-source-files: changelog -- zlib C sources (for Windows) @@ -63,22 +75,27 @@ Codec.Compression.Zlib, Codec.Compression.Zlib.Raw, Codec.Compression.Zlib.Internal - other-modules: Codec.Compression.Zlib.Stream + other-modules: Codec.Compression.Zlib.Stream, + Codec.Compression.Zlib.ByteStringCompat + if impl(ghc < 7) default-language: Haskell98 default-extensions: PatternGuards else default-language: Haskell2010 + other-extensions: CPP, ForeignFunctionInterface, RankNTypes, BangPatterns, DeriveDataTypeable if impl(ghc >= 7.2) other-extensions: DeriveGeneric if impl(ghc >= 7.6) other-extensions: CApiFFI - build-depends: base >= 4 && < 4.15, - bytestring >= 0.9 && < 0.11 - if impl(ghc >= 7.2 && < 7.6) + + build-depends: base >= 4 && < 4.16, + bytestring >= 0.9 && < 0.12 + if impl(ghc >= 7.0 && < 8.0.3) build-depends: ghc-prim + includes: zlib.h ghc-options: -Wall -fwarn-tabs if flag(non-blocking-ffi) @@ -111,7 +128,7 @@ default-language: Haskell2010 build-depends: base, bytestring, zlib, QuickCheck == 2.*, - tasty >= 0.8 && < 1.3, + tasty >= 0.8 && < 1.5, tasty-quickcheck >= 0.8 && < 0.11, tasty-hunit >= 0.8 && < 0.11 ghc-options: -Wall