Hello community,

here is the log from the commit of package ghc-HTTP for openSUSE:Leap:15.2 
checked in at 2020-02-19 18:37:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/ghc-HTTP (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.ghc-HTTP.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-HTTP"

Wed Feb 19 18:37:09 2020 rev:11 rq:771194 version:4000.3.14

Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/ghc-HTTP/ghc-HTTP.changes      2020-01-15 
15:00:34.657752276 +0100
+++ /work/SRC/openSUSE:Leap:15.2/.ghc-HTTP.new.26092/ghc-HTTP.changes   
2020-02-19 18:37:10.109787057 +0100
@@ -1,0 +2,24 @@
+Fri Nov  8 16:14:00 UTC 2019 - Peter Simons <[email protected]>
+
+- Drop obsolete group attributes.
+
+-------------------------------------------------------------------
+Tue Jun 18 02:01:48 UTC 2019 - [email protected]
+
+- Update HTTP to version 4000.3.14.
+  Upstream has not updated the file "CHANGES" since the last
+  release.
+
+-------------------------------------------------------------------
+Tue Jun 11 14:29:06 UTC 2019 - Peter Simons <[email protected]>
+
+- Update Cabal file for more accurate build dependencies.
+
+-------------------------------------------------------------------
+Mon Mar 18 03:01:21 UTC 2019 - [email protected]
+
+- Update HTTP to version 4000.3.13.
+  Upstream has not updated the file "CHANGES" since the last
+  release.
+
+-------------------------------------------------------------------

Old:
----
  HTTP-4000.3.12.tar.gz
  HTTP.cabal

New:
----
  HTTP-4000.3.14.tar.gz

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

Other differences:
------------------
++++++ ghc-HTTP.spec ++++++
--- /var/tmp/diff_new_pack.UFTodX/_old  2020-02-19 18:37:10.453787778 +0100
+++ /var/tmp/diff_new_pack.UFTodX/_new  2020-02-19 18:37:10.457787785 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package ghc-HTTP
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,14 +19,12 @@
 %global pkg_name HTTP
 %bcond_with tests
 Name:           ghc-%{pkg_name}
-Version:        4000.3.12
+Version:        4000.3.14
 Release:        0
 Summary:        A library for client-side HTTP
 License:        BSD-3-Clause
-Group:          Development/Libraries/Haskell
 URL:            https://hackage.haskell.org/package/%{pkg_name}
 Source0:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
-Source1:        
https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/2.cabal#/%{pkg_name}.cabal
 BuildRequires:  ghc-Cabal-devel
 BuildRequires:  ghc-array-devel
 BuildRequires:  ghc-bytestring-devel
@@ -38,18 +36,12 @@
 BuildRequires:  ghc-time-devel
 %if %{with tests}
 BuildRequires:  ghc-HUnit-devel
-BuildRequires:  ghc-case-insensitive-devel
-BuildRequires:  ghc-conduit-devel
-BuildRequires:  ghc-conduit-extra-devel
 BuildRequires:  ghc-deepseq-devel
-BuildRequires:  ghc-http-types-devel
 BuildRequires:  ghc-httpd-shed-devel
 BuildRequires:  ghc-pureMD5-devel
 BuildRequires:  ghc-split-devel
 BuildRequires:  ghc-test-framework-devel
 BuildRequires:  ghc-test-framework-hunit-devel
-BuildRequires:  ghc-wai-devel
-BuildRequires:  ghc-warp-devel
 %endif
 
 %description
@@ -92,7 +84,6 @@
 
 %package devel
 Summary:        Haskell %{pkg_name} library development files
-Group:          Development/Libraries/Haskell
 Requires:       %{name} = %{version}-%{release}
 Requires:       ghc-compiler = %{ghc_version}
 Requires(post): ghc-compiler = %{ghc_version}
@@ -103,7 +94,6 @@
 
 %prep
 %setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
 
 %build
 %ghc_lib_build

++++++ HTTP-4000.3.12.tar.gz -> HTTP-4000.3.14.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/HTTP-4000.3.12/HTTP.cabal 
new/HTTP-4000.3.14/HTTP.cabal
--- old/HTTP-4000.3.12/HTTP.cabal       2018-06-09 17:12:09.000000000 +0200
+++ new/HTTP-4000.3.14/HTTP.cabal       2019-06-17 23:33:27.000000000 +0200
@@ -1,5 +1,5 @@
 Name: HTTP
-Version: 4000.3.12
+Version: 4000.3.14
 Cabal-Version: >= 1.8
 Build-type: Simple
 License: BSD3
@@ -56,7 +56,7 @@
 
 Extra-Source-Files: CHANGES
 
-tested-with: GHC==8.4.1, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, 
GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4
+tested-with: GHC==8.6.3, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, 
GHC==7.8.4, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4
 
 Source-Repository head
   type: git
@@ -77,7 +77,7 @@
 
 Flag warp-tests
   description: Test against warp
-  default:     True
+  default:     False
   manual:      True
 
 flag network-uri
@@ -109,7 +109,7 @@
 
   -- note the test harness constraints should be kept in sync with these
   -- where dependencies are shared
-  Build-depends: base >= 4.3.0.0 && < 4.12, parsec >= 2.0 && < 3.2
+  Build-depends: base >= 4.3.0.0 && < 4.14, parsec >= 2.0 && < 3.2
   Build-depends: array >= 0.3.0.2 && < 0.6, bytestring >= 0.9.1.5 && < 0.11
   Build-depends: time >= 1.1.2.3 && < 1.10
 
@@ -122,15 +122,15 @@
     Build-depends: mtl >= 2.0 && < 2.3
 
   if flag(network-uri)
-    Build-depends: network-uri == 2.6.*, network >= 2.6 && < 2.8
+    Build-depends: network-uri == 2.6.*, network >= 2.6 && < 3.2
   else
-    Build-depends: network >= 2.2.1.8 && < 2.6
+    Build-depends: network >= 2.4 && < 2.6
 
   if flag(warn-as-error)
     ghc-options:      -Werror
 
   if os(windows)
-    Build-depends: Win32 >= 2.2.0.0 && < 2.8
+    Build-depends: Win32 >= 2.2.0.0 && < 2.9
 
 Test-Suite test
   type: exitcode-stdio-1.0
@@ -151,15 +151,15 @@
                      bytestring >= 0.9.1.5 && < 0.11,
                      deepseq >= 1.3.0.0 && < 1.5,
                      pureMD5 >= 0.2.4 && < 2.2,
-                     base >= 4.3.0.0 && < 4.12,
+                     base >= 4.3.0.0 && < 4.14,
                      split >= 0.1.3 && < 0.3,
                      test-framework >= 0.2.0 && < 0.9,
                      test-framework-hunit >= 0.3.0 && <0.4
 
   if flag(network-uri)
-    Build-depends: network-uri == 2.6.*, network >= 2.6 && < 2.8
+    Build-depends: network-uri == 2.6.*, network >= 2.6 && < 3.2
   else
-    Build-depends: network >= 2.2.1.5 && < 2.6
+    Build-depends: network >= 2.3 && < 2.6
 
   if flag(warp-tests)
     CPP-Options: -DWARP_TESTS
@@ -176,5 +176,3 @@
       build-depends:
                          conduit >= 1.1 && < 1.4,
                          conduit-extra >= 1.1 && < 1.4
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/HTTP-4000.3.12/Network/Browser.hs 
new/HTTP-4000.3.14/Network/Browser.hs
--- old/HTTP-4000.3.12/Network/Browser.hs       2018-06-09 17:12:09.000000000 
+0200
+++ new/HTTP-4000.3.14/Network/Browser.hs       2019-06-17 23:33:27.000000000 
+0200
@@ -133,6 +133,9 @@
 
 import Network.Stream ( ConnError(..), Result )
 import Network.BufferType
+#if (MIN_VERSION_base(4,9,0)) && !(MIN_VERSION_base(4,13,0))
+import Control.Monad.Fail
+#endif
 
 import Data.Char (toLower)
 import Data.List (isPrefixOf)
@@ -422,7 +425,12 @@
   pure  = return
   (<*>) = ap
 #else
- deriving (Functor, Applicative, Monad, MonadIO, MonadState (BrowserState 
conn))
+ deriving
+ ( Functor, Applicative, Monad, MonadIO, MonadState (BrowserState conn)
+#if MIN_VERSION_base(4,9,0)
+ , MonadFail
+#endif
+ )
 #endif
 
 runBA :: BrowserState conn -> BrowserAction conn a -> IO a
@@ -720,7 +728,7 @@
     Left e  -> do
      let errStr = ("Network.Browser.request: Error raised " ++ show e)
      err errStr
-     fail errStr
+     Prelude.fail errStr
  where
   initialState = nullRequestState
   nullVal      = buf_empty bufferOps
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/HTTP-4000.3.12/Network/HTTP/Base.hs 
new/HTTP-4000.3.14/Network/HTTP/Base.hs
--- old/HTTP-4000.3.12/Network/HTTP/Base.hs     2018-06-09 17:12:09.000000000 
+0200
+++ new/HTTP-4000.3.14/Network/HTTP/Base.hs     2019-06-17 23:33:27.000000000 
+0200
@@ -1,4 +1,4 @@
-{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE CPP, ScopedTypeVariables #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Network.HTTP.Base
@@ -107,7 +107,7 @@
    )
 
 import Control.Monad ( guard )
-import Control.Monad.Error ()
+import Control.Monad.Error.Class ()
 import Data.Bits     ( (.&.), (.|.), shiftL, shiftR )
 import Data.Word     ( Word8 )
 import Data.Char     ( digitToInt, intToDigit, toLower, isDigit,
@@ -209,7 +209,11 @@
   default_http  = 80
   default_https = 443
 
+#if MIN_VERSION_base(4,13,0)
+failHTTPS :: MonadFail m => URI -> m ()
+#else
 failHTTPS :: Monad m => URI -> m ()
+#endif
 failHTTPS uri
   | map toLower (uriScheme uri) == "https:" = fail "https not supported"
   | otherwise = return ()
@@ -713,7 +717,11 @@
 
 -- | @getAuth req@ fishes out the authority portion of the URL in a request's 
@Host@
 -- header.
+#if MIN_VERSION_base(4,13,0)
+getAuth :: MonadFail m => Request ty -> m URIAuthority
+#else
 getAuth :: Monad m => Request ty -> m URIAuthority
+#endif
 getAuth r = 
    -- ToDo: verify that Network.URI functionality doesn't take care of this 
(now.)
   case parseURIAuthority auth of
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/HTTP-4000.3.12/Network/HTTP/Proxy.hs 
new/HTTP-4000.3.14/Network/HTTP/Proxy.hs
--- old/HTTP-4000.3.12/Network/HTTP/Proxy.hs    2018-06-09 17:12:09.000000000 
+0200
+++ new/HTTP-4000.3.14/Network/HTTP/Proxy.hs    2019-06-17 23:33:27.000000000 
+0200
@@ -47,9 +47,15 @@
 
 #if defined(WIN32)
 import System.Win32.Types   ( DWORD, HKEY )
-import System.Win32.Registry( hKEY_CURRENT_USER, regOpenKey, regCloseKey, 
regQueryValue, regQueryValueEx )
+import System.Win32.Registry( hKEY_CURRENT_USER, regOpenKey, regCloseKey, 
regQueryValueEx )
 import Control.Exception    ( bracket )
 import Foreign              ( toBool, Storable(peek, sizeOf), castPtr, alloca )
+
+#if MIN_VERSION_Win32(2,8,0)
+import System.Win32.Registry( regQueryDefaultValue )
+#else
+import System.Win32.Registry( regQueryValue )
+#endif
 #endif
 
 -- | HTTP proxies (or not) are represented via 'Proxy', specifying if a
@@ -103,7 +109,9 @@
   (bracket (uncurry regOpenKey registryProxyLoc) regCloseKey $ \hkey -> do
     enable <- fmap toBool $ regQueryValueDWORD hkey "ProxyEnable"
     if enable
-#if MIN_VERSION_Win32(2,6,0)
+#if MIN_VERSION_Win32(2,8,0)
+        then fmap Just $ regQueryDefaultValue hkey "ProxyServer"
+#elif MIN_VERSION_Win32(2,6,0)
         then fmap Just $ regQueryValue hkey "ProxyServer"
 #else
         then fmap Just $ regQueryValue hkey (Just "ProxyServer")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/HTTP-4000.3.12/Network/HTTP/Utils.hs 
new/HTTP-4000.3.14/Network/HTTP/Utils.hs
--- old/HTTP-4000.3.12/Network/HTTP/Utils.hs    2018-06-09 17:12:09.000000000 
+0200
+++ new/HTTP-4000.3.14/Network/HTTP/Utils.hs    2019-06-17 23:33:27.000000000 
+0200
@@ -27,11 +27,17 @@
        , dropWhileTail -- :: (a -> Bool) -> [a] -> [a]
        , chopAtDelim   -- :: Eq a => a -> [a] -> ([a],[a])
        
+       , toUTF8BS
+       , fromUTF8BS
        ) where
        
+import Data.Bits
 import Data.Char
 import Data.List ( elemIndex )
 import Data.Maybe ( fromMaybe )
+import Data.Word ( Word8 )
+
+import qualified Data.ByteString as BS
 
 -- | @crlf@ is our beloved two-char line terminator.
 crlf :: String
@@ -109,3 +115,93 @@
   case break (==elt) xs of
     (_,[])    -> (xs,[])
     (as,_:bs) -> (as,bs)
+
+toUTF8BS :: String -> BS.ByteString
+toUTF8BS = BS.pack . encodeStringUtf8
+
+fromUTF8BS :: BS.ByteString -> String
+fromUTF8BS = decodeStringUtf8 . BS.unpack
+
+-- | Encode 'String' to a list of UTF8-encoded octets
+--
+-- Code-points in the @U+D800@-@U+DFFF@ range will be encoded
+-- as the replacement character (i.e. @U+FFFD@).
+--
+-- The code is extracted from Cabal library, written originally
+-- Herbert Valerio Riedel under BSD-3-Clause license
+encodeStringUtf8 :: String -> [Word8]
+encodeStringUtf8 []        = []
+encodeStringUtf8 (c:cs)
+  | c <= '\x07F' = w8
+                 : encodeStringUtf8 cs
+  | c <= '\x7FF' = (0xC0 .|.  w8ShiftR  6          )
+                 : (0x80 .|. (w8          .&. 0x3F))
+                 : encodeStringUtf8 cs
+  | c <= '\xD7FF'= (0xE0 .|.  w8ShiftR 12          )
+                 : (0x80 .|. (w8ShiftR  6 .&. 0x3F))
+                 : (0x80 .|. (w8          .&. 0x3F))
+                 : encodeStringUtf8 cs
+  | c <= '\xDFFF'= 0xEF : 0xBF : 0xBD -- U+FFFD
+                 : encodeStringUtf8 cs
+  | c <= '\xFFFF'= (0xE0 .|.  w8ShiftR 12          )
+                 : (0x80 .|. (w8ShiftR  6 .&. 0x3F))
+                 : (0x80 .|. (w8          .&. 0x3F))
+                 : encodeStringUtf8 cs
+  | otherwise    = (0xf0 .|.  w8ShiftR 18          )
+                 : (0x80 .|. (w8ShiftR 12 .&. 0x3F))
+                 : (0x80 .|. (w8ShiftR  6 .&. 0x3F))
+                 : (0x80 .|. (w8          .&. 0x3F))
+                 : encodeStringUtf8 cs
+  where
+    w8 = fromIntegral (ord c) :: Word8
+    w8ShiftR :: Int -> Word8
+    w8ShiftR = fromIntegral . shiftR (ord c)
+
+-- | Decode 'String' from UTF8-encoded octets.
+--
+-- Invalid data in the UTF8 stream (this includes code-points @U+D800@
+-- through @U+DFFF@) will be decoded as the replacement character (@U+FFFD@).
+--
+-- See also 'encodeStringUtf8'
+decodeStringUtf8 :: [Word8] -> String
+decodeStringUtf8 = go
+  where
+    go :: [Word8] -> String
+    go []       = []
+    go (c : cs)
+      | c <= 0x7F = chr (fromIntegral c) : go cs
+      | c <= 0xBF = replacementChar : go cs
+      | c <= 0xDF = twoBytes c cs
+      | c <= 0xEF = moreBytes 3 0x800     cs (fromIntegral $ c .&. 0xF)
+      | c <= 0xF7 = moreBytes 4 0x10000   cs (fromIntegral $ c .&. 0x7)
+      | c <= 0xFB = moreBytes 5 0x200000  cs (fromIntegral $ c .&. 0x3)
+      | c <= 0xFD = moreBytes 6 0x4000000 cs (fromIntegral $ c .&. 0x1)
+      | otherwise   = replacementChar : go cs
+
+    twoBytes :: Word8 -> [Word8] -> String
+    twoBytes c0 (c1:cs')
+      | c1 .&. 0xC0 == 0x80
+      = let d = (fromIntegral (c0 .&. 0x1F) `shiftL` 6)
+             .|. fromIntegral (c1 .&. 0x3F)
+         in if d >= 0x80
+               then  chr d                : go cs'
+               else  replacementChar      : go cs'
+    twoBytes _ cs' = replacementChar      : go cs'
+
+    moreBytes :: Int -> Int -> [Word8] -> Int -> [Char]
+    moreBytes 1 overlong cs' acc
+      | overlong <= acc && acc <= 0x10FFFF && (acc < 0xD800 || 0xDFFF < acc)
+      = chr acc : go cs'
+
+      | otherwise
+      = replacementChar : go cs'
+
+    moreBytes byteCount overlong (cn:cs') acc
+      | cn .&. 0xC0 == 0x80
+      = moreBytes (byteCount-1) overlong cs'
+          ((acc `shiftL` 6) .|. fromIntegral cn .&. 0x3F)
+
+    moreBytes _ _ cs' _
+      = replacementChar : go cs'
+
+    replacementChar = '\xfffd'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/HTTP-4000.3.12/Network/StreamSocket.hs 
new/HTTP-4000.3.14/Network/StreamSocket.hs
--- old/HTTP-4000.3.12/Network/StreamSocket.hs  2018-06-09 17:12:09.000000000 
+0200
+++ new/HTTP-4000.3.14/Network/StreamSocket.hs  2019-06-17 23:33:27.000000000 
+0200
@@ -29,11 +29,15 @@
    ( Stream(..), ConnError(ErrorReset, ErrorMisc), Result
    )
 import Network.Socket
-   ( Socket, getSocketOption, shutdown, send, recv, sClose
+   ( Socket, getSocketOption, shutdown
    , ShutdownCmd(ShutdownBoth), SocketOption(SoError)
    )
+import Network.Socket.ByteString (send, recv)
+import qualified Network.Socket
+   ( close )
 
 import Network.HTTP.Base ( catchIO )
+import Network.HTTP.Utils ( fromUTF8BS, toUTF8BS )
 import Control.Monad (liftM)
 import Control.Exception as Exception (IOException)
 import System.IO.Error (isEOFError)
@@ -50,7 +54,7 @@
 myrecv :: Socket -> Int -> IO String
 myrecv sock len =
     let handler e = if isEOFError e then return [] else ioError e
-        in catchIO (recv sock len) handler
+        in catchIO (fmap fromUTF8BS (recv sock len)) handler
 
 instance Stream Socket where
     readBlock sk n    = readBlockSocket sk n
@@ -59,7 +63,7 @@
     close sk          = do
         -- This slams closed the connection (which is considered rude for 
TCP\/IP)
          shutdown sk ShutdownBoth
-         sClose sk
+         Network.Socket.close sk
     closeOnEnd _sk _  = return () -- can't really deal with this, so do run 
the risk of leaking sockets here.
 
 readBlockSocket :: Socket -> Int -> IO (Result String)
@@ -89,5 +93,5 @@
 writeBlockSocket sk str = (liftM Right $ fn str) `catchIO` (handleSocketError 
sk)
   where
    fn [] = return ()
-   fn x  = send sk x >>= \i -> fn (drop i x)
+   fn x  = send sk (toUTF8BS x) >>= \i -> fn (drop i x)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/HTTP-4000.3.12/Network/TCP.hs 
new/HTTP-4000.3.14/Network/TCP.hs
--- old/HTTP-4000.3.12/Network/TCP.hs   2018-06-09 17:12:09.000000000 +0200
+++ new/HTTP-4000.3.14/Network/TCP.hs   2019-06-17 23:33:27.000000000 +0200
@@ -38,11 +38,13 @@
    ( Socket, SocketOption(KeepAlive)
    , SocketType(Stream), connect
    , shutdown, ShutdownCmd(..)
-   , sClose, setSocketOption, getPeerName
+   , setSocketOption, getPeerName
    , socket, Family(AF_UNSPEC), defaultProtocol, getAddrInfo
    , defaultHints, addrFamily, withSocketsDo
    , addrSocketType, addrAddress
    )
+import qualified Network.Socket
+   ( close )
 import qualified Network.Stream as Stream
    ( Stream(readBlock, readLine, writeBlock, close, closeOnEnd) )
 import Network.Stream
@@ -242,7 +244,7 @@
                             setSocketOption s KeepAlive 1
                             connect s (addrAddress a)
                             socketConnection_ fixedUri port s stashInput
-                            ) (sClose s)
+                            ) (Network.Socket.close s)
 
 -- | @socketConnection@, like @openConnection@ but using a pre-existing 
'Socket'.
 socketConnection :: BufferType ty
@@ -295,7 +297,7 @@
     suck readL
     hClose (connHandle conn)
     shutdown sk ShutdownReceive
-    sClose sk
+    Network.Socket.close sk
 
   suck :: IO Bool -> IO ()
   suck rd = do


Reply via email to