Hello community,

here is the log from the commit of package cabal-install for openSUSE:Factory 
checked in at 2016-01-05 21:54:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cabal-install (Old)
 and      /work/SRC/openSUSE:Factory/.cabal-install.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "cabal-install"

Changes:
--------
--- /work/SRC/openSUSE:Factory/cabal-install/cabal-install.changes      
2015-08-25 08:46:22.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.cabal-install.new/cabal-install.changes 
2016-01-05 21:54:59.000000000 +0100
@@ -1,0 +2,8 @@
+Mon Dec 28 08:41:32 UTC 2015 - [email protected]
+
+- update to 1.22.7.0
+* Remove GZipUtils tests
+* maybeDecompress: bail on all errors at the beginning of the stream with zlib 
< 0.6
+* Correct maybeDecompress
+
+-------------------------------------------------------------------

Old:
----
  cabal-install-1.22.6.0.tar.gz

New:
----
  cabal-install-1.22.7.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ cabal-install.spec ++++++
--- /var/tmp/diff_new_pack.HxA9SE/_old  2016-01-05 21:55:00.000000000 +0100
+++ /var/tmp/diff_new_pack.HxA9SE/_new  2016-01-05 21:55:00.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           cabal-install
-Version:        1.22.6.0
+Version:        1.22.7.0
 Release:        0
 Summary:        The command-line interface for Cabal and Hackage
 License:        BSD-3-Clause

++++++ cabal-install-1.22.6.0.tar.gz -> cabal-install-1.22.7.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/cabal-install-1.22.6.0/Distribution/Client/GZipUtils.hs 
new/cabal-install-1.22.7.0/Distribution/Client/GZipUtils.hs
--- old/cabal-install-1.22.6.0/Distribution/Client/GZipUtils.hs 2015-06-17 
10:11:26.000000000 +0200
+++ new/cabal-install-1.22.7.0/Distribution/Client/GZipUtils.hs 2015-12-28 
00:03:02.000000000 +0100
@@ -1,3 +1,6 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE CPP #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Distribution.Client.GZipUtils
@@ -15,10 +18,15 @@
     maybeDecompress,
   ) where
 
-import qualified Data.ByteString.Lazy.Internal as BS (ByteString(..))
-import Data.ByteString.Lazy (ByteString)
-import Codec.Compression.GZip
 import Codec.Compression.Zlib.Internal
