Hello community,
here is the log from the commit of package ghc-streaming-commons for
openSUSE:Factory checked in at 2015-10-06 13:27:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-streaming-commons (Old)
and /work/SRC/openSUSE:Factory/.ghc-streaming-commons.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-streaming-commons"
Changes:
--------
---
/work/SRC/openSUSE:Factory/ghc-streaming-commons/ghc-streaming-commons.changes
2015-09-17 09:19:37.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.ghc-streaming-commons.new/ghc-streaming-commons.changes
2015-10-06 13:27:31.000000000 +0200
@@ -1,0 +2,12 @@
+Sun Oct 4 17:05:13 UTC 2015 - [email protected]
+
+- update to 0.1.14.2
+* Fix bug in process exception display of args with spaces/quotes
+
+-------------------------------------------------------------------
+Sun Sep 27 10:22:45 UTC 2015 - [email protected]
+
+- update to 0.1.14.1
+* Exporting HasReadBufferSize; instance for ClientSettingsUnix
+
+-------------------------------------------------------------------
Old:
----
streaming-commons-0.1.13.tar.gz
New:
----
streaming-commons-0.1.14.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-streaming-commons.spec ++++++
--- /var/tmp/diff_new_pack.CESpEe/_old 2015-10-06 13:27:32.000000000 +0200
+++ /var/tmp/diff_new_pack.CESpEe/_new 2015-10-06 13:27:32.000000000 +0200
@@ -21,7 +21,7 @@
%bcond_with tests
Name: ghc-streaming-commons
-Version: 0.1.13
+Version: 0.1.14.2
Release: 0
Summary: Common lower-level functions needed by various streaming data
libraries
License: MIT
++++++ streaming-commons-0.1.13.tar.gz -> streaming-commons-0.1.14.2.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/streaming-commons-0.1.13/ChangeLog.md
new/streaming-commons-0.1.14.2/ChangeLog.md
--- old/streaming-commons-0.1.13/ChangeLog.md 2015-09-10 17:21:38.000000000
+0200
+++ new/streaming-commons-0.1.14.2/ChangeLog.md 2015-09-27 06:37:17.000000000
+0200
@@ -1,3 +1,11 @@
+## 0.1.14.2
+
+* Fix bug in process exception display of args with spaces/quotes
+
+## 0.1.14
+
+* Exporting HasReadBufferSize; instance for ClientSettingsUnix
[#24](https://github.com/fpco/streaming-commons/pull/24)
+
## 0.1.13
* Make size of read buffer configurable, change default size to 32 kiB
[#23](https://github.com/fpco/streaming-commons/pull/23)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/streaming-commons-0.1.13/Data/Streaming/Network.hs
new/streaming-commons-0.1.14.2/Data/Streaming/Network.hs
--- old/streaming-commons-0.1.13/Data/Streaming/Network.hs 2015-09-10
17:21:38.000000000 +0200
+++ new/streaming-commons-0.1.14.2/Data/Streaming/Network.hs 2015-09-27
06:37:17.000000000 +0200
@@ -28,6 +28,7 @@
, HasPort (..)
, HasAfterBind (..)
, HasReadWrite (..)
+ , HasReadBufferSize (..)
#if !WINDOWS
, HasPath (..)
#endif
@@ -535,20 +536,33 @@
setAfterBind :: HasAfterBind a => (Socket -> IO ()) -> a -> a
setAfterBind p = runIdentity . afterBindLens (const (Identity p))
+-- | Since 0.1.13
class HasReadBufferSize a where
readBufferSizeLens :: Functor f => (Int -> f Int) -> a -> f a
+-- | Since 0.1.13
instance HasReadBufferSize ServerSettings where
readBufferSizeLens f ss = fmap (\p -> ss { serverReadBufferSize = p }) (f
(serverReadBufferSize ss))
+-- | Since 0.1.13
instance HasReadBufferSize ClientSettings where
readBufferSizeLens f cs = fmap (\p -> cs { clientReadBufferSize = p }) (f
(clientReadBufferSize cs))
#if !WINDOWS
+-- | Since 0.1.13
instance HasReadBufferSize ServerSettingsUnix where
readBufferSizeLens f ss = fmap (\p -> ss { serverReadBufferSizeUnix = p })
(f (serverReadBufferSizeUnix ss))
+-- | Since 0.1.14
+instance HasReadBufferSize ClientSettingsUnix where
+ readBufferSizeLens f ss = fmap (\p -> ss { clientReadBufferSizeUnix = p })
(f (clientReadBufferSizeUnix ss))
#endif
+-- | Get buffer size used when reading from socket.
+--
+-- Since 0.1.13
getReadBufferSize :: HasReadBufferSize a => a -> Int
getReadBufferSize = getConstant . readBufferSizeLens Constant
+-- | Set buffer size used when reading from socket.
+--
+-- Since 0.1.13
setReadBufferSize :: HasReadBufferSize a => Int -> a -> a
setReadBufferSize p = runIdentity . readBufferSizeLens (const (Identity p))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/streaming-commons-0.1.13/Data/Streaming/Process.hs
new/streaming-commons-0.1.14.2/Data/Streaming/Process.hs
--- old/streaming-commons-0.1.13/Data/Streaming/Process.hs 2015-09-10
17:21:38.000000000 +0200
+++ new/streaming-commons-0.1.14.2/Data/Streaming/Process.hs 2015-09-27
06:37:17.000000000 +0200
@@ -179,7 +179,12 @@
]
where
showCmdSpec (ShellCommand str) = str
- showCmdSpec (RawCommand x xs) = unwords (x:xs)
+ showCmdSpec (RawCommand x xs) = unwords (x:map showArg xs)
+
+ -- Ensure that strings that need to be escaped are
+ showArg x
+ | any (\c -> c == '"' || c == ' ') x = show x
+ | otherwise = x
instance Exception ProcessExitedUnsuccessfully
-- | Run a process and supply its streams to the given callback function. After
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/streaming-commons-0.1.13/streaming-commons.cabal
new/streaming-commons-0.1.14.2/streaming-commons.cabal
--- old/streaming-commons-0.1.13/streaming-commons.cabal 2015-09-10
17:21:38.000000000 +0200
+++ new/streaming-commons-0.1.14.2/streaming-commons.cabal 2015-09-27
06:37:17.000000000 +0200
@@ -1,5 +1,5 @@
name: streaming-commons
-version: 0.1.13
+version: 0.1.14.2
synopsis: Common lower-level functions needed by various streaming
data libraries
description: Provides low-dependency functionality commonly needed by
various streaming data libraries, such as conduit and pipes.
homepage: https://github.com/fpco/streaming-commons
@@ -88,6 +88,7 @@
Data.Streaming.FileReadSpec
Data.Streaming.FilesystemSpec
Data.Streaming.NetworkSpec
+ Data.Streaming.ProcessSpec
Data.Streaming.TextSpec
Data.Streaming.ZlibSpec
build-depends: base
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/streaming-commons-0.1.13/test/Data/Streaming/FilesystemSpec.hs
new/streaming-commons-0.1.14.2/test/Data/Streaming/FilesystemSpec.hs
--- old/streaming-commons-0.1.13/test/Data/Streaming/FilesystemSpec.hs
2015-09-10 17:21:38.000000000 +0200
+++ new/streaming-commons-0.1.14.2/test/Data/Streaming/FilesystemSpec.hs
2015-09-27 06:37:17.000000000 +0200
@@ -39,10 +39,14 @@
ft `shouldBe` FTDirectorySym
it "other" $ do
_ <- tryIO $ removeLink "tmp"
- createNamedPipe "tmp" 0
- ft <- getFileType "tmp"
- _ <- tryIO $ removeLink "tmp"
- ft `shouldBe` FTOther
+ e <- tryIO $ createNamedPipe "tmp" 0
+ case e of
+ -- Creating named pipe might fail on some filesystems
+ Left _ -> return ()
+ Right _ -> do
+ ft <- getFileType "tmp"
+ _ <- tryIO $ removeLink "tmp"
+ ft `shouldBe` FTOther
it "recursive symlink is other" $ do
_ <- tryIO $ removeLink "tmp"
createSymbolicLink "tmp" "tmp"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/streaming-commons-0.1.13/test/Data/Streaming/ProcessSpec.hs
new/streaming-commons-0.1.14.2/test/Data/Streaming/ProcessSpec.hs
--- old/streaming-commons-0.1.13/test/Data/Streaming/ProcessSpec.hs
1970-01-01 01:00:00.000000000 +0100
+++ new/streaming-commons-0.1.14.2/test/Data/Streaming/ProcessSpec.hs
2015-09-27 06:37:17.000000000 +0200
@@ -0,0 +1,59 @@
+{-# LANGUAGE CPP #-}
+module Data.Streaming.ProcessSpec (spec, main) where
+
+import Test.Hspec
+import Test.Hspec.QuickCheck (prop)
+import Control.Concurrent.Async (concurrently)
+import qualified Data.ByteString.Lazy as L
+import qualified Data.ByteString as S
+import System.Exit
+import Control.Concurrent (threadDelay)
+import Data.Streaming.Process
+import System.IO (hClose)
+
+main :: IO ()
+main = hspec spec
+
+spec :: Spec
+spec = do
+#ifndef WINDOWS
+ prop "cat" $ \wss -> do
+ let lbs = L.fromChunks $ map S.pack wss
+ (sink, source, Inherited, cph) <- streamingProcess (shell "cat")
+ ((), bs) <- concurrently
+ (do
+ L.hPut sink lbs
+ hClose sink)
+ (S.hGetContents source)
+ L.fromChunks [bs] `shouldBe` lbs
+ ec <- waitForStreamingProcess cph
+ ec `shouldBe` ExitSuccess
+
+ it "closed stream" $ do
+ (ClosedStream, source, Inherited, cph) <- streamingProcess (shell
"cat")
+ bss <- S.hGetContents source
+ bss `shouldBe` S.empty
+
+ ec <- waitForStreamingProcess cph
+ ec `shouldBe` ExitSuccess
+
+ it "checked process" $ do
+ let isRightException ProcessExitedUnsuccessfully {} = True
+ withCheckedProcess (proc "false" [])
+ (\Inherited Inherited Inherited -> return ())
+ `shouldThrow` isRightException
+
+#endif
+ it "blocking vs non-blocking" $ do
+ (ClosedStream, ClosedStream, ClosedStream, cph) <- streamingProcess
(shell "sleep 1")
+
+ mec1 <- getStreamingProcessExitCode cph
+ mec1 `shouldBe` Nothing
+
+ threadDelay 1500000
+
+ mec2 <- getStreamingProcessExitCode cph
+ mec2 `shouldBe` Just ExitSuccess
+
+ ec <- waitForStreamingProcess cph
+ ec `shouldBe` ExitSuccess