+import Data.ByteString.Lazy.Internal as BS (ByteString(Empty, Chunk))
+
+#if MIN_VERSION_zlib(0,6,0)
+import Control.Exception (throw)
+import Control.Monad (liftM)
+import Control.Monad.ST.Lazy (ST, runST)
+import qualified Data.ByteString as Strict
+#endif
 
 -- | Attempts to decompress the `bytes' under the assumption that
 -- "data format" error at the very beginning of the stream means
@@ -30,15 +38,49 @@
 -- <https://github.com/haskell/cabal/issues/678>
 --
 maybeDecompress :: ByteString -> ByteString
+#if MIN_VERSION_zlib(0,6,0)
+maybeDecompress bytes = runST (go bytes decompressor)
+  where
+    decompressor :: DecompressStream (ST s)
+    decompressor = decompressST gzipOrZlibFormat defaultDecompressParams
+
+    -- DataError at the beginning of the stream probably means that stream is
+    -- not compressed, so we return it as-is.
+    -- TODO: alternatively, we might consider looking for the two magic bytes
+    -- at the beginning of the gzip header.  (not an option for zlib, though.)
+    go :: Monad m => ByteString -> DecompressStream m -> m ByteString
+    go cs (DecompressOutputAvailable bs k) = liftM (Chunk bs) $ go' cs =<< k
+    go _  (DecompressStreamEnd       _bs ) = return Empty
+    go _  (DecompressStreamError _err    ) = return bytes
+    go cs (DecompressInputRequired      k) = go cs' =<< k c
+      where
+        (c, cs') = uncons cs
+
+    -- Once we have received any output though we regard errors as actual 
errors
+    -- and we throw them (as pure exceptions).
+    -- TODO: We could (and should) avoid these pure exceptions.
+    go' :: Monad m => ByteString -> DecompressStream m -> m ByteString
+    go' cs (DecompressOutputAvailable bs k) = liftM (Chunk bs) $ go' cs =<< k
+    go' _  (DecompressStreamEnd       _bs ) = return Empty
+    go' _  (DecompressStreamError err     ) = throw err
+    go' cs (DecompressInputRequired      k) = go' cs' =<< k c
+      where
+        (c, cs') = uncons cs
+
+    uncons :: ByteString -> (Strict.ByteString, ByteString)
+    uncons Empty        = (Strict.empty, Empty)
+    uncons (Chunk c cs) = (c, cs)
+#else
 maybeDecompress bytes = foldStream $ decompressWithErrors gzipOrZlibFormat 
defaultDecompressParams bytes
   where
     -- DataError at the beginning of the stream probably means that stream is 
not compressed.
     -- Returning it as-is.
     -- TODO: alternatively, we might consider looking for the two magic bytes
     -- at the beginning of the gzip header.
-    foldStream (StreamError DataError _) = bytes
+    foldStream (StreamError _ _) = bytes
     foldStream somethingElse = doFold somethingElse
 
     doFold StreamEnd               = BS.Empty
     doFold (StreamChunk bs stream) = BS.Chunk bs (doFold stream)
     doFold (StreamError _ msg)  = error $ "Codec.Compression.Zlib: " ++ msg
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cabal-install-1.22.6.0/bootstrap.sh 
new/cabal-install-1.22.7.0/bootstrap.sh
--- old/cabal-install-1.22.6.0/bootstrap.sh     2015-06-17 10:11:26.000000000 
+0200
+++ new/cabal-install-1.22.7.0/bootstrap.sh     2015-12-28 00:03:03.000000000 
+0100
@@ -190,7 +190,7 @@
                        # >= 2.0 && < 2.7
 NETWORK_URI_VER="2.6.0.1"; NETWORK_URI_VER_REGEXP="2\.6\."
                        # >= 2.6 && < 2.7
-CABAL_VER="1.22.4.0";  CABAL_VER_REGEXP="1\.22"
+CABAL_VER="1.22.6.0";  CABAL_VER_REGEXP="1\.22"
                        # >= 1.22 && < 1.23
 TRANS_VER="0.4.2.0";   TRANS_VER_REGEXP="0\.[4]\."
                        # >= 0.2.* && < 0.5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cabal-install-1.22.6.0/cabal-install.cabal 
new/cabal-install-1.22.7.0/cabal-install.cabal
--- old/cabal-install-1.22.6.0/cabal-install.cabal      2015-06-17 
10:11:26.000000000 +0200
+++ new/cabal-install-1.22.7.0/cabal-install.cabal      2015-12-28 
00:03:03.000000000 +0100
@@ -1,5 +1,5 @@
 Name:               cabal-install
-Version:            1.22.6.0
+Version:            1.22.7.0
 Synopsis:           The command-line interface for Cabal and Hackage.
 Description:
     The \'cabal\' command-line program simplifies the process of managing
@@ -138,7 +138,7 @@
         random     >= 1        && < 1.2,
         stm        >= 2.0      && < 3,
         time       >= 1.1      && < 1.6,
-        zlib       >= 0.5.3    && < 0.6
+        zlib       >= 0.5.3    && < 0.7
 
     if flag(old-directory)
       build-depends: directory >= 1 && < 1.2, old-time >= 1 && < 1.2,
@@ -236,7 +236,7 @@
   build-depends:
     Cabal,
     HUnit,
-    QuickCheck >= 2.1.0.1 && < 2.8,
+    QuickCheck >= 2.1.0.1 && < 2.9,
     base,
     bytestring,
     directory,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cabal-install-1.22.6.0/changelog 
new/cabal-install-1.22.7.0/changelog
--- old/cabal-install-1.22.6.0/changelog        2015-06-17 10:11:26.000000000 
+0200
+++ new/cabal-install-1.22.7.0/changelog        2015-12-28 00:03:03.000000000 
+0100
@@ -1,4 +1,9 @@
 -*-change-log-*-
+1.22.7.0
+       * Remove GZipUtils tests
+       * maybeDecompress: bail on all errors at the beginning of the stream 
with zlib < 0.6
+       * Correct maybeDecompress
+
 1.22.6.0 Ryan Thomas <[email protected]> June 2015
        * A fix for @ezyang's fix for #2502. (Mikhail Glushenkov)
 


Reply via email to